CCXT Crypto Trading MCP server

Bridges the CCXT cryptocurrency trading library with natural language interfaces, enabling monitoring, analysis, and trading operations across 100+ exchanges
Back to servers
Setup instructions
Provider
LazyDino
Release date
Mar 29, 2025
Language
TypeScript
Package
Stats
3.2K downloads
56 stars

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.

Getting Started

Global Installation

# Install the package globally
npm install -g @lazydino/ccxt-mcp

# Run with default settings
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

To view help:

npx @lazydino/ccxt-mcp --help

Configuring the Server

Registering with Claude Desktop

  1. Open Claude Desktop Settings:

    • Go to the Settings menu in the Claude Desktop app
    • Find the "MCP Servers" section
  2. 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
  3. Save and Test the Server:

    • Save the settings
    • Test the connection with the "Test Connection" button

Configuration Methods

Option 1: Include Account Information in Claude Desktop Settings

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"
        }
      ]
    }
  }
}

Option 2: Using a Separate Configuration File

For better security and organization, use a separate configuration file:

  1. Create a 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"
    }
  ]
}
  1. 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"
      ]
    }
  }
}

This approach offers better security, prevents recursive reference issues, and improves configuration management.

Features

Market Information Retrieval

  • List available exchanges
  • View market information by exchange
  • Get price information for specific symbols
  • View order book information
  • 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

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
  • Volatility-based stop loss/take profit (ATR multiples)
  • Maximum allowable loss limit (daily/weekly)
  • Dynamic take profit setting (trailing profit)

Using with AI Models

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.

Recommended Prompt Format

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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later