Tidy3D + AI π‘#
Ushering in a new era of AI-assisted photonic design
We are pleased to announce the release of the new Tidy3D Extension, which enables seamless building, visualization, and iteration on electromagnetic simulations within Visual Studio Code or Cursor. The extension automatically detects simulations in Tidy3D Python scripts and notebooks, opens an interactive 3D viewer alongside your code, and enables the IDE AI assistant to leverage the integrated FlexAgent MCP server for an intelligent, physicsβaware assistance experience.
Key Components#
FlexAgent MCP#
FlexAgent MCP is a physics-aware AI assistant that understands Tidy3D workflows and electromagnetic simulation concepts. Unlike generic coding assistants, FlexAgent provides specialized knowledge and can control the 3D Viewer to provide comprehensive, context-aware support.
Key Capabilities:
Natural Language Interaction β Build, modify, and analyze simulations using plain English
Physics-Aware β Understands electromagnetic simulation concepts and Tidy3Dβs API
Learning & Troubleshooting β Get explanations and fix simulation issues
Code Generation β Create complete simulation setups from scratch
Result Analysis β Interpret and visualize simulation data
3D Viewer#
The 3D Viewer provides interactive, real-time visualization of Tidy3D simulations directly within your IDE. It automatically detects simulation objects in your code and opens alongside your editor, providing immediate visual feedback as you develop.
Key Features:
Automatic Detection β Identifies
Simulationobjects and opens automaticallyLive Synchronization β Updates instantly when you modify code
Interactive Navigation β Rotate, zoom, and pan to explore simulations
AI-Controlled β FlexAgent can navigate and explain the 3D scene
Comprehensive Visualization β View structures, sources, monitors, and boundaries
Video Demos#
Watch these demonstration videos to see Tidy3D + AI capabilities in action. Each video showcases specific workflows and features that highlight how FlexAgent MCP and the 3D Viewer can accelerate your photonic design process.
Mode Analysis β Learn how to use AI assistance to perform mode analysis and understand waveguide modes
Data Analysis β See how FlexAgent helps analyze simulation results and extract meaningful insights from your data
Convergence Test β Discover how to set up and run convergence tests with AI guidance to ensure simulation accuracy
Cost Estimation β Understand how to estimate simulation costs and optimize your computational resources with AI assistance
For more comprehensive tutorials and the complete video series, visit our Tidy3D + AI Video Playlist.
Using Tidy3D with AI Coding Agents#
The FlexAgent MCP works with any MCP-compatible AI coding agent β not just the Tidy3D IDE extensions. To get started:
Set up the MCP β follow the instructions in FlexAgent MCP β Standalone MCP Client for your client (Claude Code, Codex CLI, Cursor, Gemini CLI, etc.).
Add a bootstrap file β save the markdown below as
AGENTS.md(orCLAUDE.mdfor Claude Code) in your project root directory. This tells the agent how to use the MCP effectively.Review the simulation tips β the Simulation Tips for AI Agents page covers workflow patterns, parameter sweeps, inverse design, and common pitfalls.
# Tidy3D Agent Instructions
## MCP Setup
If the Tidy3D MCP server is not already configured, see:
https://docs.flexcompute.com/projects/tidy3d/en/latest/ai/flex_agent.html#standalone-mcp-client
## Workflow
Use `search_flexcompute_docs` and `fetch_flexcompute_doc` from the Tidy3D MCP as
your primary documentation source throughout the session. Before writing simulation
code:
1. Search for "Simulation Tips for AI Agents" β workflow patterns, pitfalls,
and checklists.
2. Search for the relevant class docstrings β they contain selection guides,
extraction patterns, and practical advice.
3. Search for example notebooks related to the device or workflow you are building.
- FlexAgent MCP
- 3D Viewer
- Simulation Tips for AI Agents
- Tidy3D for Cursor
- Tidy3D for VS Code