Skip to main content
Glama
FD Solutions MCP Server

FD Solutions MCP Server

by SimWorksSoft

FD Solutions MCP Server

Python Apache

English | 简体中文

MCP (Model Context Protocol) server for common LLM clients such as Cursor, Claude Desktop, Claude Code, VS Code (GitHub Copilot / MCP), Windsurf, and Cline. It drives the local simulation software through the SimWorks FD Solutions Python API.

On a machine with FD Solutions installed, an AI assistant can handle modeling and layout, property setup, running simulations, and analyzing results.

Note: This repository provides the MCP server only. The FD Solutions Python API ships with the FD Solutions product install and is not a pip dependency of this project.

Features

  • STDIO transport by default (works with most LLM / MCP clients), with optional streamable HTTP

  • Broad tool coverage for adding and configuring structures, sources, and monitors, plus running simulations, parameter sweeps, job management, and other common product workflows

  • Locate the local FD Solutions Python API via environment variables or config.json

Related MCP server: DiffBeam MCP Server

Requirements

  • Python 3.10+

  • The FD Solutions product installed

  • A valid FD Solutions product license

Installation

pip install "git+https://github.com/SimWorksSoft/fdsolutions-mcp.git"

Or clone and install:

git clone https://github.com/SimWorksSoft/fdsolutions-mcp.git
cd fdsolutions-mcp
python -m venv .venv

# Windows PowerShell
.\.venv\Scripts\Activate.ps1
# Linux / macOS
# source .venv/bin/activate

pip install -e .

Configure the FD Solutions Python API path

Before start-up the server must be able to import simworks. Resolution order:

  1. Environment variables (highest priority)

    • FDSOLUTIONS_PYTHON_API — directory that contains simworks.py (usually <FD Solutions install root>/api/python)

    • or FDSOLUTIONS_HOME — FD Solutions install root (uses <home>/api/python)

  2. config.json if env is unset or invalid

    • Search order: current working directory → directory next to server.py

    • Field: python_api_path — path to <FD Solutions install root>/api/python (relative paths are resolved against the directory of config.json)

Copy the example file and edit it for your machine:

cp config.example.json config.json

Environment examples

PowerShell:

$env:FDSOLUTIONS_PYTHON_API = "C:\Program Files\SimWorks\SimWorks FD Solutions\api\python"
# or
$env:FDSOLUTIONS_HOME = "C:\Program Files\SimWorks\SimWorks FD Solutions"

bash:

export FDSOLUTIONS_PYTHON_API="/opt/SimWorks FD Solutions/api/python"
# or
export FDSOLUTIONS_HOME="/opt/SimWorks FD Solutions"

config.json example

{
  "python_api_path": "C:/Program Files/SimWorks/SimWorks FD Solutions/api/python"
}

Product installs may also ship a config.json under api/mcp_server/ with a relative path. Open-source / pip users should prefer an absolute python_api_path or environment variables.

How to run

Default transport is stdio (recommended for most LLM clients):

fdsolutions-mcp

Optional HTTP mode:

fdsolutions-mcp --transport streamable-http --host 127.0.0.1 --port 3001

You can also run from a product install tree:

cd "<FD Solutions install root>/api/mcp_server"
python server.py
python server.py --transport streamable-http --host 127.0.0.1 --port 3001

Connect from an MCP client

Let the client spawn the server process. Example:

{
  "mcpServers": {
    "fdsolutions": {
      "command": "fdsolutions-mcp",
      "args": [],
      "env": {
        "FDSOLUTIONS_PYTHON_API": "C:/Program Files/SimWorks/SimWorks FD Solutions/api/python"
      }
    }
  }
}

If you use a virtual environment, point command at that environment’s fdsolutions-mcp (or the matching python + script path). Exact config UI and file names vary by client — follow your client’s MCP documentation.

HTTP (optional)

fdsolutions-mcp --transport streamable-http --host 127.0.0.1 --port 3001

Endpoint: http://<host>:<port>/mcp (default http://127.0.0.1:3001/mcp)

{
  "mcpServers": {
    "fdsolutions": {
      "url": "http://127.0.0.1:3001/mcp"
    }
  }
}

Start this MCP server first, then connect from the client.

CLI options

Option

Default

Description

--transport

stdio

stdio or streamable-http

--host

127.0.0.1

Bind address (HTTP only)

--port

3001

HTTP port (HTTP only)

--log-level

INFO

DEBUG / INFO / WARNING / ERROR / CRITICAL

License

This project is licensed under the Apache License 2.0.

Disclaimer

This MCP server is a companion component and requires a local, licensed FD Solutions installation. Available capabilities follow the product’s exposed Python API and may change across releases.

Available Tools

20 tools
addAdd objectA

Add a simulation object (SimWorks add* only; configure with set_property).

After success, the reply includes Name='...'. Record that exact name for later select / set / delete. Do not call add again for an object that already exists (especially port_group, mode_port, fdtd) — if select fails, use object_action path forms instead of re-adding. Docs: https://simworks.net/knowledge-base/Script-Commands_setting-objects

Inputs: kind (required), x_pos, y_pos, z_pos, +3 more. Returns: result

add_group_variableAdd group variableB

Configure a setup, parameter, or result variable on the selected group.

Inputs: kind (required), value_name (required), value_data, value_type. Returns: result

dataset_queryDataset queryC

Query parameters or attributes on a dataset object (not fd_instance).

Inputs: kind (required), dataset_obj (required), name.

file_ioFile I/OC

Low-level file open/close/write helpers.

Inputs: action (required), args, data, file_path, +3 more. Returns: result

get_infoGet infoA

Discover properties and metadata. Prefer this before inventing property names for set.

kind=eme_analysis calls getemeanalysis(name) for the EME Analysis Window (not object get). Pair with set_eme_analysis; sweep results use get_results(kind="eme_sweep").

Inputs: kind (required), name, name2, name3, +6 more.

get_resultsGet resultsA

Extract simulation results. For kind=data, call with no dataset/data first (LIST MODE) to discover available names, then call again with object_name + dataset_name [+ data_name].

kind=eme_sweep: getemesweep(dataset_name) after run_action(eme_sweep). Configure the analysis window with set_eme_analysis / get_info(eme_analysis).

Inputs: kind (required), id_val, data_name, wavelength, +6 more. Returns: result

group_membershipGroup membershipB

Add the selected object to a group, or remove it from its current group.

Inputs: action (required), group_name. Returns: result

jobs_actionJobsC

Manage the simulation job queue.

Inputs: action (required), file_path, solver_type, parallel_mode. Returns: result

load_dataLoad dataA

Load a script file, data files, or import NK / raw arrays into the workspace.

  • kind="script": SimWorks load('file_path') — loads and runs a script (e.g. .msf). Prefer an absolute path.

  • To open a project (.sim / .mpps etc.), use project_action(action="open").

  • Other kinds load data into the workspace (mdf/mat/h5/…), not scripts.

Inputs: kind (required), x, x0, y0, +13 more. Returns: result

material_actionMaterialB

List, add, set, or query materials. Do not invent material names — list first if unsure.

Inputs: action (required), data_type, model_name, wavelength, +3 more. Returns: result

object_actionObject actionC

Manipulate selection and objects in the project tree (SI meters for vertices).

Select cheat-sheet (SimWorks select / selectpartial / shiftselect*):

  • Structures at root: select('Ring').

  • Under FDTD: select('FDTD::MonitorName').

  • Mode ports: select('FDTD::Ports::Port_input') — include solver + port group + port. Omitting FDTD:: is the usual reason select fails.

  • Discover group: select_partial('::Ports') or select_partial('FDTD::Port').

  • Multi-select: shift_select / shift_select_partial add without clearing (same group only); then set_property applies to all selected.

  • If select fails: retry with FDTD::<Group>::<Child>; never re-add or disable.

Inputs: action (required), k, name, name2, +3 more. Returns: result

project_actionProjectC

Open, save, or create a simulation project. Prefer absolute paths.

Inputs: action (required), path. Returns: result

run_actionRun / solveA

Run solvers, sweeps, or analysis scripts.

Confirm with the user before action=run / run_sweep / eme_sweep. If the call blocks until done and the MCP request times out, the solver may still be running in SimWorks — do not issue a second start to "retry" a timeout.

Inputs: action (required), object_name, eme_sweep_mode. Returns: result

save_dataSave dataA

Save workspace variables to a file. Use project_action(save) to save the .sim project.

Inputs: kind (required), file_path (required), var_names. Returns: result

set_eme_analysisSet EME analysisA

Set one parameter on the EME Analysis Window (setemeanalysis).

Use this before run_action(eme_sweep) / eme_propagate when you need to configure sweep type, wavelength range, cell group span, tolerances, energy conservation, etc.

This is not set_property: it does not touch the selected object and get_info(kind="property") will not list these names. Read back with get_info(kind="eme_analysis"). After a sweep, fetch results with get_results(kind="eme_sweep").

Inputs: value (required), parameter (required). Returns: result

set_propertySet propertyA

Set one property on the currently selected object(s).

Prefer calling directly when you know the exact SimWorks property name. Numbers are SI only. On failure, get_info(kind="property"), then retry only the failed property — do not invent names from similar software. If you set name, remember the new name for later object_action select (use Parent::Child when nested).

After a simulation finishes, many properties can only be set in design layout. If set fails with a design-layout / inactive message, call switch_layout(layout="design") (confirm first if results would be lost), then retry — do not re-add objects to work around this.

Inputs: value (required), property_name (required), k. Returns: result

set_source_signalSet source signalA

Assign a user-defined time-domain signal to an existing source (setsourcesignal).

Used in FDTD / FDFD for custom pulses (modulated Gaussian, multi-peak, etc.). This is not set_property — ordinary wavelength / pulse settings still use set_property on the selected source.

t, amplitude, and phase must be equal-length 1D vectors (SI: s, —, rad). Prefer starting t at 0 so the initial field is zero.

Inputs: t (required), phase (required), amplitude (required), source_name (required), +2 more. Returns: result

switch_layoutSwitch layoutA

Switch between run and design layout modes.

Workflow: run simulation → (extract results) → switch_layout('design') before further edits → switch_layout('run') only when you need the run/results UI again. Never assume set_property works while still in run layout after a solve.

Inputs: layout (required). Returns: result

switch_viewSwitch viewC

Switch the CAD camera or view plane.

Inputs: view (required). Returns: result

workspace_actionWorkspaceC

Clear workspace variables or the script console.

Inputs: action (required), name, names. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 20 tools

    Disambiguation3/5

    The set covers distinct domains, but several tools are generic action multiplexers (object_action, run_action, project_action, material_action, jobs_action, workspace_action), so their exact boundaries depend on action parameters rather than names. get_info, dataset_query, and get_results also overlap in discovery/query roles, though descriptions help clarify.

    Naming Consistency3/5

    Names are all snake_case, but conventions are mixed: bare add, noun_action multiplexers, verb_noun getters/setters, and noun-only tools like group_membership and file_io. It remains readable, but the pattern is not predictable across the surface.

    Tool Count4/5

    Twenty tools is at the upper end but reasonable for a broad simulation platform spanning projects, objects, properties, solvers, results, materials, jobs, and files. Most tools map to distinct workflow areas, though the generic action tools inflate the surface somewhat.

    Completeness4/5

    The surface covers the main simulation lifecycle: project management, object creation/manipulation, property configuration, solver runs, results extraction, materials, jobs, workspace, and file/data handling. Minor gaps remain around explicit deletion/close operations and some actions hidden behind generic multiplexers.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents and engineering tools to validate and simulate Gaussian beam optical systems, search component catalogs, and create immutable design links for optical design workflows.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Turns CST Studio Suite into an AI-controllable electromagnetic design lab, enabling conversational THz metamaterial absorber design, unit-cell automation, Floquet port control, batch solve with checkpoint-resume, and surrogate-model predictions.
      2
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Enables AI agents to read and write .mph model files, control the COMSOL desktop GUI in real time, and run complete modeling, meshing, solving, and post-processing workflows.
      23
      1
      MIT