Using FlexAgent MCP Within Cursor

Emerson Melo, PhD
Published 17 Oct 2025

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. 

Screenshot 2025-10-16 at 8.40.40 AM

 

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
    1. 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.

    2. Direct installation

      - Visit open VSX: Tidy3D Extension

      - Click "Install" and follow prompts to open in Cursor

    3. Post-installation

      - Ensure Python support is enabled

      - Restart Cursor if prompted

Tidy3D Account Setup
    1. Create a free Tidy3D account

      - Visit tidy3d.simulation.cloud/signup

      - Complete registration

      - Verify your email address

    2. Get API key

      - Log in to SimCloud

      - Navigate to Account → API Key tab

      - Copy your personal API key

    3. 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:

    • 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:

    1. Open Command Palette (Cmd/Ctrl+Shift+P)

    2. Type "Python: Select Interpreter"

    3. Choose your Tidy3D environment

    4. Verify with import tidy3d in a notebook cell

 

3D Viewer


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

 

You Might Also Like
Learn About FlexAgent MCP

Learn About FlexAgent MCP

16 Oct 2025 By Frederik Schubert, Ph.D.
Flow360 Feature Update: Solution Interpolation on a New Mesh

Flow360 Feature Update: Solution Interpolation on a New Mesh

31 Jul 2025 By Jolie Duquene
Learn Electromagnetic Simulation in One Minute: Quick Video Guides for the Multiphysics Solver Workbenches

Learn Electromagnetic Simulation in One Minute: Quick Video Guides for the Multiphysics Solver Workbenches

25 Jul 2025 By Qing Hu, PhD