CCXT MCP Server
Unified Model Context Protocol gateway for cryptocurrency exchange integration
Key Features
Use Cases
README
CCXT MCP Server
High-performance cryptocurrency exchange integration using MCP (Model Context Protocol) and CCXT.
Features
- 🚀 Exchange Support: Connects to 20+ cryptocurrency exchanges
- 🔃 Market Types: Supports spot, futures, swap markets and more
- 🔧 Proxy Configuration: Options for accessing exchanges through proxies
- 📊 Fast & Reliable: Optimized caching and rate limiting
- 🌐 MCP Standard: Compatible with LLMs like Claude and GPT via MCP
CCXT MCP Server Integration Architecture
The CCXT MCP Server connects language models to cryptocurrency exchanges through the Model Context Protocol. It serves as a bridge that allows LLMs to access real-time market data and execute trading operations across multiple exchanges through a unified API.
The architecture includes:
- LLM clients (Claude and other MCP-compatible models) that send requests
- The Model Context Protocol (MCP) that standardizes communication
- The CCXT MCP Server that processes requests and manages exchange interactions
- The CCXT Library that provides unified access to exchange APIs
- Connections to multiple cryptocurrency exchanges
CCXT MCP Server Code Architecture
The server is organized into three main modules for better maintainability and extensibility:
- Exchange: Manages exchange instances, credentials, and symbol validation
- Utils: Provides caching, rate limiting, and logging functionality
- Tools: Implements MCP tools and resources for exchange interaction
Quick Start
Installing via Smithery
To install mcp-server-ccxt for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @doggybee/mcp-server-ccxt --client claude
NPM Package (Recommended)
You can install CCXT MCP Server from npm:
# Install globally
npm install -g @mcpfun/mcp-server-ccxt
# Start the server
mcp-server-ccxt
Or run directly:
npx @mcpfun/mcp-server-ccxt
Manual Installation
Alternatively, you can clone and build the repository:
# Clone the repository
git clone https://github.com/doggybee/mcp-server-ccxt.git
cd mcp-server-ccxt
# Install dependencies
npm install
# Build the server
npm run build
# Start the server
npm start
Configuration
-
Create an environment file
bashcp .env.example .env -
Edit the
.envfile to add your exchange API keys# 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=
Usage
Note: If you encounter any issues with MCP communication, please see the Troubleshooting Guide for solutions.
Running the Server
Start the server:
# If installed globally via npm
mcp-server-ccxt
# If installed manually
npm start
Using with Claude for Desktop
- Add the server to your
claude_desktop_config.json:
If installed via npm (globally):
{
"mcpServers": {
"ccxt": {
"command": "mcp-server-ccxt"
}
}
}
If installed manually:
{
"mcpServers": {
"ccxt": {
"command": "node",
"args": [
"/path/to/mcp-server-ccxt/build/index.js"
]
}
}
}
- Restart Claude for Desktop
Using as a Module in Another Project
You can also use this package as a module in your own Node.js projects:
// Import the CCXT MCP Server
import '@mcpfun/mcp-server-ccxt';
// The server starts automatically when imported
// You can configure it through environment variables
Example Queries
Here are some example queries you can use with the MCP server:
- "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 keys)
- "Place a market buy order for 0.1 ETH on Kraken" (requires API keys)
Available Tools
Public API Tools
list-exchanges: List all available cryptocurrency exchangesget-ticker: Get current ticker information for a trading pairbatch-get-tickers: Get ticker information for multiple trading pairs at onceget-orderbook/get-order-book: Get market order book for a trading pairget-ohlcv: Get OHLCV candlestick data for a trading pairget-trades: Get recent trades for a trading pairget-markets: Get all available markets for an exchangeget-exchange-info: Get exchange information and statusget-leverage-tiers: Get futures leverage tiersget-funding-rates: Get current funding ratesget-positions: Get open positions informationget-open-orders: Get all open ordersget-order-history: Get order history
Private API Tools (requires API keys)
account-balance: Get your account balance from a crypto exchangeplace-market-order: Place a market order on an exchangeplace-limit-order: Place a limit order on an exchangecancel-order: Cancel an existing ordercancel-all-orders: Cancel all open ordersset-leverage: Set leverage for futuresset-margin-mode: Set margin mode for futuresplace-futures-market-order: Place futures market ordersplace-futures-limit-order: Place futures limit orderstransfer-funds: Transfer funds between accounts (e.g., spot to futures)
Configuration & Utility Tools
cache-stats: Get CCXT cache statisticsclear-cache: Clear CCXT cacheset-log-level: Set logging levelget-proxy-config: Get proxy settingsset-proxy-config: Configure proxy settingsset-market-type: Set default market typeset-default-exchange: Change the default exchangesystem-info: Get system and environment information
Performance Optimizations
MCP-CCXT includes several optimizations to ensure high performance:
-
LRU Caching System:
- Different TTLs for different types of data
- Ticker 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
- Manages concurrent requests per exchange
-
Exchange Connection Management:
- Efficient initialization of exchange instances
- Proper error handling and retries
Security Best Practices
API Key Security
-
Create Dedicated API Keys:
- Create separate API keys for different applications/purposes
- Never reuse API keys across different services or applications
-
Limit 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
- Use IP whitelisting when available to restrict access to known IPs
-
Secure Storage:
- Never commit API keys to version control systems
- Store API keys in environment variables or a secure vault
- Use
.envfiles that are excluded from git via.gitignore
Risk Disclaimer
This software is provided for informational purposes only. Using this software to interact with cryptocurrency exchanges involves significant risks:
- Financial Risk: Cryptocurrency trading involves risk of loss
- API Security: Ensure your API keys have appropriate permission limits
- No Investment Advice: This tool does not provide investment advice
- No Warranty: The software is provided "as is" without warranty of any kind
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
Copyright and Attribution
This project uses the CCXT library (https://github.com/ccxt/ccxt), which is:
Copyright (c) 2016-2024 CCXT developers
CCXT is released under the MIT License, which is included below:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
For issues, feature requests, or contributions, please visit the GitHub repository.
Star History
Repository Owner
User
Repository Details
Programming Languages
Tags
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
Crypto Indicators MCP Server
Technical analysis indicators and strategies for AI trading via the Model Context Protocol.
Crypto Indicators MCP Server provides over 50 cryptocurrency technical analysis indicators and quantitative trading strategies through an MCP-compliant server interface. The tool is designed for AI trading agents and can integrate seamlessly with platforms like Claude Desktop. It offers support for multiple exchanges via CCXT, modular design for easy maintenance, and outputs actionable trading signals based on market trends.
- ⭐ 91
- MCP
- kukapay/crypto-indicators-mcp
Cross-LLM MCP Server
Unified MCP server for accessing and combining multiple LLM APIs.
Cross-LLM MCP Server is a Model Context Protocol (MCP) server enabling seamless access to a range of Large Language Model APIs including ChatGPT, Claude, DeepSeek, Gemini, Grok, Kimi, Perplexity, and Mistral. It provides a unified interface for invoking different LLMs from any MCP-compatible client, allowing users to call and aggregate responses across providers. The server implements eight specialized tools for interacting with these LLMs, each offering configurable options like model selection, temperature, and token limits. Output includes model context details as well as token usage statistics for each response.
- ⭐ 9
- MCP
- JamesANZ/cross-llm-mcp
Model Context Protocol Server for Home Assistant
Seamlessly connect Home Assistant to LLMs for natural language smart home control via MCP.
Enables integration between a local Home Assistant instance and language models using the Model Context Protocol (MCP). Facilitates natural language monitoring and control of smart home devices, with robust API support for state management, automation, real-time updates, and system administration. Features secure, token-based access, and supports mobile and HTTP clients. Designed to bridge Home Assistant environments with modern AI-driven automation.
- ⭐ 468
- MCP
- tevonsb/homeassistant-mcp
@dealx/mcp-server
MCP server enabling LLMs to search and interact with the DealX platform.
Implements the Model Context Protocol, providing a standardized interface for large language models to interact with the DealX platform. Supports searching for ads through structured prompts and is designed for easy integration with tools like Claude and VS Code extensions. Flexible configuration options are available for environment variables, logging, and deployment. Extensible architecture supports future feature additions beyond ad search.
- ⭐ 0
- MCP
- DealExpress/mcp-server
Lara Translate MCP Server
Context-aware translation server implementing the Model Context Protocol.
Lara Translate MCP Server enables AI applications to seamlessly access professional translation services via the standardized Model Context Protocol. It supports features such as language detection, context-aware translations, and translation memory integration. The server acts as a secure bridge between AI models and Lara Translate, managing credentials and facilitating structured translation requests and responses.
- ⭐ 76
- MCP
- translated/lara-mcp
Sui Trader MCP
MCP server enabling automated token swaps on the Sui blockchain.
Sui Trader MCP acts as an MCP server designed for AI agents to conduct optimal token swaps on the Sui blockchain. It integrates with the Cetus Aggregator to execute swaps on the Sui mainnet, utilizing secure Bech32 private key management. The tool supports configuration for MCP-compatible clients, allowing seamless invocation of swap operations. Built with Node.js, it provides a reliable interface between AI-driven applications and blockchain-based token swap functionality.
- ⭐ 4
- MCP
- kukapay/sui-trader-mcp
Didn't find tool you were looking for?