SuperAPI AI Directory

mcp-server-ccxt

Real-time crypto market data and trading across many exchanges via CCXT: spot, futures, OHLCV, balances and orders.

Open website

About this tool

Purpose

mcp-server-ccxt is a high-performance cryptocurrency exchange integration tool built on MCP (Model Context Protocol) and the CCXT library, used to connect large language models (such as Claude, GPT, and other MCP-supporting models) to cryptocurrency exchanges, enabling the models to access real-time market data and perform trading operations.

Main Capabilities

  • Exchange Support: Can connect to more than 20 cryptocurrency exchanges.
  • Market Types: Supports multiple market types such as spot, futures, and perpetual contracts.
  • Proxy Configuration: Provides the option to access exchanges through a proxy.
  • Performance Optimization: Features optimized caching and rate-limiting mechanisms to ensure speed and reliability.
  • MCP Standard: Compatible with large language models connected via MCP, such as Claude and GPT.

Architecture

The server is architecturally a bridge between language models and exchanges, including: LLM clients (Claude and other MCP-compatible models) sending requests; MCP standardized communication; the CCXT MCP Server handling requests and managing exchange interactions; the CCXT library providing unified access to exchange APIs; and connections to multiple cryptocurrency exchanges.

The code organization is divided into three main modules: Exchange (manages exchange instances, credentials, and trading pair validation), Utils (provides caching, rate limiting, and logging functionality), and Tools (implements the MCP tools and resources used for exchange interaction).

Usage

Install via Smithery: Can automatically install mcp-server-ccxt for Claude Desktop.

NPM Package (Recommended): Can be installed from npm, or run directly.

Manual Installation: Can clone and build the repository; create an environment file cp .env.example .env; edit the .env file to add exchange API keys, for example:

# Default exchange (optional)
DEFAULT_EXCHANGE=binance
# Default market type (optional)
DEFAULT_MARKET_TYPE=spot
# API credentials (optional)
BINANCE_API_KEY=your_api_key
BINANCE_SECRET=your_api_secret
# For exchanges requiring passphrase (e.g., KuCoin)
KUCOIN_API_KEY=your_kucoin_api_key
KUCOIN_SECRET=your_kucoin_secret
KUCOIN_PASSPHRASE=your_kucoin_passphrase
# Proxy configuration (optional)
USE_PROXY=false
PROXY_URL=http://username:password@your-proxy-server:port
# Legacy format (still supported but recommended to use the integrated URL format above)
# PROXY_USERNAME=
# PROXY_PASSWORD=

If you encounter MCP communication issues, refer to the Troubleshooting Guide.

Run the Server: After starting the server, you can add it in Claude for Desktop to claude_desktop_config.json(two configuration methods: npm global installation or manual installation), then restart Claude for Desktop. This package can also be used as a module in other Node.js projects.

Example Queries:

  • "What's the current price of Bitcoin on Binance?"
  • "Show me the order book for ETH/USDT on Coinbase"
  • "Get the 1-hour OHLCV data for BTC/USDT on Binance for the last 24 candles"
  • "Compare the price of SOL/USDT across different exchanges"
  • "What's my current balance on Binance?" (requires API key)
  • "Place a market buy order for 0.1 ETH on Kraken" (requires API key)

Available Tools

Public API Tools: list-exchanges, get-ticker, batch-get-tickers, get-orderbook / get-order-book, get-ohlcv, get-trades, get-markets, get-exchange-info, get-leverage-tiers, get-funding-rates, get-positions, get-open-orders, get-order-history.

Private API Tools (require API key): account-balance, place-market-order, place-limit-order, cancel-order, cancel-all-orders, set-leverage, set-margin-mode, place-futures-market-order, place-futures-limit-order, transfer-funds.

Configuration and Utility Tools: cache-stats, clear-cache, set-log-level, get-proxy-config, set-proxy-config, set-market-type, set-default-exchange, system-info.

Performance Optimization

  • LRU Cache System: Different types of data use different TTLs—market data 10 seconds, order book data 5 seconds, market data 1 hour.
  • Adaptive Rate Limiting: Automatically adjusts request rates based on exchange responses, implements exponential backoff for errors, and manages concurrent requests per exchange.
  • Exchange Connection Management: Efficiently initializes exchange instances with proper error handling and retries.

Security Best Practices

API Key Security:

  • Create dedicated API keys: Create separate keys for different applications/uses, and never reuse them across services.
  • Restrict API key permissions: Enable only the permissions you need (e.g., read-only for market data), disable withdrawal permissions if you only need trading functionality, and use IP whitelists when available.
  • Secure storage: Never commit API keys to version control systems, store them in environment variables or secure vaults, and use .env files excluded via .gitignore.

Limitations and Risks

This software is for reference only. Interacting with cryptocurrency exchanges involves significant risks: financial risk (cryptocurrency trading carries the risk of loss), API security (you need to ensure API keys have appropriate permission restrictions), no investment advice is provided, and there is no warranty of any kind (the software is provided "as is"). The project uses the MIT License.

For issue reports, feature requests, or contributions, please visit the GitHub repository.