Skip to main content

Open-source MCP Server for Crypto Exchanges via CCXT

Project description

mcp-ccxt

Open-source MCP Server for Crypto Exchanges via CCXT.

Connect AI agents (Claude, Cursor, CrewAI, LangChain) to 100+ crypto exchanges through the Model Context Protocol.

Features

  • 13 tools: market data, trading, account management
  • 100+ exchanges: Binance, OKX, Bybit, Coinbase, Kraken, and more via CCXT
  • 2 transports: stdio (local) and Streamable HTTP (remote/Docker)
  • Async only: built on ccxt.async_support for performance
  • Safe by default: sandbox mode on, rate limiting built-in, no credential leaks

Quickstart (< 5 minutes)

1. Install

pip install mcp-ccxt

2. Configure

Create config.json:

{
  "accounts": [
    {
      "name": "binance-test",
      "exchange_id": "binance",
      "api_key": "YOUR_API_KEY",
      "secret": "YOUR_SECRET",
      "sandbox": true,
      "default_type": "spot"
    }
  ]
}

3. Test connectivity

mcp-ccxt test-sandbox --config config.json
# [OK] binance-test: connected (BTC/USDT = 50000.0)

4. Run server

stdio (Claude Desktop / Cursor):

mcp-ccxt run --config config.json

Streamable HTTP (remote / Docker):

mcp-ccxt run --config config.json --transport streamable-http --host 0.0.0.0 --port 8000

Claude Desktop setup

Add to Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "ccxt": {
      "command": "mcp-ccxt",
      "args": ["run", "--config", "/path/to/config.json"]
    }
  }
}

See also examples/claude_desktop_config.json.

Cursor setup

Add to Cursor MCP settings:

{
  "mcpServers": {
    "ccxt": {
      "command": "mcp-ccxt",
      "args": ["run", "--config", "/path/to/config.json"]
    }
  }
}

See also examples/cursor_config.json.

Docker (remote deployment)

docker compose -f docker-compose.example.yml up -d

The server listens on http://localhost:8000 (Streamable HTTP). Connect from CrewAI or any MCP client, for example:

http://localhost:8000/mcp

See examples/crewai_example.py for a CrewAI sample.

Tools reference

Market data (5 tools)

Tool Description
fetch_ticker Current price, spread, volume for a symbol
fetch_ohlcv OHLCV candles (1m to 1M timeframes)
fetch_order_book Bids/asks with spread calculation
fetch_markets All markets with limits + precision
list_exchanges All supported exchange IDs

Trading (4 tools)

Tool Description
create_order Place market or limit order
cancel_order Cancel an open order
edit_order Modify existing order (exchange-dependent)
fetch_open_orders List open orders

Account (4 tools)

Tool Description
fetch_balance Account balances (zero-balance filtered)
fetch_my_trades Trade history for a symbol
fetch_positions Open futures positions
get_server_info Server version + connected exchanges

Configuration

Exchange accounts (config.json)

{
  "accounts": [
    {
      "name": "unique-account-name",
      "exchange_id": "binance",
      "api_key": "...",
      "secret": "...",
      "password": "...",
      "sandbox": true,
      "default_type": "spot"
    }
  ]
}
Field Required Description
name yes Unique identifier for this account
exchange_id yes CCXT exchange ID (e.g. binance, okx)
api_key no API key (required for trading)
secret no API secret
password no Passphrase (OKX requires this)
sandbox no Enable testnet mode (default: true)
default_type no Market type: spot, swap, future (default: spot)

Transport options

Flag Default Description
--transport stdio stdio or streamable-http
--host 127.0.0.1 Bind address (use 0.0.0.0 for Docker)
--port 8000 HTTP port
--log-level INFO Logging level

Security

  • Sandbox on by default — testnet mode reduces accidental real trades
  • No credential leaks — API keys never appear in tool responses or error messages
  • SecretStr credentials — keys masked in logs and repr()
  • Rate limiting — CCXT built-in rate limiter (no custom implementation)

Requirements

  • Python 3.11+
  • CCXT 4.4+
  • FastMCP 2.3+

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_ccxt-1.0.0.tar.gz (195.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_ccxt-1.0.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_ccxt-1.0.0.tar.gz.

File metadata

  • Download URL: mcp_ccxt-1.0.0.tar.gz
  • Upload date:
  • Size: 195.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_ccxt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 72ce7d4f0ec16ac0c379f54ce0d40a57e5874592fff04943250875ac1e8074ef
MD5 c0ec00a396eb5a8c8148124dc4f6cf55
BLAKE2b-256 06cd5496fe19d1096201462bc099fe078a28eb5cca329d9f358fc118d8823ecf

See more details on using hashes here.

File details

Details for the file mcp_ccxt-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_ccxt-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_ccxt-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43f729635d559002defffede09005c91dd7aded973162a8559bb0e851359ab6a
MD5 2ce68b937331d564038c3304ee714880
BLAKE2b-256 b3c48be7b4eb14d6e6326bbff35e95871362975aa98849050a45eb615533c1d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page