MCP Server

Bring your own AI to Runbook's engine.

Runbook exposes a Model Context Protocol server, so Claude, ChatGPT or any MCP client can write trading strategies, backtest them against real historical data, and forward-test them on paper — using your Runbook account and your market data.

Strategies are JavaScript and run on Runbook's infrastructure, not inside the chat. The assistant writes and measures; the engine executes.

What it cannot do

No tool on this server can trade real money.

  • Place, modify or cancel an order on a real broker account.
  • Start live trading. deploy_strategy starts a paper run and takes no mode parameter — there is no argument that makes it live.
  • Stop live trading. stop_strategy refuses anything that is not a paper run.
  • Move, deposit or withdraw money, or transfer any asset.
  • Change your plan, your billing, or your broker credentials.

Live deployment happens in the Runbook dashboard, by you, deliberately. An assistant that has designed something it likes hands you a link and tells you what to check first.

Connect

One endpoint, two ways to authenticate.

Claude, Claude Desktop, ChatGPT

Add a custom connector pointing at the URL below and sign in when prompted. There is nothing to register beforehand.

https://api.runbook.trade/mcp

Claude Code, Cursor, other local clients

Use a Runbook API key. Keys are shown once at creation — only a hash is stored, so a lost key has to be replaced rather than recovered.

claude mcp add --transport http runbook https://api.runbook.trade/mcp \
  --header "Authorization: Bearer rb_mcp_..."

Any Runbook account can connect. You do not need a broker connected to start — backtests fall back to Runbook's shared market data until you attach your own.

Tools

Fifteen that read, three that write.

Which ones you are offered depends on your plan and connected brokers, and the set is fixed when the client connects — so a plan change or a new broker needs a reconnect to show up.

Read and simulate

  • get_contractThe JavaScript strategy API: globals, required functions, hooks, order rules.
  • validate_scriptCompile a script and check it against the contract. Does not execute it.
  • run_evalRun a short compute() over real bars. The cheap check before a full backtest.
  • run_backtestReplay a strategy against real historical data. Returns metrics plus advisories.
  • search_symbolsResolve an instrument to the exact symbol the engine expects.
  • get_market_dataHistorical OHLCV bars, up to 365 days.
  • profile_sessionsPer-hour volatility, liquidity and trend efficiency, in exchange-local time.
  • get_market_regimeThe weekly regime read. Pro and Expert plans.
  • list_strategiesYour saved strategies, and whether each is running.
  • get_strategyOne strategy in full: script, config, symbols, risk limits, broker.
  • get_backtest_historyPreviously saved backtests, to compare runs.
  • search_strategy_logsConsole output from a saved backtest or a run.
  • get_live_performanceReal fills and realised P&L for a strategy that is running or has run.
  • get_run_stateWhether a strategy is running, plus its positions and working orders.
  • get_account_overviewYour plan, capital limits, connected brokers and prop-account context.

Write

  • save_strategySave a strategyCreates or updates a saved strategy in your Runbook account. Refuses to edit one that is running.
  • deploy_strategyStart a paper runStarts a paper run: live market data, simulated fills, no money at risk. This is the only kind of run it can start.
  • stop_strategyStop a paper runStops a paper run. Refuses a live run and refuses an assisted session.

Limits

  • A backtest is capped at four minutes of replay. Narrow the window or the symbol set if you hit it.
  • Console output returned with a backtest is capped, and says so when it has been trimmed.
  • One backtest at a time per account, so a retry loop cannot starve live strategies sharing the process.
  • get_market_regime needs a Pro or Expert plan.

Data and privacy

A connected client can read the strategies, backtests, logs, fills and account context belonging to the Runbook account that authorised it, and nothing belonging to anyone else. Scripts you send are compiled and replayed on Runbook's engine. Your broker credentials are never returned to a client — strategies reference a broker, they never carry its keys.

Revoke access at any time: delete the API key, or disconnect the connector. A revoked credential stops working on the next request.

Privacy policy · Terms of service

Support

Something not working, or not documented?

brandon@runbook.trade · Discord

Analytics and session replay help us improve Runbook. Review our Privacy Policy.