The CCXT MCP Server allows AI models to interact with cryptocurrency exchange APIs through the Model Context Protocol (MCP). It leverages the CCXT library to provide access to over 100 cryptocurrency exchanges and their trading capabilities, enabling AI-powered cryptocurrency market analysis and trading.
# Install the package globally
npm install -g @lazydino/ccxt-mcp
# Run with default settings
ccxt-mcp
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
To view help:
npx @lazydino/ccxt-mcp --help
Open Claude Desktop Settings:
Add a New MCP Server:
Save and Test the Server:
This basic method includes CCXT account information directly in the Claude Desktop settings file:
{
"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"
}
]
}
}
}
For better security and organization, use a separate configuration file:
{
"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"
}
]
}
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": [
"-y",
"@lazydino/ccxt-mcp",
"--config",
"/path/to/ccxt-accounts.json"
]
}
}
}
This approach offers better security, prevents recursive reference issues, and improves configuration management.
Check and compare the current Bitcoin price on binance and coinbase.
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.
When using AI models, consider using this prompt format:
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
This helps prevent confusion between futures and spot trading and ensures clear communication about capital allocation.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "ccxt-mcp" '{"command":"npx","args":["-y","@lazydino/ccxt-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": [
"-y",
"@lazydino/ccxt-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": [
"-y",
"@lazydino/ccxt-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect