honest-backtest-mcp
v1.0.0
Published
MCP server for the Honest Backtest API — backtest trading strategies and get told why the results may not mean what they appear to mean
Maintainers
Readme
honest-backtest-mcp
MCP server for the Honest Backtest API — backtest trading strategies against real market data, and get told in the same response what the numbers do not support.
Most backtesters will report a Sharpe ratio computed over eight trades as though it meant something, and will happily let you zero out fees and show a 400% return. The numbers are real; the impression they create is not. This server returns the usual metrics plus a warnings list naming the specific reasons a result is weak — and it puts the warnings first, because an agent that skims a tool result and stops early should hit the caveats before the returns.
Install
{
"mcpServers": {
"honest-backtest": {
"command": "npx",
"args": ["-y", "honest-backtest-mcp"],
"env": {
"RAPIDAPI_KEY": "your-key"
}
}
}
}Works with any MCP client — Claude Desktop, Claude Code, Cursor, Cline, Windsurf.
Getting a key
Every endpoint except /health is served through an API marketplace, so a key is required.
Subscribe on RapidAPI, then set RAPIDAPI_KEY. Without it, calls return
forbidden — the server starts and lists its tools normally, so you can inspect the
interface before subscribing.
Configuration
| Variable | Default | Purpose |
|---|---|---|
| RAPIDAPI_KEY | — | Your marketplace subscription key |
| RAPIDAPI_HOST | API host | Override when calling through a different gateway |
| HONEST_BACKTEST_API_URL | production Worker | Point at a different deployment |
| HONEST_BACKTEST_TIMEOUT_MS | 30000 | Request timeout |
Tools
list_strategies
The catalogue with every tunable parameter and its default. Call this before run_backtest
rather than guessing parameter names.
run_backtest
Simulate a strategy against real historical data.
| Parameter | Notes |
|---|---|
| strategy | dca_trend, grid, rotation, buy_hold |
| symbol | e.g. BTCUSDT. Required for every strategy except rotation |
| symbols | 2–10 symbols. Required for rotation |
| interval | 1h, 4h, 1d, 1w. Default 1d |
| capital | Default 10000 |
| candles | 30–720. Default 500. Under 200 triggers SHORT_HISTORY |
| feeRate | Default 0.001 (0.10%). Setting 0 triggers NO_COSTS |
| slippageRate | Default 0.0005. Setting 0 triggers NO_COSTS |
| params | Strategy-specific. Unknown keys are rejected, not ignored |
Bounds are enforced in the tool schema, so an out-of-range value fails before a network call is spent.
How the engine avoids flattering itself
- Every fill pays commission and slippage, in the direction that hurts
- Orders execute at the next candle's open — never the close that triggered the signal
- Long-only, no leverage, cash can never go negative
Warning codes
| Code | Fires when |
|---|---|
| SMALL_SAMPLE | Fewer than 30 closed trades — risk metrics are noise |
| DEEP_DRAWDOWN | Max drawdown over 30%, stated in account terms |
| IMPLAUSIBLE_SHARPE | Sharpe over 3 — usually overfitting, not edge |
| NO_COSTS | Fees and slippage both zeroed; unachievable live |
| SHORT_HISTORY | Fewer than 200 candles — likely a single market regime |
| PAST_PERFORMANCE | Always |
A note on grid
The grid centres on the first candle and never re-centres, so its lifetime result is largely decided by the price on its start date. In testing over 2021–2026, a 5-level 3% grid on ETHUSDT executed zero trades across 5.6 years while ETH rose 563%. On SOLUSDT the same configuration returned +1759%, but that was an accidental buy-and-hold with a 95% drawdown, not grid behaviour. Documented because it is true, not because it helps sell.
Not investment advice
A backtest describes the past under assumptions. It is not a prediction.
Development
npm test # 31 unit tests, no network
npm run test:contract # verifies tool schemas against the live API; needs RAPIDAPI_KEYLicense
MIT
