CCXT MCP Server bridges the gap between AI models and cryptocurrency trading by providing a standardized interface through the Model Context Protocol. Created to empower automated trading strategies, this tool allows AI assistants like Claude and GPT to directly interact with over 100 cryptocurrency exchanges without requiring users to write comple
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.
# Install the package globally
npm install -g @lazydino/ccxt-mcp
# Run with default settings
ccxt-mcp
# or run without installation
npx @lazydino/ccxt-mcp
# Install the package globally
npm install -g @lazydino/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
View help:
npx @lazydino/ccxt-mcp --help
Open Claude Desktop Settings:
Add a New MCP Server:
ccxt-mcp
npx @lazydino/ccxt-mcp
--config /path/to/config.json
Save and Test the Server:
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.
To separate account information into a separate configuration file, set up as follows:
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
accounts
array at the root level, as shown above.
{
"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
--config
option, the server will look for theaccounts
array directly in the root of the JSON file, not inmcpServers.ccxt-mcp.accounts
path.
# 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
Market Information Retrieval:
Trading Functions:
Trading Analysis:
Position Management:
Risk Management:
User <--> AI Model(Claude/GPT) <--> MCP Protocol <--> CCXT MCP Server <--> Cryptocurrency Exchange API
When registered with Claude Desktop, you can make the following types of requests to AI models:
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:
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.
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.
# 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
Contributions are welcome! Please feel free to submit a Pull Request.
Distributed under the MIT License. See the LICENSE file for more information.
If you find this project useful, please consider giving it a ⭐️ on GitHub!
{ "mcpServers": { "ccxt-mcp": { "command": "npx", "args": [ "-y", "@lazydino/ccxt-mcp" ] } } }
Related projects feature coming soon
Will recommend related projects based on sub-categories