Unofficial integration of fmpy with mcp.
Project description
Model Context Protocol - Functional Mockup Interface
Makes your simulation models available as tools for LLM-based agents.
Novia UAS | Research Project | Contact
MCP - Functional Mockup Units
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_toolretrieves 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_toolsimulates a single FMU model with the specified input signals. Returns the simulated outputs.create_signal_toolgenerates an input-sequence object for a single input.merge_signals_toolmerges multiple signel objects that can be used as an input for a simulation.show_results_in_browser_toolvisualizes simulation results in browser.
Prerequisites
- Python 3.11 or higher
- uv package manager
- Claude Desktop (for desktop integration)
Installation
- 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
- 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": "LOCAL_PATCH_TO_UV\\uv.EXE",
"args": [
"run",
"--with", "dash",
"--with", "fmpy",
"--with", "mcp[cli]",
"--with", "pydantic",
"--with", "python-dotenv",
"--with", "numpy",
"mcp",
"run",
"LOCAL_PATH_TO_PROJECT\\mcp-fmi\\src\\mcp_fmi\\server.py"
],
"env": {
"PYTHONPATH": "LOCAL_PATH_TO_PROJECT\\mcp-fmi\\src"
}
}
}
}
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 nameand when was it last updated? - Make a step-change in input
input nameat 60s. Keep the other inputs constant with default values. - Simulate
model namewith generated inputs.
Future work
List of tools to be implemented:
show_results_as_artifact_toolvisualized simulation results as interractive artifacts in Claude Desktop.co_simulate_toolco-simulates multiple FMU models.
Citation
If you use this package in your research, please cite it using the following BibTeX entry:
@misc{MCP-FMU,
author = {Mikael Manngård, Christoffer Björkskog},
title = {MCP-FMU: MCP Server for Functional Mockup Units},
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_fmi-0.0.0.tar.gz.
File metadata
- Download URL: mcp_fmi-0.0.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4e753fd74484c623a3b3c503b5723c90f46a47f34865016ae84c3e799222475
|
|
| MD5 |
6ff45cd80c12edd211630683364bbd2e
|
|
| BLAKE2b-256 |
1484bd5730159b72c08188c53550c6c27eb8f2cdb2295e3ea0b637af784e4257
|
File details
Details for the file mcp_fmi-0.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_fmi-0.0.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93136b55c4b140c4d726bd4f8e9dd9947fa4a9329d6a90f22b6999953518257e
|
|
| MD5 |
c2590fb584257f93fdab34caaf9354bd
|
|
| BLAKE2b-256 |
869c88e9fdd9dfb1edcf3fba29cce84d5d4452b91fd74f6b239a3301aa776bd8
|