freqtrade-mcp-server

freqtrade-mcp-server

An MCP server for cryptocurrency trading via Freqtrade, enabling trade management, balance checks, strategy configuration, backtesting, and bot lifecycle control from any MCP-compatible AI agent.

Category
Visit Server

README

Freqtrade MCP Server ๐Ÿค–๐Ÿ“ˆ

Python License Stars MCP GitHub

A Model Context Protocol (MCP) server for cryptocurrency trading via Freqtrade โ€” manage trades, check balances, configure strategies, backtest, and control the bot lifecycle from any MCP-compatible AI agent.

Built for AI agents. Works with Hermes Agent, Claude Code, Cursor, Windsurf, and any MCP-compatible client.

โœจ Features (43 Tools)

๐Ÿ”ง System & Health (5 Tools)

Tool Description
ping Check if the freqtrade API server is reachable
get_version Get the running bot version string
get_health Detailed bot health (uptime, loop time, process status)
get_logs Fetch recent bot log messages (configurable limit)
get_sysinfo System resource usage (CPU, RAM, uptime)

๐ŸŽฎ Bot Lifecycle (3 Tools)

Tool Description
start_bot Start the trading bot (if currently stopped)
stop_bot Stop the trading bot gracefully
stop_buying Temporarily prevent new trades (reload config to re-enable)

๐Ÿ“Š Trade Information (6 Tools)

Tool Description
get_open_trades List all open trades with current profit/loss
get_trade_detail Full details of a specific trade by ID
get_trade_history Historical closed trades with pagination
get_count Open trade count vs maximum allowed
delete_trade Permanently delete a trade from the database
cancel_open_order Cancel an open order for a specific trade

๐Ÿ’ฐ Account & Performance (10 Tools)

Tool Description
get_balance Full account balance across all currencies
get_profit Profit/loss summary (total, factor, percentage)
get_daily_profit Daily P&L breakdown for last N days
get_weekly_profit Weekly P&L breakdown for last N weeks
get_monthly_profit Monthly P&L breakdown for last N months
get_performance Per-pair trade performance (best/worst)
get_stats Stats report (exit reasons, durations)
get_entries_analysis Analyze trade entries by buy tag
get_exits_analysis Analyze trade exits by exit reason
get_mix_tags Combined entry tag + exit reason analysis

๐ŸŽฏ Trading Actions (2 Tools)

Tool Description
force_entry Force-enter a trade (long/short, with leverage & tags)
force_exit Force-exit (sell) an open trade (partial exit supported)

๐Ÿ“‹ Pairs & Whitelist/Blacklist (4 Tools)

Tool Description
get_whitelist Active trading pair whitelist
get_blacklist Currently blacklisted pairs
add_to_blacklist Add one or more pairs to blacklist
get_pairlists_available List available pairlist handler plugins
get_available_pairs Pairs available for backtesting (filterable)

๐Ÿ”’ Pair Locks (3 Tools)

Tool Description
get_locks All active pair locks
lock_pair Lock a pair (with expiration, side, reason)
unlock_pair Remove a pair lock by ID

๐Ÿง  Strategies & Market Data (4 Tools)

Tool Description
list_strategies Available strategy classes
get_strategy_detail Strategy information (code, params, timeframe)
get_plot_config Plot configuration from active strategy
get_pair_candles Live OHLCV candle data (any pair/timeframe)
get_pair_history Historic analyzed dataframe for a pair + strategy

โš™๏ธ Configuration (2 Tools)

Tool Description
get_config Current (sanitized) bot configuration
reload_config Reload config from disk (no restart needed)

๐Ÿ—ƒ๏ธ Custom Data (2 Tools)

Tool Description
get_custom_data Custom data stored for a specific trade
get_open_trades_custom_data Custom data across all open trades

๐Ÿš€ Quick Start

1. Install

pip install git+https://github.com/ceeyang-ai/freqtrade-mcp-server.git

2. Start Freqtrade (dry-run for testing)

Create a minimal config (config.json):

{
    "max_open_trades": 3,
    "stake_currency": "USDT",
    "stake_amount": 50,
    "dry_run": true,
    "dry_run_wallet": 1000,
    "timeframe": "5m",
    "exchange": {
        "name": "binance",
        "pair_whitelist": ["BTC/USDT", "ETH/USDT"]
    },
    "api_server": {
        "enabled": true,
        "listen_port": 8080,
        "username": "freqtrader",
        "password": "your_password",
        "jwt_secret_key": "a-very-long-random-string-at-least-32-chars"
    }
}
freqtrade trade --strategy SampleStrategy --config config.json

3. Run the MCP Server

export FREQTRADE_URL=http://127.0.0.1:8080
export FREQTRADE_USERNAME=freqtrader
export FREQTRADE_PASSWORD=your_password

freqtrade-mcp-server

Configuration via Environment Variables

Variable Required Default Description
FREQTRADE_URL No http://127.0.0.1:8080 Freqtrade API server URL
FREQTRADE_USERNAME No freqtrade API username from api_server config
FREQTRADE_PASSWORD No "" API password from api_server config

๐Ÿ”Œ Usage with AI Agents

Hermes Agent

Add to ~/.hermes/config.yaml:

mcp_servers:
  freqtrade:
    command: "freqtrade-mcp-server"
    env:
      FREQTRADE_URL: "http://127.0.0.1:8080"
      FREQTRADE_USERNAME: "freqtrader"
      FREQTRADE_PASSWORD: "your_password"

Then ask your agent: "What's my current crypto portfolio balance?", "Force-enter BTC/USDT long", "Run a backtest on BTC/USDT"

Claude Code / Cursor

{
  "mcpServers": {
    "freqtrade": {
      "command": "freqtrade-mcp-server",
      "env": {
        "FREQTRADE_URL": "http://127.0.0.1:8080",
        "FREQTRADE_USERNAME": "freqtrader",
        "FREQTRADE_PASSWORD": "your_password"
      }
    }
  }
}

๐Ÿ›  Requirements

  • Python 3.10+
  • Freqtrade instance running with API server enabled (api_server.enabled: true)
  • freqtrade-client >= 2026.5 (installed automatically)
  • mcp >= 1.0 (installed automatically)

๐Ÿงช Development

git clone https://github.com/ceeyang-ai/freqtrade-mcp-server.git
cd freqtrade-mcp-server
pip install -e .

# Run integration tests (requires running Freqtrade instance)
python test_integration.py

๐Ÿค Related Projects

๐Ÿ“„ License

MIT โ€” free for personal and commercial use.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured