freqtrade-mcp

freqtrade-mcp

MCP server that connects AI agents to Freqtrade crypto trading bot via REST API. It provides 15 tools for account stats, trade management, market data, pair lists, and bot lifecycle control.

Category
访问服务器

README

@furkankoykiran/freqtrade-mcp

CI npm version GitHub Package License: MIT Node.js

TypeScript MCP server for Freqtrade — connect AI agents (Claude, Cursor, Cline) to your crypto trading bot via its REST API.

Built with the official MCP TypeScript SDK, it exposes 15 tools covering account stats, trade management, market data, pair list control, trade execution, and bot lifecycle — all accessible from any MCP-compatible client.


Features

Category Tools
Account get_profit_stats, get_balance, get_performance
Trades get_open_trades, get_trade, get_trade_history
Market Data get_market_data
Pair Lists get_whitelist, get_blacklist, add_to_blacklist, remove_from_blacklist
Execution execute_trade, force_exit_trade
Lifecycle start_bot, stop_bot, reload_config, get_bot_info, get_locks, delete_lock

Prerequisites

  1. Freqtrade running with the REST API enabled (see Freqtrade REST API docs)
  2. Node.js 18+ (node --version)

Enable the Freqtrade REST API

Add the following to your Freqtrade config.json:

"api_server": {
  "enabled": true,
  "listen_ip_address": "127.0.0.1",
  "listen_port": 8080,
  "verbosity": "error",
  "enable_openapi": false,
  "jwt_secret_key": "change-this-to-a-random-32-char-string",
  "username": "Freqtrader",
  "password": "YourStrongPassword"
}

Installation

Option 1 — Run directly with npx (no install required)

FREQTRADE_PASSWORD=yourpassword npx @furkankoykiran/freqtrade-mcp

Option 2 — Install globally from npm

npm install -g @furkankoykiran/freqtrade-mcp
FREQTRADE_PASSWORD=yourpassword freqtrade-mcp

Option 3 — Install from GitHub Packages

npm install -g @furkankoykiran/freqtrade-mcp --registry=https://npm.pkg.github.com
FREQTRADE_PASSWORD=yourpassword freqtrade-mcp

Option 4 — Build from source

git clone https://github.com/furkankoykiran/freqtrade-mcp.git
cd freqtrade-mcp
npm install
npm run build
node build/index.js

Configuration

The server is configured entirely via environment variables — no config file needed.

Variable Default Description
FREQTRADE_API_URL http://127.0.0.1:8080 Base URL of the Freqtrade API server
FREQTRADE_USERNAME Freqtrader API username from your Freqtrade config
FREQTRADE_PASSWORD (empty) API password — required

Copy .env.example to .env and fill in your values for local development.


MCP Client Setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "freqtrade": {
      "command": "npx",
      "args": ["-y", "@furkankoykiran/freqtrade-mcp"],
      "env": {
        "FREQTRADE_API_URL": "http://127.0.0.1:8080",
        "FREQTRADE_USERNAME": "Freqtrader",
        "FREQTRADE_PASSWORD": "YourStrongPassword"
      }
    }
  }
}

VS Code (Cline / Continue)

Add to your MCP server settings:

{
  "freqtrade": {
    "command": "npx",
    "args": ["-y", "@furkankoykiran/freqtrade-mcp"],
    "env": {
      "FREQTRADE_API_URL": "http://127.0.0.1:8080",
      "FREQTRADE_USERNAME": "Freqtrader",
      "FREQTRADE_PASSWORD": "YourStrongPassword"
    }
  }
}

Built from source

{
  "freqtrade": {
    "command": "node",
    "args": ["/absolute/path/to/freqtrade-mcp/build/index.js"],
    "env": {
      "FREQTRADE_API_URL": "http://127.0.0.1:8080",
      "FREQTRADE_USERNAME": "Freqtrader",
      "FREQTRADE_PASSWORD": "YourStrongPassword"
    }
  }
}

Available Tools

Account

get_profit_stats

Retrieve current profit/loss statistics: total profit, win/loss ratio, best pair, drawdown, trading volume, and more.

get_balance

Retrieve the current account balance across all currencies, including free, used, and total amounts.

get_performance

Retrieve per-pair trading performance metrics, including profit and trade count.

Parameter Type Required Description
pair string No Filter to a specific pair (e.g. BTC/USDT)

Trades

get_open_trades

Retrieve all currently active trades, including entry price, current profit, stake amount, and duration.

get_trade

Retrieve detailed information about a specific trade by its ID.

Parameter Type Required Description
trade_id number Yes Numeric trade ID

get_trade_history

Retrieve closed trade history with optional pagination.

Parameter Type Required Description
limit number No Max trades to return (max 500)
offset number No Pagination offset

Market Data

get_market_data

Retrieve live OHLCV candlestick data for a trading pair.

Parameter Type Required Description
pair string Yes Trading pair (e.g. BTC/USDT)
timeframe enum Yes 1m, 5m, 15m, 30m, 1h, 4h, 1d, etc.
limit number No Number of candles (max 500)

Pair Lists

get_whitelist / get_blacklist

Retrieve the current whitelist / blacklist.

add_to_blacklist

Add a trading pair to the blacklist.

Parameter Type Required Description
pair string Yes Pair to blacklist (e.g. ETH/USDT)

remove_from_blacklist

Remove a trading pair from the blacklist.

Parameter Type Required Description
pair string Yes Pair to remove

Trade Execution

execute_trade

Force-enter a trade, bypassing strategy signals. The bot manages the position after entry.

Parameter Type Required Description
pair string Yes Trading pair (e.g. BTC/USDT)
side long/short Yes Trade direction
stake_amount number No Amount in stake currency
price number No Limit price (omit for market order)
order_type limit/market No Order type

Natural language examples:

  • "buy 100 USDT of BTC"pair=BTC/USDT, side=long, stake_amount=100
  • "short ETH/USDT at 2000"pair=ETH/USDT, side=short, price=2000

force_exit_trade

Force-exit an open trade. Supports full and partial exits.

Parameter Type Required Description
trade_id number Yes Trade ID to exit
order_type limit/market No Exit order type (default: market)
amount number No Partial exit amount

Bot Lifecycle

start_bot / stop_bot

Start or stop the trading bot.

reload_config

Reload the bot configuration from disk without restarting the process.

get_bot_info

Retrieve bot version and the timestamp of the last strategy run cycle.

get_locks

Retrieve all active trade locks.

delete_lock

Remove a specific trade lock by ID.

Parameter Type Required Description
lock_id number Yes Lock ID to remove

Development

# Clone and install
git clone https://github.com/furkankoykiran/freqtrade-mcp.git
cd freqtrade-mcp
npm install

# Run in development mode (auto-reloads on change)
cp .env.example .env
# Edit .env with your Freqtrade credentials
npm run dev

# Type-check
npm run typecheck

# Lint
npm run lint

# Build for production
npm run build

Testing with MCP Inspector

npx @modelcontextprotocol/inspector node build/index.js

Set the environment variables in the Inspector UI and verify all 15 tools are listed.


Contributing

Contributions are welcome. Please read the contributing guidelines and open an issue before submitting a pull request for significant changes.


License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选