# Run backtests from Claude, Cursor or any MCP client

> Let Claude, Cursor or another MCP client run crypto backtests on Binance history itself: a free API key, one config entry, 27 tools for strategies and runs.

Guide · Janorium · Published 2026-11-16  
Web page: https://janorium.com/guides/crypto-backtesting-mcp-server

Connect an AI assistant to Janorium and it stops guessing numbers: it writes the strategy config, checks it, runs it on Binance spot or futures history and reads the result itself. The connector is janorium-mcp, a free open-source MCP server; it needs a Janorium account and an API key.

## How it works

MCP (Model Context Protocol) is how AI assistants call outside tools. janorium-mcp is a small program that runs on your computer next to the assistant and gives it 27 tools over the Janorium API, under your API key: validate a config, run a quick trial, save a strategy, launch backtests, read trades and metrics, run the optimizer and research scans. Saved runs land in your account on janorium.com like any other backtest.

Janorium only backtests. Nothing in the server or the platform places orders or connects to an exchange account, and the platform is free. [How Janorium backtests](https://janorium.com/guides/how-janorium-backtests) explains how every number the assistant reads is computed.

## Before you start

1. **An account.** [Create one](https://janorium.com/register) if you do not have it — it is free.
2. **Node.js 20.9 or newer.** The assistant starts the server with `npx`, which comes with Node.js. `node --version` in a terminal shows what you have.
3. **An API key.** Open [Settings](https://janorium.com/settings) → API keys → Create key. `read` and `run` cover strategies and backtests; add `optimize` for the optimizer and `research` for research scans. Add `publish` only if the assistant may make a strategy public. The full key is shown once — copy it then.

## Claude Desktop

In Claude Desktop open Settings → Developer → Edit Config. That opens `claude_desktop_config.json`. Add the server under `mcpServers`, with your key in place of `cbk_your_key_here`:

```json
{
  "mcpServers": {
    "janorium": {
      "command": "npx",
      "args": ["-y", "janorium-mcp"],
      "env": { "CB_API_KEY": "cbk_your_key_here" }
    }
  }
}
```

Save the file, quit Claude Desktop completely and start it again. If the file already has other servers, add the `janorium` entry next to them rather than replacing the whole file.

> **Windows: npx not found**
>
> If Claude Desktop on Windows cannot start the server, run npx through cmd:

```json
{
  "mcpServers": {
    "janorium": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "janorium-mcp"],
      "env": { "CB_API_KEY": "cbk_your_key_here" }
    }
  }
}
```

## Claude Code

One command in a terminal adds the server for all your projects:

```bash
claude mcp add --env CB_API_KEY=cbk_your_key_here --transport stdio --scope user janorium -- npx -y janorium-mcp
```

Keep the order: options first, then the name `janorium`, then `--` and the command. `--env` must not come right before the name — Claude Code would read the name as another variable. `/mcp` inside Claude Code shows whether the server connected.

## Cursor

Put the same entry in `~/.cursor/mcp.json` to use it in every project, or in `.cursor/mcp.json` in one project:

```json
{
  "mcpServers": {
    "janorium": {
      "command": "npx",
      "args": ["-y", "janorium-mcp"],
      "env": { "CB_API_KEY": "cbk_your_key_here" }
    }
  }
}
```

## Other MCP clients

Any client that starts local (stdio) MCP servers works the same way: the command is `npx -y janorium-mcp` and the one required variable is `CB_API_KEY`. The server is also listed in the official MCP Registry as `com.janorium/mcp`.

ChatGPT adds MCP servers by their web address, so it cannot start one on your computer. In ChatGPT, use the other route: [the assistant writes the config and you paste it into Janorium](https://janorium.com/guides/build-a-strategy-with-ai).

## What to ask

Ask in plain words, as you would ask a person who has the platform open:

- “Backtest buying BTCUSDT when the daily RSI(14) drops below 30 and selling above 70, from 2021 to 2024, with fees. Show the drawdown.”
- “Which futures symbols have data since 2020?”
- “Take my strategy #12 and run it on ETH and SOL as well. Is the result the same?”
- “Why did my strategy make no trades in 2022?”

The assistant reads what the tools return — the engine’s numbers, not its own estimates. Judge them like any backtest: on more than one coin and period, with suspicion of anything that looks too good. [What backtesting is and how it misleads](https://janorium.com/guides/what-is-backtesting) covers the traps.

## One-off questions and searches

A one-off question — run this strategy over that period — runs at once. A search is different: when the assistant tries variant after variant and keeps the best, that best was picked on the same data it was measured on, and its numbers are optimistic.

So once the assistant has run five different configs without a campaign, the server adds a warning to its answers, and the assistant should tell you so. A campaign is the honest way to search: it sets the most recent part of the history aside before the search starts and tests the chosen variant on it once, at the end. Ask the assistant to “start a campaign” before you go looking for the best parameters.

To make campaigns compulsory — every run refused outside one — add `"MCP_REQUIRE_CAMPAIGN": "true"` to the `env` of the server entry.

## What the assistant can do

| Group | Tools | What for |
| --- | --- | --- |
| Strategies | `strategy_validate`, `strategy_dry_run`, `strategy_save`, `strategy_get`, `strategy_versions`, `strategy_set_visibility` | Check a config, run a quick trial without saving, save and read strategies and their versions |
| Backtests | `backtest_run`, `backtest_get`, `backtest_trades`, `backtest_signals`, `backtest_compare`, `backtest_near_miss`, `backtest_monte_carlo`, `backtest_risk_scaling` | Saved runs, their metrics and trades, why a signal did not fire, comparison, Monte Carlo, position size for a target drawdown |
| Optimizer | `optimization_create`, `optimization_get`, `optimization_promote` | Search parameters and check the chosen variant on data it was not fitted on |
| Research | `research_scan`, `research_job_create`, `research_job_get`, `research_draft` | Test a hypothesis across coins |
| Market data | `market_symbols`, `market_coverage` | Which symbols and timeframes have history, and since when |
| Campaigns | `campaign_start`, `campaign_status`, `campaign_finalize` | Search with a held-out period |
| Waiting | `wait` | Wait for a long run to finish |

## Keep the key safe

- **The key acts as you** within its scopes. Use a separate key for each assistant, with only the scopes it needs, and never paste it into a chat.
- **What a key cannot do:** manage API keys, change your account, delete strategies or reach anything to do with exchanges.
- **Lost it?** Revoke it in [Settings](https://janorium.com/settings) → API keys; it stops working at once. Changing your password revokes all keys.
- **The server runs on your computer** with your user’s rights, like any program you install. Version updates arrive through npm; to update by hand instead, pin one: `janorium-mcp@0.1.0`.
- **Text from other users** — the names and descriptions of their public strategies — reaches the assistant marked as untrusted, so it is read as data, not as instructions.

## Questions

### Is there an MCP server for crypto backtesting?

Yes. janorium-mcp connects Claude, Cursor and other MCP clients to Janorium, a free backtester for Binance spot and USDT-M futures. The assistant writes the strategy config, runs it on history since 2020 and reads the results itself.

### Is the Janorium MCP server free?

Yes. The package is open source under the MIT license and Janorium is free. One API key runs up to 300 backtests a day.

### Can the assistant trade with my money through it?

No. Janorium only backtests: nothing in it places orders or connects to an exchange account, and an API key cannot reach anything to do with exchanges.

### Does it work with ChatGPT?

Not directly: ChatGPT adds MCP servers by their web address, and janorium-mcp runs on your computer. In ChatGPT, ask the assistant to write the config and paste it into Janorium — [this guide](https://janorium.com/guides/build-a-strategy-with-ai) shows how.

## Sources

- [janorium-mcp on npm](https://www.npmjs.com/package/janorium-mcp)
- [Model Context Protocol — connect to local MCP servers (Claude Desktop)](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
- [Claude Code — connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp)
- [Cursor — Model Context Protocol](https://cursor.com/docs/context/mcp)
- [OpenAI — add a custom MCP server to ChatGPT (developer mode)](https://developers.openai.com/api/docs/guides/developer-mode)
