runbot-mcp
Officialby runbot-io
README.md
# runbot-mcp — the official Runbot MCP server
`runbot-mcp` lets an AI assistant (Claude Code, Codex, or any
[MCP](https://modelcontextprotocol.io) client) research trading strategies on
Runbot's servers:
- **check** a strategy file against the engine's rules;
- **backtest** it over a past period, or test a change without saving anything (what-if);
- **optimise** its parameters (up to five variants to compare; nothing is applied);
- **ask the strategy expert**, an AI that explains, reviews or drafts strategies.
Your assistant writes or edits the strategy itself, from the schema and catalogue
the free `tour` returns.
**No account. No sign-up. No token.** Each paid call is paid on the spot in
**USDC on Base** with the open [x402](https://x402.org) payment protocol, from a
wallet on your own machine. Your strategies, your results and your payment
receipts stay on **your** computer.
## What Runbot does, and what it does not do
Please read this before you start.
- **Runbot does not take or execute trading orders.** The research service has no
order path: it cannot deploy a bot, place a trade or touch an exchange account.
- **Runbot holds no custody of funds.** Runbot never holds, receives or moves your
trading funds. The only money Runbot receives is the price of a research call you
chose to pay, settled on-chain after the call succeeded.
- **Runbot gives no investment advice.** Backtests and optimisations describe how a
set of rules would have behaved on past data. Past results do not predict future
results. The strategy expert works on strategy rules and historical results: it
does not tell you what to buy or sell, and it does not watch markets for you.
- **Live trading is offered by partners, depending on your jurisdiction.** If you
want to run a strategy with real funds, Runbot points you to an independent
partner offering live execution where you live. The partner is a separate company
with its own terms, its own account and its own legal responsibilities. Runbot is
not a party to that relationship.
- **Coming soon: a self-hosted version.** A version of Runbot you run on your own
infrastructure, built to fit your jurisdiction's rules, is in preparation.
What the research service stores about you: **nothing that identifies you** — no
account, no wallet address, no IP address, no email. A research job is kept for 24
hours so your assistant can fetch its result, then deleted. The blockchain is the
record of payments.
## Install
You need Python 3.10 or later and an MCP client. Run it without installing, with
[uv](https://docs.astral.sh/uv/):
```bash
uvx --from git+https://github.com/runbot-io/runbot-mcp runbot-mcp
```
or install it once with [pipx](https://pipx.pypa.io):
```bash
pipx install git+https://github.com/runbot-io/runbot-mcp
```
The x402 signer and the OS-keychain support are part of the default install.
`constraints.txt` pins the exact stack the test suite runs on
(`pip install -c constraints.txt .` from a clone).
## Register it with your assistant
Claude Code:
```bash
claude mcp add runbot -e RUNBOT_RESEARCH_URL=https://mcp.runbot.io \
-- uvx --from git+https://github.com/runbot-io/runbot-mcp runbot-mcp
```
Codex:
```bash
codex mcp add runbot --env RUNBOT_RESEARCH_URL=https://mcp.runbot.io \
-- uvx --from git+https://github.com/runbot-io/runbot-mcp runbot-mcp
```
With pipx, replace everything after `--` by `runbot-mcp`. Configuration is by
environment only: no tool argument and no server answer can change it.
## First run: choosing how to pay
The first time, your assistant calls the free `quanta_start` tool. It shows you
the service's price list and asks how you want to pay. It never chooses for you.
**Option 1 — pay per call with x402 (no account).**
1. Create a wallet key for the plugin, kept in your operating system's keychain:
```bash
runbot-mcp-wallet set-key --generate # or: set-key (hidden prompt) to import one
runbot-mcp-wallet address --full
```
(Through uvx: `uvx --from git+https://github.com/runbot-io/runbot-mcp runbot-mcp-wallet …`.)
Use a wallet dedicated to this, holding only what you intend to spend.
2. Send USDC on Base to that address. Fixed-price calls need no ETH: the payment is
a signed USDC authorisation.
3. Optionally set your own spending limits (below).
Your key never leaves your machine. Only a signed payment authorisation for one call
is sent, and **it is settled only if the job succeeds**. A failed job costs nothing.
**Option 2 — you do not want to use x402.** You can use prepaid credits through an
account with a Runbot partner instead. If the plugin is configured with
`RUNBOT_PARTNER_DOC_URL`, `quanta_start` points to that partner's own guide;
otherwise it only says partner credits exist, and never invents a link.
Never paste a private key, a seed phrase or an access token into a chat with your
assistant.
## Settings
Set them in the registration (`-e NAME=value` for Claude Code, `--env NAME=value`
for Codex). **There is no spending limit by default**; any limit you set is
enforced on your machine, and a call above it is refused with nothing signed.
| Setting | Default | Meaning |
|---|---|---|
| `RUNBOT_RESEARCH_URL` | — | the research service (`https://`); set alone, the plugin runs research-only |
| `RUNBOT_PARTNER_DOC_URL` | — | a partner's guide for paying with credits instead of x402 |
| `RUNBOT_WALLET_LIMIT_PER_CALL_USD` | no limit | the most one payment may be |
| `RUNBOT_WALLET_LIMIT_PER_SESSION_USD` | no limit | per plugin process |
| `RUNBOT_WALLET_LIMIT_PER_DAY_USD` | no limit | the last 24 h, rolling, across sessions |
| `RUNBOT_WALLET_MAX_VALIDITY_S` | the service's `maxTimeoutSeconds` | the longest an authorisation may stay valid |
| `RUNBOT_WALLET_TESTNET_ONLY` | `false` | `true` refuses Base mainnet (real USDC) |
| `RUNBOT_WALLET_KEY_FILE` | — (OS keychain) | an explicit key file (mode 600) on a machine with no keychain |
| `RUNBOT_WALLET_RECEIPTS_DIR` | `~/.local/share/runbot-mcp/receipts` | where receipts are written |
| `RUNBOT_WALLET_RPC_URL` | — | optional Base RPC: lets an `upto` payment carry a gas-sponsored USDC permit |
The plugin pays on the network the service's payment request names: **Base
mainnet** for the production service, **Base Sepolia** (test USDC) for a test one.
Only USDC is ever paid, and only on those two networks. Boolean settings take
exactly `true` or `false`.
For an `upto` call (priced "up to" a ceiling, such as the expert) the limits are
checked against the ceiling and the plugin signs exactly that ceiling, never more;
you pay the actual cost, up to it.
**Renamed from `quanta-mcp`.** Each `RUNBOT_*` setting also accepts its former
`QUANTA_*` name (`RUNBOT_` wins when both are set), a key stored by `quanta-mcp` in
the keychain is still read, and an existing `quanta-mcp` receipts directory is kept
in use.
The key goes to the **OS keychain** (macOS Keychain, Windows Credential Locker,
Secret Service on a Linux desktop). There is no silent fallback to a file, and
keyring's `fail` and plaintext backends are refused: on a machine without a
keychain, set `RUNBOT_WALLET_KEY_FILE` yourself.
## Tools
**Free, no wallet needed:** `quanta_start` (what the service does, its price list,
your payment choice), `quanta_tour` (markets, indicator catalogue, strategy schema),
and through `quanta_research_call`: `strategy.validate`, `markets.read`.
**Paid per call:** through `quanta_research_call(skill_id, input)` —
`backtest.run`, `backtest.what_if`, `optimize.run`, `expert.ask`. Prices come from
the service (`quanta_start`), never from this page.
Around them: `quanta_research_job(job_id)` (a job's state, result and, once settled,
its transaction), `quanta_research_pay(job_id)` (pay again for a withheld result),
`quanta_wallet_status()` (your settings and what was spent; never the key).
**How a paid call goes.** The first call answers *402* with the exact price, how
long it is valid and the expected duration. The plugin checks your settings, signs
once, and sends the call again. When the job succeeds the payment is settled and the
result released. If the service is busy it says so **before** you sign anything.
## Receipts and your files
- Each payment writes one **receipt file** (job, tool, amount, transaction, time,
state). `runbot-mcp-wallet receipts` lists them; `runbot-mcp-wallet status` shows
your settings and what you spent.
- Results stay on the service for **24 hours** only. Ask your assistant to save each
strategy file and each result in your project folder.
- To check a payment, look up its transaction on a Base block explorer.
## Optional: partner account mode
If you have an account with a Runbot partner that offers agent access, the partner's
app can issue a grant token for this plugin (the `mcp` door). Save it in a file only
you can read (`chmod 600`), then add:
| Setting | Meaning |
|---|---|
| `RUNBOT_A2A_URL` | the partner app's base URL (`https://`) |
| `RUNBOT_A2A_TOKEN_FILE` | the path of the token file (never the token itself) |
The plugin then also has the account tools (`quanta_portfolio`, `quanta_converse`,
`quanta_backtest`, `quanta_optimize`, `quanta_bots`, …), paid with the account's
credits, under the partner's own terms, policy and approvals. Both modes can be set
together; half an account (one of the two settings) is refused at start. Follow the
partner's own guide for the account, its funding and any live trading.
## Develop
```bash
git clone https://github.com/runbot-io/runbot-mcp && cd runbot-mcp
python3 -m venv .venv && .venv/bin/pip install -c constraints.txt -e '.[test]'
.venv/bin/python -m pytest
```
The suite runs on both MCP SDK majors (`mcp` 1.x and 2.x). See
[CONTRIBUTING.md](CONTRIBUTING.md).
## License
Apache License 2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE). The license does
not grant permission to use the Runbot name or logo.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues