Skip to main content

Unofficial integration of fmpy with mcp.

Project description

MCP-FMI

Model Context Protocol - Functional Mock-up Interface
Makes your simulation models available as tools for LLM-based agents.

Novia UAS | Research Project | Contact

Python Version License: MIT Funded by Business Finland

MCP - Functional Mockup Interface

This package integrates FMU simulation models as tools for LLM-based agents through the MCP. This is an unofficial MCP-integration of the FMPy package.

The Model Context Protocol (MCP) is an open protocol that standardizes how applications can provide context to Large Language Models (LLMs). MCP helps when integrating data and tools to LLM-based agents.

The Functional Mockup Interface (FMI) is a free standard that defines a container and interface to exchange dynamic simulation models across simulation platforms. A Functional Mockup Unit (FMU) is a file containing a simulation model that adheres to the FMI standard.

MCP-FMI Features

  • Manage simulations from chat interfaces.
  • Use simulation models as tools for LLM-based agents.
  • Generate input signals for simulations from natural language.
  • Visualize simulation results in browser.

Implemented tools

List of implemented tools:

  • fmu_information_tool retrieves information about the available FMU models.
  • simulate_toolsimulates a single FMU model with default prameters and input signals. Returns the simulated outputs.
  • simulate_with_input_tool simulates a single FMU model with the specified input signals. Returns the simulated outputs.
  • create_signal_tool generates an input-sequence object for a single input.
  • merge_signals_tool merges multiple signel objects that can be used as an input for a simulation.
  • show_results_in_browser_tool visualizes simulation results in browser.

Prerequisites

  • Python 3.11 or higher
  • uv package manager
  • Claude Desktop (for desktop integration)

Installation

  1. Create and activate a virtual environment:
# Create venv with uv
uv venv

# Activate on macOS/Linux
source .venv/bin/activate

# Activate on Windows
.venv\Scripts\activate
  1. Install dependencies:
# Make sure you're in the project root directory
uv pip install -e .

Run the MCP-FMI server

Run the server and the MCP Inspector:

uv run --with mcp --with mcp-fmi --with python-dotenv --with fmpy --with numpy --with pydantic mcp dev src/mcp_fmi/server.py

Claude Desktop Integration

Update the claude_desktop_config.json file with:

{
  "mcpServers": {
    "MCP-FMI Server": {
      "command": "uvx",
      "args": [
        "mcp-fmi",
        "--fmu-dir",
        "/full/path/to/fmu/folder"
        ],
    }
  }
}

Example usage

Example queries:

  • What simulation models do you have available?
  • Give me informaiton of input and output signals of model model name.
  • Who created the model model name and when was it last updated?
  • Make a step-change in input input name at 60s. Keep the other inputs constant with default values.
  • Simulate model name with generated inputs.

Future work

List of tools to be implemented:

  • show_results_as_artifact_tool visualized simulation results as interractive artifacts in Claude Desktop.
  • co_simulate_tool co-simulates multiple FMU models.

Citation

If you use this package in your research, please cite it using the following BibTeX entry:

@misc{MCP-FMI,
  author = {Mikael Manngård, Christoffer Björkskog},
  title = {MCP-FMI: MCP Server for the Functional Mock-Up Interface},
  year = {2025},
  howpublished = {\url{https://github.com/Novia-RDI-Seafaring/mcp-fmu}},
}

Acknowledgements

This work was done in the Business Finland funded project Virtual Sea Trial

License

This package is licensed under the MIT License license. See the LICENSE file for more details.

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

mcp_fmi-0.1.6.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

mcp_fmi-0.1.6-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_fmi-0.1.6.tar.gz.

File metadata

  • Download URL: mcp_fmi-0.1.6.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mcp_fmi-0.1.6.tar.gz
Algorithm Hash digest
SHA256 264b289dad2f7a072f7c27c947d231ae735deb3fb9a7745baab9cfaab8edbe2d
MD5 161a918b974852d5938c86392dc6462d
BLAKE2b-256 c0f9a34ed919af8fac9e75b9331f3bfd6786b068517d9101ee1658949b069521

See more details on using hashes here.

File details

Details for the file mcp_fmi-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: mcp_fmi-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mcp_fmi-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8a32c58f226c6c47d6700894a75b15459100b8f9715c38eed142d46e031627e5
MD5 e310839141db88bc952284768e1e0b8d
BLAKE2b-256 a1fdc166c4c2b422f225fa353505856a6d136bb9da500eeeb49bfdaee975bfd7

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