
MCP server exposing Freqtrade backtesting, hyperopt and market-data tools to Claude and other LLM clients, plus a LangGraph agent that generates and optimizes trading strategies
概览
MCP server that exposes Freqtrade strategy development tools (data download, backtesting, hyperopt, result analysis) to LLM clients like Claude Desktop and Claude Code. It ships with a LangGraph agent that uses the same tools to generate, optimize and evaluate strategies on its own. Independent project, not affiliated with the Freqtrade team. For research and education. Backtest results do not predict live performance. Never trade real funds with a strategy you have not reviewed yourself. Full parameter reference: docs/tools-reference.md. - Python 3.11+ (required by freqtrade>=2025.7) - A Freqtrade installation with a user_data/ directory - freqtrade on PATH for backtest/hyperopt runs - For the agent: an API key for one of the supported LLM providers pip install -r requirements.txt also works and installs everything, agent included. The server reads ~/.config/freqtrade-mcp/config.
README
以下为原文 README 节选,完整内容请查看原文。
Freqtrade Dev MCP
MCP server that exposes Freqtrade strategy development tools (data download, backtesting, hyperopt, result analysis) to LLM clients like Claude Desktop and Claude Code. It ships with a LangGraph agent that uses the same tools to generate, optimize and evaluate strategies on its own.
Independent project, not affiliated with the Freqtrade team. For research and education. Backtest results do not predict live performance. Never trade real funds with a strategy you have not reviewed yourself.
What’s inside
| Component | Path | Purpose |
|---|---|---|
| MCP server | src/ |
stdio MCP server with 12 Freqtrade tools |
| Strategy agent | strategy_agent/ |
LangGraph workflow: idea → code → hyperopt → backtest → analysis → rewrite |
| Examples | examples/ |
Claude Desktop / Claude Code configs, usage scripts |
| Docs | docs/ |
Tool reference, developer guide, agent docs |
| Tests | tests/ |
Unit and integration tests (pytest) |
MCP tools
| Group | Tool | What it does |
|---|---|---|
| Setup | create_userdir |
Create a Freqtrade user_data directory |
create_config |
Generate a config from a template (default, conservative, aggressive, advanced) |
|
| Strategy | create_strategy |
Generate a strategy from a template (basic, trend, mean_reversion, scalping, advanced) |
create_strategy_wireframe |
Generate a minimal skeleton for an LLM to fill in | |
| Data & runs | download_candles |
Download OHLCV data; accepts natural-language ranges ("last 3 months") and top15 by market cap (CoinGecko) |
backtest_strategy |
Run a backtest, optionally exporting trades and signals | |
hyperopt_strategy |
Run hyperparameter optimization | |
| Analysis | extract_backtest_data |
Parse a backtest .zip into metrics, trades, per-pair / per-hour stats |
extract_hyperopt_data |
Parse a .fthypt file into best params, parameter ranges, convergence |
|
search_results |
Filter indexed results by profit, drawdown, win rate, trades, dates (SQLite index) | |
list_results / get_result |
Browse and fetch saved results |
Full parameter reference: docs/tools-reference.md.
Requirements
- Python 3.11+ (required by
freqtrade>=2025.7) - A Freqtrade installation with a
user_data/directory freqtradeonPATHfor backtest/hyperopt runs- For the agent: an API key for one of the supported LLM providers
Installation
git clone https://github.com/dasein108/freqtrade_dev_mcp.git
cd freqtrade_dev_mcp
# MCP server only
uv pip install -e .
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"freqtrade": {
"command": "/absolute/path/to/python",
"args": ["/absolute/path/to/freqtrade_dev_mcp/run_server.py"],
"env": {
"FREQTRADE_MCP_PATH": "/absolute/path/to/freqtrade"
}
}
}
}