home / mcp / stella mcp server
Provides an MCP server to create, read, validate, and save Stella XMILE models via simple tools.
Configuration
View docs{
"mcpServers": {
"bradleylab-stella-mcp": {
"command": "stella-mcp",
"args": []
}
}
}You run Stella MCP Server to programmatically create, read, validate, modify, and save Stella XMILE models. This enables AI assistants and automation to build complex system dynamics models from scratch or adapt existing ones with confidence, then export ready-to-use XMILE files for Stella Professional or Stella Architect.
You connect a client to the Stella MCP Server and issue high-level modeling commands through the MCP interface. Use the available tools to create a new model, add stocks, flows, and auxiliaries, connect variables, validate the model, read existing models from .stmx files, and save your work as XMILE-compatible files.
Prerequisites: Python 3.10+ and a working Python environment.
Install the MCP server package from PyPI or install from source to run locally.
pip install stella-mcp
```
```
git clone https://github.com/bradleylab/stella-mcp.git
cd stella-mcp
pip install -e .Configuration examples show how to wire the MCP server into your Claude client. You can configure a local stdio-based MCP server using the CLI entry point stella-mcp or launch via Python in development mode with python -m stella_mcp.server.
Development mode command example (stdio):
```
{
"mcpServers": {
"stella_mcp": {
"command": "python",
"args": ["-m", "stella_mcp.server"],
"cwd": "/path/to/stella-mcp"
}
}
}
```
You would adjust the working directory to where you cloned the project.Create a new model with a name and time settings (start, stop, dt, method)
Load an existing .stmx file
Save the current model to a .stmx file
Add a stock (reservoir) with an initial value and units
Add a flow between stocks with an equation
Add an auxiliary variable (parameter or calculation)
Add a dependency connector between variables
List all stocks, flows, and auxiliaries
Check for errors such as undefined variables, missing connections, and mass-balance issues
Preview the XMILE XML output