Enables the creation, reading, and validation of Stella system dynamics models by programmatically generating and parsing XMILE-compliant XML files.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Stella MCP Servercreate a population model with a 5% growth rate starting at 100 people"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Stella MCP Server
A Model Context Protocol (MCP) server for creating and manipulating Stella system dynamics models. This enables AI assistants like Claude to programmatically build, read, validate, and save .stmx files in the XMILE format.
What is this for?
Stella is a system dynamics modeling tool used for simulating complex systems in fields like ecology, biogeochemistry, economics, and engineering. This MCP server allows AI assistants to:
Create models from scratch - Build stock-and-flow diagrams programmatically
Read existing models - Parse and understand .stmx files
Validate models - Check for errors like undefined variables or missing connections
Modify models - Add stocks, flows, auxiliaries, and connectors
Save models - Export valid XMILE files that open in Stella Professional
This is particularly useful for:
Teaching system dynamics modeling
Rapid prototyping of models through natural language
Batch creation or modification of models
Documenting and explaining existing models
Installation
From PyPI
From source
Requirements
Python 3.10+
mcp>=1.0.0
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
Claude Code
Add to your .claude/settings.json:
Development mode
If running from source:
Available Tools
Model Creation & I/O
Tool | Description |
| Create a new model with name and time settings (start, stop, dt, method) |
| Load an existing .stmx file |
| Save model to a .stmx file |
Model Building
Tool | Description |
| Add a stock (reservoir) with 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 |
Model Inspection
Tool | Description |
| List all stocks, flows, and auxiliaries |
| Check for errors (undefined variables, missing connections, etc.) |
| Preview the XMILE XML output |
Example Usage
Creating a simple population model
Reading and analyzing an existing model
Building a biogeochemical model
Validation
The validate_model tool checks for:
Undefined variables - References to variables that don't exist
Mass balance issues - Stocks without flows, flows referencing non-existent stocks
Missing connections - Equations using variables without connectors (warning)
Orphan flows - Flows not connected to any stock
Circular dependencies - Infinite loops in auxiliary calculations
XMILE Compatibility
Output files use the XMILE standard
Compatible with Stella Professional 1.9+ and Stella Architect
Auto-layout positions elements reasonably; adjust manually in Stella if needed
Variable names with spaces are converted to underscores internally
Project Structure
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT License - see LICENSE for details.
Acknowledgments
Model Context Protocol by Anthropic
ISEE Systems for Stella and the XMILE format