Freqtrade MCP server

Provides a bridge to Freqtrade's REST API for monitoring market data, managing trades, configuring bot behavior, and analyzing performance metrics in cryptocurrency trading
Back to servers
Setup instructions
Provider
kukapay
Release date
Mar 25, 2025
Language
Python
Stats
56 stars

Freqtrade-MCP is a server that integrates with the Freqtrade cryptocurrency trading bot, enabling AI agents to interact with and control automated trading operations through Freqtrade's REST API. This integration allows for sophisticated control and monitoring of your trading activities using natural language commands.

Installation

Prerequisites

  • Python 3.13+: Ensure Python is installed on your system
  • Freqtrade: A running Freqtrade instance with the REST API enabled
  • Git: For cloning the repository

Setup Steps

  1. Clone the Repository:

    git clone https://github.com/kukapay/freqtrade-mcp.git
    cd freqtrade-mcp
    
  2. Install Dependencies: Using pip:

    pip install freqtrade-client mcp[cli]
    

    Or with uv (optional):

    uv add freqtrade-client "mcp[cli]"
    
  3. Client Configuration: Configure the MCP server with your Freqtrade API credentials:

    "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"
        } 
      } 
    }
    
  4. Freqtrade API Configuration: Enable the REST API in your Freqtrade 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"
    }
    

Usage

Available Tools

The MCP server exposes these Freqtrade API endpoints as 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

Example Prompts

Market Data

  • "Show me the hourly price data for BTC/USDT."
  • "What's the 5-minute chart for ETH/BTC like?"

Bot Control

  • "What's the current status of my open trades?"
  • "Start the trading bot."
  • "Stop the trading bot."

Portfolio Information

  • "How much profit have I made so far?"
  • "What's my account balance?"
  • "How well has the bot been performing?"

Pair Management

  • "Which pairs are on the whitelist?"
  • "Blacklist ETH/USDT."
  • "Remove ETH/USDT from the blacklist."

Trade Actions

  • "Buy 0.01 BTC/USDT right now."
  • "Sell 0.05 ETH/USDT immediately."
  • "What's the history of my closed trades?"

Configuration

  • "What's the current bot configuration?"
  • "Reload the bot's configuration."
  • "Are there any trade locks active?"
  • "Delete the trade lock with ID 123."

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "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"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "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"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "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"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later