Skip to main content

Lumerical MCP Server

MCP (Model Context Protocol) server for controlling Lumerical FDTD simulations from LLMs.

Installation

cd lumerical-mcp
pip install -e .

Configuration

Required Environment Variable

# Windows (PowerShell)
$env:LUMERICAL_ROOT = "D:\Program Files\ANSYS Inc\v251\Lumerical"

# Windows (cmd)
set LUMERICAL_ROOT=D:\Program Files\ANSYS Inc\v251\Lumerical

# Linux/macOS
export LUMERICAL_ROOT=/opt/lumerical/v251

Optional Environment Variables

Variable Default Description
MCP_HOST 127.0.0.1 Server bind address
MCP_PORT 8000 Server port
MCP_TRANSPORT streamable-http Transport protocol (streamable-http or stdio)
MCP_WORK_DIR Current directory Working directory for relative paths
MCP_LOG_LEVEL INFO Log level (DEBUG, INFO, WARNING, ERROR)

Config File (Optional)

Create ~/.config/lumerical-mcp/config.json:

{
  "MCP_HOST": "127.0.0.1",
  "MCP_PORT": 8000,
  "MCP_TRANSPORT": "streamable-http",
  "MCP_WORK_DIR": "C:/Users/name/projects/lumerical",
  "MCP_LOG_LEVEL": "INFO"
}

Environment variables take precedence over config file.

Running the Server

lumerical-mcp

Or with custom settings:

MCP_PORT=9000 MCP_TRANSPORT=stdio lumerical-mcp

Available Tools

Tool Description
hello Connectivity check
start_fdtd / end_fdtd Start/stop FDTD API session
open_projects / fdtd_load_project_tool Load .fsp project
save_project / fdtd_save_project_tool Save project
set_parameter Set object property
run_simulation / fdtd_run_simulation_tool Run simulation
get_transmission Get transmission spectrum from monitor
fdtd_eval_script_tool Execute Lumerical script
fdtd_eval_script_get_tool Execute script and return variable
fdtd_run_script_file_tool Run .lsf/.lsfx script file
fdtd_get_variable_tool / fdtd_put_variable_tool Read/write script variables
fdtd_launch_gui_tool Launch Lumerical GUI
fdtd_command_docs_tool Search command documentation

Client Usage

# Using the test client
python client_test.py

# Or with custom server address
MCP_HOST=192.168.1.100 MCP_PORT=9000 python client_test.py

LLM Client Configuration

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "lumerical": {
      "command": "lumerical-mcp",
      "env": {
        "LUMERICAL_ROOT": "D:\\Program Files\\ANSYS Inc\\v251\\Lumerical"
      }
    }
  }
}

VS Code / Continue / Other MCP Clients

{
  "mcpServers": {
    "lumerical": {
      "command": "lumerical-mcp",
      "args": [],
      "env": {
        "LUMERICAL_ROOT": "/opt/lumerical/v251"
      }
    }
  }
}

Development

pip install -e .[dev]
ruff check .
pytest

License

MIT

Metadata

Release files for lumerical-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lumerical-mcp 0.1.0
File Size Uploaded
lumerical_mcp-0.1.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lumerical-mcp 0.1.0
File Interpreter ABI Platform
lumerical_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / lumerical_mcp-0.1.0.tar.gz

Download URL lumerical_mcp-0.1.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8a65ab0c3a300ebe08333738ba0a5f86d8f6705dd16d35a6161e425d86c81e8e
BLAKE2b-256 checksum
How to use checksums
1e4a75ea58a0ec384d5b0c0f921dc69a59e510146985851be5aeddf7d066f7c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / lumerical_mcp-0.1.0-py3-none-any.whl

Download URL lumerical_mcp-0.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5920b28489d0e67997e0ae56185e471023eeced3927987155b2976b1ead87d07
BLAKE2b-256 checksum
How to use checksums
f4afa5a8b2477e83ce4840d7ac3f50c33602f3c330fbf31748a1bf0bd0c62a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page