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.
Table of Contents
Tidy3D extension on Cursor/ VS Code
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.

Installation & Setup
Prerequisites & System Requirements
-
-
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
Extension Installation
-
-
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
Tidy3D Account Setup
-
-
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
Agent Instruction Files
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
Python Environment Setup (Optional)
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:
# 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
Opening and Using the Viewer
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
AI-Controlled Viewer Operations
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