Litmus
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LitmusAudit this strategy for lookahead bias"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π§ͺ Litmus
An MCP server that lets an AI agent backtest, risk-check, and audit trading strategies β the litmus test for whether your edge is real.
Point Claude (or Cursor, or any MCP client) at Litmus and ask: "Is this Freqtrade strategy overfit, or does it actually work?" β and get a real answer, backed by a backtest, a walk-forward analysis, and a static audit of the code. The model does the talking; Litmus does the maths.

Why
Most trading tools help you build strategies. Litmus exists to tell you the truth about them. A backtest is easy to fake without realising it β a stop-loss that never triggers, a feature that peeks at the next candle, a "high-frequency" idea that a polling framework can't actually run. Litmus catches those before they cost you money, and it does it from inside the AI agent you're already chatting with.
It's built on FastMCP, the standard framework for MCP servers. The server is free and open source; you only ever pay for your own model usage, because the inference runs in your client, not here.
Related MCP server: backtester-mcp
Tools
Tool | What it does |
| Pull historical candles from any exchange via ccxt. Returns a |
| Backtest a built-in strategy net of fees and slippage. Returns net return vs buy & hold, Sharpe, drawdown, win rate, profit factor, expectancy. |
| Optimise in-sample, measure out-of-sample, fold by fold. A big gap = overfit, not profitable. Returns a plain-language verdict. |
| Sharpe, Sortino, volatility, max drawdown, Calmar, VaR & CVaR (95% / 99%) from an equity curve or returns. |
| Project the range of futures a strategy implies (Box-Muller), with probability of loss and projected drawdowns. |
| The differentiator. Statically audits Freqtrade-style code for lookahead bias, cosmetic stop-losses, impossible timeframes, missing |
Install
Requires Python 3.10+. Using uv (recommended):
git clone https://github.com/Spectrexf/litmus-mcp.git
cd litmus-mcp
uv venv && uv pip install -r requirements.txtOr with pip:
pip install -r requirements.txtTry it with no LLM
The MCP Inspector calls your tools directly, so you can test everything before wiring up a model:
fastmcp dev server.pyConnect to Claude Desktop
fastmcp install server.pyThat patches your Claude Desktop config automatically. To do it by hand instead, add this to claude_desktop_config.json:
{
"mcpServers": {
"litmus": {
"command": "python",
"args": ["/absolute/path/to/litmus-mcp/server.py"]
}
}
}Restart Claude Desktop and Litmus's tools appear.
Example prompts
Once connected, just talk to your agent:
"Audit this strategy for me" β paste a Freqtrade strategy, Litmus runs
audit_strategyand returns a PASS/WARN/FAIL verdict with line numbers."Backtest a 20/50 moving-average cross on BTC/USDT daily and tell me if it beats buy and hold after costs."
"Is this strategy overfit?" β Litmus runs
walk_forwardand reports in-sample vs out-of-sample."Run a Monte Carlo on these returns β what's my probability of a losing year?"
See the audit catch real flaws
examples/flawed_strategy.py is a deliberately broken strategy. Feed its contents to audit_strategy and Litmus reports four blocking issues and two warnings: a sub-minute timeframe, a cosmetic stoploss = -0.99, two kinds of lookahead bias, a missing informative_pairs(), and a 10-parameter hyperopt surface.
Built-in strategies
So the agent can backtest without you writing a strategy class:
ma_crossβ moving-average crossover. Params:fast,slow.rsi_reversionβ buy oversold, exit overbought. Params:period,lower,upper.breakoutβ enter on N-bar high breakout. Params:lookback.
How it works
Plain Python, organised into small engine classes that the MCP tools delegate to:
server.py FastMCP app β the 6 tools
market_data.py MarketData β ccxt wrapper (lazy-imported)
backtester.py Backtester β vectorised backtest + walk-forward, costs included
risk.py RiskAnalyzer β metrics + Monte Carlo (Box-Muller)
auditor.py StrategyAuditor β AST-based static analysisFetched candles are cached server-side and referenced by dataset_id, so a 500-candle series never has to travel through the model's context twice.
Roadmap
Config auditor: catch shared-SQLite-DB collisions and other multi-bot Freqtrade footguns
More lookahead patterns (resampling leaks,
.iloc[-1]misuse)Custom strategy upload, not just built-ins
Equity-curve charts rendered inline via MCP Apps
Expose a strategy library as MCP resources
Contributing
Issues and PRs welcome β especially new audit rules. If you've been burned by a backtest that lied, encode the lesson here.
License
MIT Β© AdriΓ‘n Llaca Mayo
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Spectrexf/litmus-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server