Create, read, validate, modify, and save Stella system dynamics models (.stmx XMILE files) programmatically.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent ā or use 1-click editor setup below.
š” Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Stella MCP.
create_modelCreate a new Stella model with specified time settings
build_modelCreate and populate a model in one call: sim specs, stocks, auxiliaries, flows, connectors, and modules. All-or-nothing ā on any item error nothing is registered and the error names the failing item (stage + index). Connector sync and validation run by default, so the response doubles as an inspection.
add_variablesAdd multiple stocks, auxiliaries, flows, connectors, and/or modules to an existing model in one call. All-or-nothing ā on any item error the model is left unchanged and the error names the failing item (stage + index).
set_sim_specsUpdate simulation time settings on an existing model
add_stockAdd a stock (reservoir) to the current model
update_stockUpdate stock fields while preserving relationships
A vendor-neutral Model Context Protocol (MCP)
server for creating and manipulating Stella
system dynamics models. Any compliant MCP client can build, read, validate, and
save .stmx files in the XMILE format; optional host features still vary.
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:
This is particularly useful for:
mcp>=2.0.0,<3If you have uv installed, the lowest-friction configuration runs the published package directly:
Add to your claude_desktop_config.json:
Add to your .claude/settings.json:
If running from source:
For a new model:
create_workspace and carry the returned
workspace_id through stateful calls. Legacy stdio clients may omit it.build_model with a stable model_id and the full set of stocks,
auxiliaries, and flows in one call (connector sync and validation run by
default, so the response doubles as an inspection).update_*, rename_variable, or delete_variable.add_variables (batch) or the single-add tools.simulate to sanity-check behavior (requires the sim extra).save_model.For imported models:
read_model with compat_mode="permissive" to inspect warnings.inspect_model to understand model structure.compat_mode="strict" before final save when round-trip fidelity matters.| Tool | Description |
|---|---|
create_model | Create a new model with name and time settings (start, stop, dt, method) |
set_sim_specs | Update simulation time settings on an existing model |
read_model | Load an existing .stmx file |
save_model | Save model to a .stmx file |
delete_model | Remove a model from the workspace (saved files untouched) |
| Tool | Description |
|---|---|
list_templates | List built-in and user-defined templates (supports source/query/tag filters) |
get_template_info | Get detailed metadata for one template |
load_template | Load a template as a model in the current workspace |
save_as_template | Save the current model as a reusable user template (optional description/tags) |
| Tool | Description |
|---|---|
build_model | Create and populate a model in one call (atomic batch) |
add_variables | Add multiple variables/connectors/modules to an existing model (atomic batch) |
add_stock | Add a stock (reservoir) with initial value and units |
add_flow | Add a flow between stocks with an equation |
add_aux | Add an auxiliary variable (parameter or calculation) |
update_stock | Update stock fields while preserving relationships |
update_flow | Update flow fields while preserving stock links |
update_aux | Update auxiliary variable fields |
add_connector | Add a dependency connector between variables |
sync_connectors_from_equations | Add missing dependency connectors inferred from equations |
set_connector_routing | Set connector angle and explicit waypoint routing metadata |
rename_variable | Rename a stock/flow/aux and update references in equations/connectors/modules |
delete_variable | Delete a stock/flow/aux with consistency checks and cleanup |
create_module | Create a logical module/group of variables |
add_to_module | Add variables to an existing module/group |
remove_from_module | Remove variables from a module/group |
rename_module | Rename a module/group |
delete_module | Delete a module/group |
set_module_view | Set explicit module box position/size on the diagram |
set_module_style | Set module box style (border/background/font/label side) on the diagram |
auto_place_module_boxes | Auto-place module boxes around their members |
Notes:
create_workspace once and include its returned
workspace_id in stateful calls. Modern tool discovery marks that field as
required on stateful tools. The ID routes application state; it is not an
authorization credential.workspace_id and use one
process-local compatibility workspace; legacy discovery keeps the field
optional.model_id so one workspace can manage multiple models safely.create_model and read_model set the workspace's current model_id and return it.add_flow and add_aux support optional graphical_function payloads (ypts plus exactly one of xscale or xpts).add_stock/add_flow/add_aux reject duplicate variable names across variable types; add_connector requires both variables to exist.set_connector_routing can target a connector by connector_uid or by from_var + to_var.save_model and get_model_xml accept auto_layout (default true) and resolve_layout_violations (default false).save_model, get_model_xml, and render_diagram return the latest layout
viewport, metrics, and warnings in structured content. Their text result names
any non-clean layout warning codes.read_model, save_model, and get_model_xml accept compat_mode:
permissive (default): continue with warningsstrict: fail on compatibility issuesset_module_style updates module view styling and persists those attributes in XMILE view <group .../> elements.save_as_template writes user templates to ~/.stella-mcp/templates by default (override via STELLA_MCP_TEMPLATE_DIR) and stores metadata in a .meta.json sidecar.error.code, error.category, and error.message.structuredContent described by its JSON Schema 2020-12 outputSchema.| Tool | Description |
|---|---|
create_workspace | Create an isolated workspace, optionally with a caller-selected lifetime |
revoke_workspace | Revoke a workspace and discard its in-memory models |
| Tool | Description |
|---|---|
list_models | List available workspace model IDs and indicate the current model |
inspect_model | Return a structured model summary for agent inspection |
list_modules | List modules/groups in the current model |
list_connectors | List connector IDs, endpoints, angles, and routing metadata |
list_variables | List all stocks, flows, and auxiliaries |
validate_model | Check for errors (undefined variables, missing connections, etc.) |
get_model_xml | Preview the XMILE XML output |
render_diagram | Render the model as an SVG stock-and-flow diagram |
simulate | Run the model via PySD and return time series + summaries (sim extra) |
compare_scenarios | Run named what-if override sets against a baseline and report deltas (sim extra) |
sensitivity_analysis | Sweep parameters one-at-a-time and rank their effect on an output metric (sim extra) |
calibrate | Fit constant parameters to an observed time-series (inverse of simulate) (sim extra) |
build_model creates and populates a model in one call. Items apply in the
order stocks ā auxs ā flows ā connectors ā modules; the whole batch is
all-or-nothing, and on failure the error names the failing item
(error.stage + error.index). The same item arrays work on an existing
model via add_variables.
Factual signals from GitHub, npm, and our automated checks ā not a rating.
No reviews yet ā be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/bradleylab-stella-mcp)<a href="https://allmcps.com/mcp/bradleylab-stella-mcp"><img src="https://allmcps.com/api/badge/bradleylab-stella-mcp?style=directory" alt="Stella MCP on AllMCPs" /></a>