Backtest from your AI agent
The Manifold-BT Model Context Protocol server exposes the full Rust backtesting engine to any MCP client, Claude Code, Codex, Cursor, Windsurf, VS Code. Let an LLM author strategies, run backtests, sweep parameters, and generate tearsheets without writing a line of Python.
Author in natural language
no PythonDescribe a strategy idea in plain English. The agent writes it in the Manifold-BT DSL, validates it through the Rust compiler, and hands you a serialized StrategyDef, no imports, no boilerplate.
Research conversationally
sweeps & walk-forwardRun parameter sweeps, 2-D heatmaps, walk-forward optimization, stability and Monte Carlo analysis by asking for them. Results come back ranked by any metric you name.
Tearsheets on demand
HTML reportGenerate a full tearsheet from a backtest in one call. The agent runs the engine, renders a self-contained HTML report, and returns the path, ready to drop into a research note.
Connect your client
The server speaks MCP over stdio by default, so any MCP-compatible client works by pointing it at the manifoldbt-mcp binary on your PATH.
{
"mcpServers": {
"manifoldbt": {
"command": "manifoldbt-mcp"
}
}
}[mcp_servers.manifoldbt]
command = "manifoldbt-mcp"claude mcp add manifoldbt -- manifoldbt-mcpmanifoldbt-mcp --http --host 0.0.0.0 --port 876520 tools, 3 resources, 2 prompts
Every tool accepts JSON-friendly arguments, ISO dates, interval shorthands like "1h", fee presets, so the agent never has to reason about native types.
get_versionEngine version and license tier.
activate_licenseActivate a Pro license for the session.
list_indicatorsEnumerate every indicator with signatures.
list_examplesBrowse bundled example strategies.
get_exampleFetch the source of an example.
list_symbolsList symbols registered in a DataStore.
resolve_symbolResolve a ticker to its SymbolId.
ingest_dataPull bars from Binance / Hyperliquid (Databento / Massive on Pro).
build_strategyCompile a DSL snippet into a validated StrategyDef.
validate_strategyValidate StrategyDef JSON through the Rust compiler.
run_backtestSingle backtest, metrics + summary.
run_batchMany strategies in parallel on a shared data load.
run_sweepCartesian parameter sweep, ranked.
run_sweep_2d2-D parameter heatmap.
run_walk_forwardWalk-forward optimization (Pro).
run_stabilityParameter stability analysis.
run_monte_carloTrade-permutation Monte Carlo.
run_stochasticSDE path simulation (GBM, Heston, Merton...).
run_portfolioMulti-strategy portfolio with risk rules.
plot_tearsheetRender a full tearsheet as a self-contained HTML report.
Strategies are just DSL snippets
The agent writes strategies in a namespace that pre-imports every Manifold-BT symbol, no import statements, no pandas. It assigns a single strategy variable, and the server validates it through the Rust compiler before anything runs.
Prefer to drive it yourself? Send an already-serialized StrategyDef JSON to any tool instead.
fast = ema(close, 12)
slow = ema(close, 26)
strategy = (
Strategy.create("ema_cross")
.signal("fast", fast)
.signal("slow", slow)
.size(when(fast > slow, lit(0.5), lit(0.0)))
.stop_loss(pct=3.0)
)A typical agent session
list_indicatorsDiscover the available indicators.
write_strategy promptDraft a strategy from a natural-language idea.
build_strategyValidate it into a StrategyDef with declared parameters.
run_backtestGet metrics and a printable summary.
run_sweepRank variants by Sharpe to find the best one.
plot_tearsheetSave an HTML tearsheet report to disk.
analyze_result promptTurn the metrics into a research note.
Runs on your machine
The server runs locally with the permissions of the launching process. There is no inbound network unless you explicitly enable the HTTP transport. Your data, your keys, and your strategies never leave your machine.
Strategy snippets execute in-process through the Python interpreter. Run the server with clients you trust, or isolate it in a dedicated virtual environment or container. When exposing the HTTP transport, keep it behind your own authentication.
Point an agent at the engine
Install the server, register it with your MCP client, and start backtesting in plain English.