Monte Carlo decision-intelligence over MCP: simulate, optimize, and decide under uncertainty.
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.
A domain-agnostic Monte Carlo simulation and decision intelligence system.
Zero dependencies. Pure Python stdlib. Local web UI. Runs anywhere Python runs.
SimEngine turns uncertainty into numbers you can act on. Define your variables, your logic, and your risk tolerances in a JSON config. The engine runs thousands of simulated futures, scores them, and β if you ask β evolves toward the best strategy that still respects your safety constraints.
Think of it as a calculator for uncertainty.
That is it. No pip install, no Docker, no Node, no build step. Python 3.8+ is the only requirement.
Listed on the official MCP registry. Hosted, no-install endpoint: join the waitlist.
The default engine remains pure Python. A Rust workspace now lives at the repo root for optional acceleration of metric reducers, trajectory bands, risk evaluation, histograms, and native pre-sampling of simple numeric variable distributions.
This is opt-in and does not change the baseline workflow above.
After that, the existing Python engine will automatically use the native
reducers and the native batch sampler when simengine_native is importable.
If the module is missing or fails, SimEngine falls back to the existing
Python implementation.
The batch sampler is conservative:
SIMENGINE_DISABLE_NATIVE_SAMPLING=1This keeps the expression engine, accumulators, and metrics in Python while moving a larger chunk of the Monte Carlo loop into Rust.
There is also a narrower native fast path for stochastic expressions:
binomial(n, p) can be delegated to Rust when the extension is installedSIMENGINE_DISABLE_NATIVE_EXPR_SAMPLING=1This helps domains whose step_logic relies heavily on binomial(...) while
still leaving general expression evaluation in Python.
On the Python side, repeated expressions are now compiled once and reused
across Monte Carlo runs. That cache can be disabled explicitly with
SIMENGINE_DISABLE_EXPR_CACHE=1 for benchmarking or troubleshooting.
The diagnostics module applies the same idea to its AST-only safe evaluator:
parsed trees are reused across calls, and that cache can be disabled with
SIMENGINE_DISABLE_SAFE_EXPR_CACHE=1.
/api/simulate and get structured results back. No files needed. LLMs can use SimEngine as a tool (llms.txt at the repo root and GET /llms.txt orient them).cd v3 && python3 backtest.py (offline, from committed snapshots). Results: docs/backtests/.All production code lives in v3/.
A domain config is a single JSON file that fully describes the simulation. The v3 schema separates variables into three semantic categories, which matters for Bayesian updating and optimization.
Published contract: the machine-readable JSON Schema (Draft 2020-12) is served live at GET /api/schema β hand it to any AI to author a valid config in one shot. A plain-language field reference is in docs/schema-reference.md. The schema is verified against every shipped domain in the test suite.
| Field | Type | Description |
|---|---|---|
name | string | Human-readable domain name |
description | string | What this simulation models |
n_simulations | int | Number of Monte Carlo runs (default: 5000) |
n_steps | int | Time steps per simulation (e.g., 12 months) |
step_label | string | Label for time axis: "month", "week", "sprint" |
seed | int or null | Random seed for reproducibility |
parameters | object | Uncertain variables, updatable with evidence |
controls | object | Operator decisions (pricing, budget, effort) |
exogenous | object | External factors outside your control |
initial_state | object | Starting values for accumulators |
step_logic | array | Computations executed each time step |
accumulators | object | Running totals updated each step |
metrics | object | Final output measurements |
safety | object | Chance constraints and CVaR constraints |
fitness | object | Weighted scoring components for the optimizer |
tunable | array | Parameters the optimizer is allowed to adjust |
context | object | Optional metadata: decision question, key levers |
calibration | object | Per-variable data source and update method |
All three variable categories (parameters, controls, exogenous) share the same structure:
| Distribution | Params | Use Case |
|---|---|---|
fixed | value | Known constants |
uniform | low, high | Equal probability across a range |
triangular | low, mode, high | Expert estimates (pessimistic / likely / optimistic) |
normal | mean, std, min?, max? | Bell curve, optionally clamped |
lognormal | median, spread, min?, max? | Always positive, right-skewed (prices, durations) |
bernoulli | p | Binary yes/no events |
poisson | lambda | Counts of rare events |
student_t | mean, scale, df, min?, max? | Fat-tailed returns (use df=5 for equities) |
correlated_normal | mean, std | Normal with correlation support (via step_logic) |
An ordered list of computations executed each time step. Each entry has a target name and either an expr (expression string) or a sample (inline distribution):
Available expression functions: min, max, abs, round, sum, len, int, float, sqrt, log, exp, ceil, floor, pow, random(), gauss(mu, sigma), binomial(n, p), clamp(val, lo, hi), range(). Ternary expressions work: 100 if x > 0 else 0.
Running state that persists across time steps:
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/simengine)<a href="https://allmcps.com/mcp/simengine"><img src="https://allmcps.com/api/badge/simengine?style=directory" alt="Simengine on AllMCPs" /></a>