Skip to main content

Local stdio FastMCP server for Tidy3D

Project description

Tidy3D MCP

A local Model Context Protocol (MCP) server that lets clients drive the Flexcompute Tidy3D viewer and consume viewer artifacts without needing a browser session.

Capabilities

  • Authenticates against the remote FlexAgent MCP endpoint using your Tidy3D API key.
  • Proxies viewer automation commands such as launching the viewer, rotating the camera, toggling structure visibility, running simulation health checks, and capturing screenshots.
  • Returns viewer captures as MCP images so downstream tools can consume them immediately.

Requirements

  • Python 3.10 or newer
  • uv for dependency management
  • Network access to the target FlexAgent MCP deployment (defaults to the hosted https://flexagent.dev-simulation.cloud/ endpoint)

Installation

uv sync

This resolves the project environment and installs the tidy3d-mcp console entry point.

Usage

Start the server from the project root and supply your API key (see Tidy3D installation docs for instructions to obtain it):

uv run tidy3d-mcp -- --api-key YOUR_TIDY3D_API_KEY

The server listens on stdio for MCP requests and forwards them to the remote FlexAgent server using the provided API key for authentication.

Integrating with MCP Hosts

  • VS Code / Cursor: Select the "Tidy3D MCP" binary (uv run tidy3d-mcp) when configuring an stdio MCP provider.
  • Custom hosts: Launch the command above and connect using the Model Context Protocol over the process stdio pipes.

Configuration

Environment variables control the server at startup:

Variable Purpose Default
REMOTE_MCP_URL Target MCP endpoint to proxy. https://flexagent.dev-simulation.cloud/

Pass --api-key whenever you launch the server. Hosts that wrap the binary must forward that argument when spawning the process.

Tools Exposed to Clients

Tool Description
start_viewer Launches the viewer for a simulation file and returns the resolved viewer_id.
rotate_viewer Rotates the active viewer toward the requested direction (e.g. TOP, BOTTOM).
show_structures Applies a boolean visibility array to the current viewer structures.
capture Captures the current frame of the viewer.
check_simulation Returns validation warnings or errors reported by the viewer.

Development Tips

  • Run uv run ruff check to lint the project and uv run ruff format to apply formatting.
  • The server relies on fastmcp.as_proxy; consult the upstream FastMCP documentation for advanced configuration such as custom authentication flows or additional transports.
  • When debugging viewer interactions, inspect the returned data_url to confirm that capture payloads reach the client.

Troubleshooting

  • API key rejected: Confirm the key is current by visiting the Tidy3D account page and copying a fresh key. Keys can be regenerated through the web interface if needed.
  • Viewer fails to start: Verify the simulation file exists, the MCP host provides the correct working directory, and the remote FlexAgent endpoint is reachable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tidy3d_mcp-0.12.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tidy3d_mcp-0.12.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file tidy3d_mcp-0.12.2.tar.gz.

File metadata

  • Download URL: tidy3d_mcp-0.12.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for tidy3d_mcp-0.12.2.tar.gz
Algorithm Hash digest
SHA256 29e688aca7d79277327f03cf0b42a01e6c4c3e3657d85e0a40ee1cda00e390fa
MD5 9cb879df41a19a84f333088e26268a00
BLAKE2b-256 8a49af8e1cb5f61707216c75b231b02161e05c7b64f3806f552193ba1c507fc9

See more details on using hashes here.

File details

Details for the file tidy3d_mcp-0.12.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tidy3d_mcp-0.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d3faa61e00f74ec16cfbf1bf3ff2b1fa19c49a59f35fdf595566b3b52c68c8de
MD5 022a34687ecba262d80e9113ed078686
BLAKE2b-256 f6186d6883a723fc5e07b484f399076bec64b9f4fb4df62f91de078f7018d880

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page