Integrates with the Freqtrade cryptocurrency trading bot via its REST API
Freqtrade-MCP
An MCP server that integrates with the Freqtrade cryptocurrency trading bot via its REST API, enabling seamless AI agent interaction for automated trading operation.
For more crypto-related MCP servers, see the Kukapay MCP servers.
Installation
Prerequisites
- Python 3.13+: Ensure Python is installed on your system.
- Freqtrade: A running Freqtrade instance with the REST API enabled (see Freqtrade Docs).
- Git: For cloning the repository.
Steps
Clone the Repository:
git clone https://github.com/kukapay/freqtrade-mcp.git cd freqtrade-mcpInstall Dependencies: Using
pip:pip install freqtrade-client mcp[cli]Or with
uv(optional):uv add freqtrade-client "mcp[cli]"Client Configuration:
"mcpServers": { "freqtrade-mcp": { "command": "uv", "args": [ "--directory", "/your/path/to/freqtrade-mcp", "run", "__main__.py" ], "env": { "FREQTRADE_API_URL": "http://127.0.0.1:8080", "FREQTRADE_USERNAME": "your_username", "FREQTRADE_PASSWORD": "your_password" } } }Freqtrade Configuration:
Enable the rest API by adding the api_server section to your configuration and setting api_server.enabled to true.
Sample configuration:
"api_server": { "enabled": true, "listen_ip_address": "127.0.0.1", "listen_port": 8080, "verbosity": "error", "enable_openapi": false, "jwt_secret_key": "somethingrandom", "CORS_origins": [], "username": "Freqtrader", "password": "SuperSecret1!", "ws_token": "sercet_Ws_t0ken" },Check the document here.
Usage
Available Tools
The server exposes the following Freqtrade API endpoints as MCP tools:
| Tool | Description | Parameters |
|---|---|---|
fetch_market_data |
Fetch OHLCV data for a pair | pair: str, timeframe: str |
fetch_bot_status |
Get open trade status | None |
fetch_profit |
Get profit summary | None |
fetch_balance |
Get account balance | None |
fetch_performance |
Get performance metrics | None |
fetch_whitelist |
Get whitelist of pairs | None |
fetch_blacklist |
Get blacklist of pairs | None |
fetch_trades |
Get trade history | None |
fetch_config |
Get bot configuration | None |
fetch_locks |
Get trade locks | None |
place_trade |
Place a buy/sell trade | pair: str, side: str, stake_amount: float |
start_bot |
Start the bot | None |
stop_bot |
Stop the bot | None |
reload_config |
Reload bot configuration | None |
add_blacklist |
Add pair to blacklist | pair: str |
delete_blacklist |
Remove pair from blacklist | pair: str |
delete_lock |
Delete a trade lock | lock_id: int |
run_backtest |
Start backtest via REST API | strategy: str, enable_protections: bool, optional timerange, timeframe |
fetch_backtest_status |
Get current backtest status/result | None |
fetch_backtest_history |
List backtest history | optional filename: str |
abort_backtest |
Abort currently running backtest | None |
reset_backtest |
Reset backtest state/result | None |
Example Prompts
- Fetch Market Data:
- "Show me the hourly price data for BTC/USDT."
- "Wh
Tools (22)
fetch_market_dataFetch OHLCV data for a pairfetch_bot_statusGet open trade statusfetch_profitGet profit summaryfetch_balanceGet account balancefetch_performanceGet performance metricsfetch_whitelistGet whitelist of pairsfetch_blacklistGet blacklist of pairsfetch_tradesGet trade historyfetch_configGet bot configurationfetch_locksGet trade locksplace_tradePlace a buy/sell tradestart_botStart the botstop_botStop the botreload_configReload bot configurationadd_blacklistAdd pair to blacklistdelete_blacklistRemove pair from blacklistdelete_lockDelete a trade lockrun_backtestStart backtest via REST APIfetch_backtest_statusGet current backtest status/resultfetch_backtest_historyList backtest historyabort_backtestAbort currently running backtestreset_backtestReset backtest state/resultEnvironment Variables
FREQTRADE_API_URLrequiredThe URL of the Freqtrade REST API instanceFREQTRADE_USERNAMErequiredUsername for Freqtrade API authenticationFREQTRADE_PASSWORDrequiredPassword for Freqtrade API authenticationConfiguration
{"mcpServers": {"freqtrade-mcp": {"command": "uv", "args": ["--directory", "/your/path/to/freqtrade-mcp", "run", "__main__.py"], "env": {"FREQTRADE_API_URL": "http://127.0.0.1:8080", "FREQTRADE_USERNAME": "your_username", "FREQTRADE_PASSWORD": "your_password"}}}}