// guide
Run backtests from Claude, Cursor or any MCP client
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.
6 min read
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 explains how every number the assistant reads is computed.
Before you start
- An account. Create one if you do not have it — it is free.
- Node.js 20.9 or newer. The assistant starts the server with
npx, which comes with Node.js.node --versionin a terminal shows what you have. - An API key. Open Settings → API keys → Create key.
readandruncover strategies and backtests; addoptimizefor the optimizer andresearchfor research scans. Addpublishonly 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:
{
"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.
{
"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:
claude mcp add --env CB_API_KEY=cbk_your_key_here --transport stdio --scope user janorium -- npx -y janorium-mcpKeep 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:
{
"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.
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 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 |
- Strategies
- Tools
strategy_validate,strategy_dry_run,strategy_save,strategy_get,strategy_versions,strategy_set_visibility - What forCheck a config, run a quick trial without saving, save and read strategies and their versions
- Backtests
- Tools
backtest_run,backtest_get,backtest_trades,backtest_signals,backtest_compare,backtest_near_miss,backtest_monte_carlo,backtest_risk_scaling - What forSaved runs, their metrics and trades, why a signal did not fire, comparison, Monte Carlo, position size for a target drawdown
- Optimizer
- Tools
optimization_create,optimization_get,optimization_promote - What forSearch parameters and check the chosen variant on data it was not fitted on
- Research
- Tools
research_scan,research_job_create,research_job_get,research_draft - What forTest a hypothesis across coins
- Market data
- Tools
market_symbols,market_coverage - What forWhich symbols and timeframes have history, and since when
- Campaigns
- Tools
campaign_start,campaign_status,campaign_finalize - What forSearch with a held-out period
- Waiting
- Tools
wait - What forWait 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 → 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 shows how.
Sources
Test your own idea
Create a free account, start from a template or from your own rules, and read your first report.
More guides
- What is backtesting?How a backtest works, which numbers matter and the traps that make results look too good.
- TradingView backtesting vs JanoriumWhat each tool does well, where it falls short, and which one to pick for crypto strategies.
- Build a strategy with ChatGPT or ClaudeDescribe a trading idea in plain words and let an AI assistant write the strategy config.
- How to backtest a crypto strategyStep by step: rules, costs, the run, the report — with a real BTC backtest as the example.
- Backtest metrics explainedSharpe, drawdown, profit factor, win rate and the rest — what they mean and what counts as good.
- Strategy builder glossaryEvery term of the strategy editor — layers, conditions, bar windows, exits, DCA — explained with an example.
- How Janorium backtestsThe methodology: data, when orders fill, stops, fees, funding, liquidation, metrics — and what is not modeled.
- An RSI strategy in 5 minutesThe classic RSI oversold rule, built in the wizard and backtested step by step.
- Add a trend filter to a strategyOne more condition that keeps a strategy out of the wrong market: a 200-period average, added in four steps.
- Why a backtest has 0 tradesThe usual reasons a strategy never enters, where to see them and how to fix each.
- A Bollinger Bands strategyThe Bollinger bounce built in the wizard, tested on Bitcoin — and why it lost at every setting.
- A MACD strategyThe MACD crossover built in the wizard, tested on Bitcoin — and why the candles matter more than the settings.
- A volatility squeeze strategyA squeeze breakout built in the wizard and tested on Bitcoin: small drawdowns, modest returns.
- Buy after red daysA red-streak rule built in the wizard and tested on Bitcoin: it barely moves, and one setting decides the sign.
- A breakout on volumeA breakout that asks for volume, built in the wizard and tested on Bitcoin: fewer trades, smaller drawdown, less return.
- Free crypto backtesting tools comparedTradingView, QuantConnect, Freqtrade, backtrader, 3Commas, Gainium and Janorium side by side, with each one’s real strengths and limits.
- How to read a research reportThe verdict, the confidence column, the cost bar and the caveats — what each number in a scan report is allowed to claim.