
CCXT Crypto Trading
Connects AI models to 100+ cryptocurrency exchanges using the CCXT library for market data retrieval and trading operations through natural language commands.
Bridges the CCXT cryptocurrency trading library with natural language interfaces, enabling monitoring, analysis, and trading operations across 100+ exchanges
What it does
- Fetch real-time ticker prices and market data
- Retrieve order books and recent trades
- Download OHLCV candlestick data for analysis
- Create and cancel trading orders
- Monitor open orders across exchanges
- Query available markets and trading pairs
Best for
About CCXT Crypto Trading
CCXT Crypto Trading is a community-built MCP server published by lazy-dinosaur that provides AI assistants with tools and capabilities via the Model Context Protocol. Trade crypto easily with CCXT Crypto Trading bot. Monitor, analyze, and execute trades across 100+ exchanges with this c It is categorized under finance, analytics data. This server exposes 20 tools that AI clients can invoke during conversations and coding sessions.
How to install
You can install CCXT Crypto Trading in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
CCXT Crypto Trading is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Tools (20)
Fetch markets from a cryptocurrency exchange
Fetch ticker information for a symbol on an exchange
Fetch all tickers from an exchange
Fetch order book for a symbol on an exchange
Fetch recent trades for a symbol on an exchange
CCXT MCP Server
CCXT MCP Server is a server that allows AI models to interact with cryptocurrency exchange APIs through the Model Context Protocol (MCP). This server uses the CCXT library to provide access to more than 100 cryptocurrency exchanges and their trading capabilities.
🚀 Quick Start
# Install the package globally
npm install -g @lazydino/ccxt-mcp
# Run with default settings
ccxt-mcp
# or run without installation
npx @lazydino/ccxt-mcp
Installation and Usage
Global Installation
# Install the package globally
npm install -g @lazydino/ccxt-mcp
Running with npx
You can run it directly without installation:
# Using default settings
npx @lazydino/ccxt-mcp
# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/config.json
View help:
npx @lazydino/ccxt-mcp --help
Configuration
Registering the MCP Server in Claude Desktop
-
Open Claude Desktop Settings:
- Go to the Settings menu in the Claude Desktop app
- Find the "MCP Servers" section
-
Add a New MCP Server:
- Click the "Add Server" button
- Server name:
ccxt-mcp - Command:
npx @lazydino/ccxt-mcp - Additional arguments (optional):
--config /path/to/config.json
-
Save and Test the Server:
- Save the settings
- Test the connection with the "Test Connection" button
Configuration Methods - Two Options
Option 1: Include Account Information Directly in Claude Desktop Settings (Basic Method)
This method includes CCXT account information directly in the Claude Desktop settings file (claude_desktop_config.json):
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": ["-y", "@lazydino/ccxt-mcp"],
"accounts": [
{
"name": "bybit_main",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "spot"
},
{
"name": "bybit_futures",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "swap"
}
]
}
}
}
Using this method, you don't need a separate configuration file. All settings are integrated into the Claude Desktop configuration file.
Option 2: Using a Separate Configuration File (Advanced Method)
To separate account information into a separate configuration file, set up as follows:
- Create a Separate Configuration File (e.g.,
ccxt-accounts.json):
{
"accounts": [
{
"name": "bybit_main",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "spot"
},
{
"name": "bybit_futures",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "swap"
}
]
}
Important: The configuration file must contain an
accountsarray at the root level, as shown above.
- Specify the Configuration File Path in Claude Desktop Settings:
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": [
"-y",
"@lazydino/ccxt-mcp",
"--config",
"/path/to/ccxt-accounts.json"
]
}
}
}
Note: When using a separate configuration file with the
--configoption, the server will look for theaccountsarray directly in the root of the JSON file, not inmcpServers.ccxt-mcp.accountspath.
- Running with External Configuration File from Command Line:
# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/ccxt-accounts.json
You can find an example configuration file at examples/config-example.json in the repository.
Reasons to Use a Separate Configuration File:
- Prevents recursive reference issues
- Separates sensitive information like API keys
- Easier multi-environment configuration (development, testing, production)
- Improved configuration file version control
Key Features
-
Market Information Retrieval:
- List exchanges
- View market information by exchange
- Get price information for specific symbols
- View order book information for specific symbols
- Search historical OHLCV data
-
Trading Functions:
- Create market/limit orders
- Cancel orders and check status
- View account balances
- Check trading history
-
Trading Analysis:
- Daily/weekly/monthly performance analysis
- Win rate calculation (last 7 days, 30 days, all time)
- Average profit/loss ratio (R-multiple)
- Maximum consecutive loss/profit series analysis
- Asset variation tracking
- Comprehensive performance metrics
- Trade pattern recognition
- Period-based return calculations
-
Position Management:
- Capital ratio trading (e.g., enter with 5% of account capital)
- Futures market leverage setting (1-100x)
- Dynamic position sizing (volatility-based)
- Split buy/sell strategy implementation
-
Risk Management:
- Technical indicator-based stop loss setting (e.g., lowest point among 10 candles on 5-minute chart)
- Volatility-based stop loss/take profit (ATR multiples)
- Maximum allowable loss limit (daily/weekly)
- Dynamic take profit setting (trailing profit)
How It Works
User <--> AI Model(Claude/GPT) <--> MCP Protocol <--> CCXT MCP Server <--> Cryptocurrency Exchange API
- User: Requests like "Tell me the Bitcoin price" or "Buy Ethereum on my Binance account"
- AI Model: Understands user requests and determines which MCP tools/resources to use
- MCP Protocol: Standardized communication between AI and CCXT MCP server
- CCXT MCP Server: Communicates with cryptocurrency exchange APIs using the CCXT library
- Exchange API: Provides actual data and executes trade orders
Using with AI Models
When registered with Claude Desktop, you can make the following types of requests to AI models:
Cautions and Recommended Prompts
When using AI models, consider the following cautions and use the prompt below for effective trading:
Your goal is to execute trades using the ccxt tools as much as possible
Cautions:
- Accurately identify whether it's a futures market or spot market before proceeding with trades
- If there's no instruction about percentage of capital or amount to use, always calculate and execute trades using the entire available capital
Notes:
- AI models sometimes confuse futures trading with spot trading.
- Without clear guidance on trading capital size, AI might get confused.
- Using the above prompt helps clearly communicate your trading intentions.
Basic Query Examples
Check and compare the current Bitcoin price on binance and coinbase.
Advanced Trading Query Examples
Position Management
Open a long position on BTC/USDT futures market in my Bybit account (bybit_futures) with 5% of capital using 10x leverage.
Enter based on moving average crossover strategy and set stop loss at the lowest point among the 12 most recent 5-minute candles.
Performance Analysis
Analyze my Binance account (bybit_main) trading records for the last 7 days and show me the win rate, average profit, and maximum consecutive losses.
Detailed Trading Analytics
Analyze my trading performance on the bybit_futures account for BTC/USDT over the last 30 days. Calculate win rate, profit factor, and identify any patterns in my winning trades.
Show me the monthly returns for my bybit_main account over the past 90 days and identify my best and worst trading months.
Analyze my consecutive wins and losses on my bybit_futures account and tell me if I have any psychological patterns affecting my trading after losses.
Development
Building from Source
# Clone repository
git clone https://github.com/lazy-dinosaur/ccxt-mcp.git
# Navigate to project directory
cd ccxt-mcp
# Install dependencies
npm install
# Build
npm run build
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
Distributed under the MIT License. See the LICENSE file for more information.
❤️ Support
If you find this project useful, please consider giving it a ⭐️ on GitHub!
Alternatives
Related Skills
Browse all skillsCCXT cryptocurrency exchange library for PHP developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in PHP 8.1+. Use when working with crypto exchanges in PHP projects, trading bots, or web applications. Supports both sync and async (ReactPHP) usage.
CCXT cryptocurrency exchange library for Go developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Go projects. Use when working with crypto exchanges in Go applications, microservices, or trading systems.
CCXT cryptocurrency exchange library for Python developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Python. Use when working with crypto exchanges in Python projects, trading bots, data analysis, or portfolio management. Supports both sync and async (asyncio) usage.
CCXT cryptocurrency exchange library for C# and .NET developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in .NET projects. Use when working with crypto exchanges in C# applications, trading systems, or financial software. Supports .NET Standard 2.0+.
CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.
No API KEY needed for free tier. Professional-grade cryptocurrency market data integration for real-time prices, historical charts, and global analytics.