High-performance cryptocurrency exchange integration using MCP (Model Context Protocol) and CCXT. - ๐ 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 l
Add this skill
npx mdskills install doggybee/mcp-server-ccxtComprehensive cryptocurrency exchange integration with 30+ tools, clear setup, and good security practices
1# CCXT MCP Server23<img src="assets/ccxt-logo.png" alt="CCXT Logo" width="100" height="100"/>456[](https://www.modelcontextprotocol.org/)7[](https://github.com/ccxt/ccxt)8[](https://smithery.ai/server/@doggybee/mcp-server-ccxt)910High-performance cryptocurrency exchange integration using MCP (Model Context Protocol) and CCXT.1112## Features1314- ๐ **Exchange Support**: Connects to 20+ cryptocurrency exchanges15- ๐ **Market Types**: Supports spot, futures, swap markets and more16- ๐ง **Proxy Configuration**: Options for accessing exchanges through proxies17- ๐ **Fast & Reliable**: Optimized caching and rate limiting18- ๐ **MCP Standard**: Compatible with LLMs like Claude and GPT via MCP1920## CCXT MCP Server Integration Architecture21222324The 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.2526The architecture includes:27- LLM clients (Claude and other MCP-compatible models) that send requests28- The Model Context Protocol (MCP) that standardizes communication29- The CCXT MCP Server that processes requests and manages exchange interactions30- The CCXT Library that provides unified access to exchange APIs31- Connections to multiple cryptocurrency exchanges3233## CCXT MCP Server Code Architecture34353637The server is organized into three main modules for better maintainability and extensibility:3839- **Exchange**: Manages exchange instances, credentials, and symbol validation40- **Utils**: Provides caching, rate limiting, and logging functionality41- **Tools**: Implements MCP tools and resources for exchange interaction4243## Quick Start4445### Installing via Smithery4647To install mcp-server-ccxt for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@doggybee/mcp-server-ccxt):4849```bash50npx -y @smithery/cli install @doggybee/mcp-server-ccxt --client claude51```5253### NPM Package (Recommended)5455You can install CCXT MCP Server from npm:5657```bash58# Install globally59npm install -g @mcpfun/mcp-server-ccxt6061# Start the server62mcp-server-ccxt63```6465Or run directly:6667```bash68npx @mcpfun/mcp-server-ccxt69```7071### Manual Installation7273Alternatively, you can clone and build the repository:7475```bash76# Clone the repository77git clone https://github.com/doggybee/mcp-server-ccxt.git78cd mcp-server-ccxt7980# Install dependencies81npm install8283# Build the server84npm run build8586# Start the server87npm start88```8990## Configuration91921. Create an environment file93 ```bash94 cp .env.example .env95 ```96972. Edit the `.env` file to add your exchange API keys98 ```99 # Default exchange (optional)100 DEFAULT_EXCHANGE=binance101102 # Default market type (optional)103 DEFAULT_MARKET_TYPE=spot104105 # API credentials (optional)106 BINANCE_API_KEY=your_api_key107 BINANCE_SECRET=your_api_secret108 # For exchanges requiring passphrase (e.g., KuCoin)109 KUCOIN_API_KEY=your_kucoin_api_key110 KUCOIN_SECRET=your_kucoin_secret111 KUCOIN_PASSPHRASE=your_kucoin_passphrase112113 # Proxy configuration (optional)114 USE_PROXY=false115 PROXY_URL=http://username:password@your-proxy-server:port116 # Legacy format (still supported but recommended to use the integrated URL format above)117 # PROXY_USERNAME=118 # PROXY_PASSWORD=119 ```120121## Usage122123> **Note**: If you encounter any issues with MCP communication, please see the [Troubleshooting Guide](docs/troubleshooting.md) for solutions.124125### Running the Server126127Start the server:128129```bash130# If installed globally via npm131mcp-server-ccxt132133# If installed manually134npm start135```136137### Using with Claude for Desktop1381391. Add the server to your `claude_desktop_config.json`:140141If installed via npm (globally):142```json143{144 "mcpServers": {145 "ccxt": {146 "command": "mcp-server-ccxt"147 }148 }149}150```151152If installed manually:153```json154{155 "mcpServers": {156 "ccxt": {157 "command": "node",158 "args": [159 "/path/to/mcp-server-ccxt/build/index.js"160 ]161 }162 }163}164```1651662. Restart Claude for Desktop167168### Using as a Module in Another Project169170You can also use this package as a module in your own Node.js projects:171172```javascript173// Import the CCXT MCP Server174import '@mcpfun/mcp-server-ccxt';175176// The server starts automatically when imported177// You can configure it through environment variables178```179180## Example Queries181182Here are some example queries you can use with the MCP server:183184- "What's the current price of Bitcoin on Binance?"185- "Show me the order book for ETH/USDT on Coinbase"186- "Get the 1-hour OHLCV data for BTC/USDT on Binance for the last 24 candles"187- "Compare the price of SOL/USDT across different exchanges"188- "What's my current balance on Binance?" (requires API keys)189- "Place a market buy order for 0.1 ETH on Kraken" (requires API keys)190191## Available Tools192193### Public API Tools194195- `list-exchanges`: List all available cryptocurrency exchanges196- `get-ticker`: Get current ticker information for a trading pair197- `batch-get-tickers`: Get ticker information for multiple trading pairs at once198- `get-orderbook` / `get-order-book`: Get market order book for a trading pair199- `get-ohlcv`: Get OHLCV candlestick data for a trading pair200- `get-trades`: Get recent trades for a trading pair201- `get-markets`: Get all available markets for an exchange202- `get-exchange-info`: Get exchange information and status203- `get-leverage-tiers`: Get futures leverage tiers204- `get-funding-rates`: Get current funding rates205- `get-positions`: Get open positions information206- `get-open-orders`: Get all open orders207- `get-order-history`: Get order history208209### Private API Tools (requires API keys)210211- `account-balance`: Get your account balance from a crypto exchange212- `place-market-order`: Place a market order on an exchange213- `place-limit-order`: Place a limit order on an exchange214- `cancel-order`: Cancel an existing order215- `cancel-all-orders`: Cancel all open orders216- `set-leverage`: Set leverage for futures217- `set-margin-mode`: Set margin mode for futures218- `place-futures-market-order`: Place futures market orders219- `place-futures-limit-order`: Place futures limit orders220- `transfer-funds`: Transfer funds between accounts (e.g., spot to futures)221222### Configuration & Utility Tools223224- `cache-stats`: Get CCXT cache statistics225- `clear-cache`: Clear CCXT cache226- `set-log-level`: Set logging level227- `get-proxy-config`: Get proxy settings228- `set-proxy-config`: Configure proxy settings229- `set-market-type`: Set default market type230- `set-default-exchange`: Change the default exchange231- `system-info`: Get system and environment information232233## Performance Optimizations234235MCP-CCXT includes several optimizations to ensure high performance:2362371. **LRU Caching System**:238 - Different TTLs for different types of data239 - Ticker data: 10 seconds240 - Order book data: 5 seconds241 - Market data: 1 hour2422432. **Adaptive Rate Limiting**:244 - Automatically adjusts request rates based on exchange responses245 - Implements exponential backoff for errors246 - Manages concurrent requests per exchange2472483. **Exchange Connection Management**:249 - Efficient initialization of exchange instances250 - Proper error handling and retries251252## Security Best Practices253254### API Key Security2552561. **Create Dedicated API Keys**:257 - Create separate API keys for different applications/purposes258 - Never reuse API keys across different services or applications2592602. **Limit API Key Permissions**:261 - Enable only the permissions you need (e.g., read-only for market data)262 - Disable withdrawal permissions if you only need trading functionality263 - Use IP whitelisting when available to restrict access to known IPs2642653. **Secure Storage**:266 - Never commit API keys to version control systems267 - Store API keys in environment variables or a secure vault268 - Use `.env` files that are excluded from git via `.gitignore`269270## Risk Disclaimer271272This software is provided for informational purposes only. Using this software to interact with cryptocurrency exchanges involves significant risks:273274- **Financial Risk**: Cryptocurrency trading involves risk of loss275- **API Security**: Ensure your API keys have appropriate permission limits276- **No Investment Advice**: This tool does not provide investment advice277- **No Warranty**: The software is provided "as is" without warranty of any kind278279## License280281This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.282283## Copyright and Attribution284285This project uses the CCXT library (https://github.com/ccxt/ccxt), which is:286287```288Copyright (c) 2016-2024 CCXT developers289```290291CCXT is released under the MIT License, which is included below:292293```294Permission is hereby granted, free of charge, to any person obtaining a copy295of this software and associated documentation files (the "Software"), to deal296in the Software without restriction, including without limitation the rights297to use, copy, modify, merge, publish, distribute, sublicense, and/or sell298copies of the Software, and to permit persons to whom the Software is299furnished to do so, subject to the following conditions:300301The above copyright notice and this permission notice shall be included in all302copies or substantial portions of the Software.303304THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR305IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,306FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE307AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER308LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,309OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE310SOFTWARE.311```312313---314315For issues, feature requests, or contributions, please visit [the GitHub repository](https://github.com/doggybee/mcp-server-ccxt).
Full transparency โ inspect the skill content before installing.