We introduced FlexAgent MCP in the article "Learn About FlexAgent MCP", which is essentially an AI-powered assistance tool - a Physics-informed assistance feature through Cursor agent and Tidy3D MCP integration. The extension integrates with Cursor's agent to provide physics-aware assistance for electromagnetic simulations. Unlike generic coding assistants, this integration understands Tidy3D workflows and can control the 3D viewer. Here, we will introduce how to use FlexAgent MCP within Cursor.
The Tidy3D extension integrates Tidy3D's electromagnetic simulation platform directly into code editors, such as Cursor or VS Code. It automatically detects simulations in Tidy3D Python scripts and notebooks, opens an interactive 3D viewer alongside the code, and allows the agent to utilize the integrated Tidy3D MCP server for an intelligent, contextโaware assistance experience. Using the Tidy3D extension, you will experience a completely natural language interaction and code-free workflow for building, iterating, and visualizing electromagnetic simulations.
Cursor: Desktop version compatible with VS Code API 1.99.3 or newer. Look here for Cursor installation.
Python Support: Python language features enabled in Cursor for notebooks and Python files
Internet Access: Required for initial downloads and cloud connectivity
Operating System: Windows, macOS, or Linux
From Cursor extensions view
- Open Cursor and go to Extensions view (View โ Extensions)
- Search for "Tidy3D" by Flexcompute
- Click "Install" on the official extension
Look here for detailed guidance.
Direct installation
- Visit open VSX: Tidy3D Extension
- Click "Install" and follow prompts to open in Cursor
Post-installation
- Ensure Python support is enabled
- Restart Cursor if prompted
Create a free Tidy3D account
- Visit tidy3d.simulation.cloud/signup
- Complete registration
- Verify your email address
Get API key
- Log in to SimCloud
- Navigate to Account โ API Key tab
- Copy your personal API key
Configure Tidy3D extension
- In Cursor: Cmd/Ctrl+Shift+P โ Tidy3D: Run Tidy3D Workspace Setup
- Paste your API key when prompted
- Extension will verify connectivity and set up MCP server
After running Cmd/Ctrl+Shift+P โ Tidy3D: Run Tidy3D Workspace Setup
, the extension creates instruction files under .cursor/rules/
.
Cursor automatically loads these rules - no additional configuration needed. The rules enhance the agent with Tidy3D-specific knowledge and capabilities, including:
Documentation integration and search
Simulation validation and troubleshooting
Viewer control and visualization guidance
While you can view simulations without a local Python setup, notebook execution requires a configured environment. Visit the Tidy3D Python installation for detailed instructions.
Environment Managers Supported:
uv
(recommended for new projects)
conda
/ micromamba
poetry
, rye
, hatch
venv
(Python standard library)
Example with uv:
# Install uv from https://docs.astral.sh/uv/getting-started/installation/
uv init my-tidy3d-project
cd my-tidy3d-project
uv add tidy3d jupyter numpy matplotlib
uv sync
Environment Selection in Cursor:
Open Command Palette (Cmd/Ctrl+Shift+P
)
Type "Python: Select Interpreter"
Choose your Tidy3D environment
Verify with import tidy3d
in a notebook cell
The Tidy3D viewer automatically detects simulation objects in your Python files and notebooks. No code execution required โ the viewer parses your td.Simulation(...)
definitions directly from the source code.
Access Methods:
Status Bar: Click "Tidy3D: N simulations" entry
Command Palette: `Tidy3D: Open Tidy3D`
Context Menu: Right-click in Python editor (`.py` files)
Real-Time Updates:
Geometry changes reflect instantly in the viewer
Material property modifications update colors
Source and monitor positioning updates automatically
No need to re-execute cells or restart kernels
Multi-Simulation Support:
Navigate between multiple simulations in the same file
Quick picker for simulation selection
Independent viewer instances for comparison
The agent can control the viewer programmatically through integrated MCP tools:
Viewer Navigation:
tidy3d_start_viewer(file, symbol)
โ Open live 3D viewer
Automatic camera positioning and scene setup
Structure visibility toggling and material highlighting
Screenshot & Documentation:
tidy3d_capture(viewer_id)
โ Capture viewer images
Automatic annotation of sources (green) and monitors (yellow)
Integration with reports and documentation workflows
Structure Analysis:
tidy3d_show_structures(viewer_id, visibility)
โ Toggle structure visibility
Layer-by-layer analysis of complex geometries
Material property visualization and validation
Simulation Validation:
tidy3d_check_simulation(viewer_id)
โ Surface viewer reports
Physics validation and warning detection
Automatic re-checking after code modifications