CCXT logo

CCXT

Community
doggybee

High-performance CCXT MCP server for cryptocurrency exchange integration

Publisherdoggybee
Repositorymcp-server-ccxt
LanguageTypeScript
Forks
31
Stars
137
Available tools
24
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    CCXT exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 24 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    137 stars and 31 forks from the linked repository.

CCXT MCP Server

Version MCP Standard CCXT smithery badge

High-performance cryptocurrency exchange integration using MCP (Model Context Protocol) and CCXT.

Features

  • 🚀 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 like Claude and GPT via MCP

CCXT MCP Server Integration Architecture

CCXT MCP Server Integration Architecture

The 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.

The architecture includes:

  • LLM clients (Claude and other MCP-compatible models) that send requests
  • The Model Context Protocol (MCP) that standardizes communication
  • The CCXT MCP Server that processes requests and manages exchange interactions
  • The CCXT Library that provides unified access to exchange APIs
  • Connections to multiple cryptocurrency exchanges

CCXT MCP Server Code Architecture

CCXT MCP Server Code Architecture

The server is organized into three main modules for better maintainability and extensibility:

  • Exchange: Manages exchange instances, credentials, and symbol validation
  • Utils: Provides caching, rate limiting, and logging functionality
  • Tools: Implements MCP tools and resources for exchange interaction

Quick Start

Installing via Smithery

To install mcp-server-ccxt for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @doggybee/mcp-server-ccxt --client claude

NPM Package (Recommended)

You can install CCXT MCP Server from npm:

bash
# Install globally
npm install -g @mcpfun/mcp-server-ccxt

# Start the server
mcp-server-ccxt

Or run directly:

bash
npx @mcpfun/mcp-server-ccxt

Manual Installation

Alternatively, you can clone and build the repository:

bash
# Clone the repository
git clone https://github.com/doggybee/mcp-server-ccxt.git
cd mcp-server-ccxt

# Install dependencies
npm install

# Build the server
npm run build

# Start the server
npm start

Configuration

  1. Create an environment file

    bash
    cp .env.example .env
  2. Edit the .env file to add your exchange API keys

    # Default exchange (optional)
    DEFAULT_EXCHANGE=binance
    
    # Default market type (optional)
    DEFAULT_MARKET_TYPE=spot 
    
    # API credentials (optional)
    BINANCE_API_KEY=your_api_key
    BINANCE_SECRET=your_api_secret
    # For exchanges requiring passphrase (e.g., KuCoin)
    KUCOIN_API_KEY=your_kucoin_api_key
    KUCOIN_SECRET=your_kucoin_secret
    KUCOIN_PASSPHRASE=your_kucoin_passphrase
    
    # Proxy configuration (optional)
    USE_PROXY=false
    PROXY_URL=http://username:password@your-proxy-server:port
    # Legacy format (still supported but recommended to use the integrated URL format above)
    # PROXY_USERNAME=
    # PROXY_PASSWORD=

Usage

Note: If you encounter any issues with MCP communication, please see the Troubleshooting Guide for solutions.

Running the Server

Start the server:

bash
# If installed globally via npm
mcp-server-ccxt

# If installed manually
npm start

Using with Claude for Desktop

  1. Add the server to your claude_desktop_config.json:

If installed via npm (globally):

json
{
  "mcpServers": {
    "ccxt": {
      "command": "mcp-server-ccxt"
    }
  }
}

If installed manually:

json
{
  "mcpServers": {
    "ccxt": {
      "command": "node",
      "args": [
        "/path/to/mcp-server-ccxt/build/index.js"
      ]
    }
  }
}
  1. Restart Claude for Desktop

Using as a Module in Another Project

You can also use this package as a module in your own Node.js projects:

javascript
// Import the CCXT MCP Server
import '@mcpfun/mcp-server-ccxt';

// The server starts automatically when imported
// You can configure it through environment variables

Example Queries

Here are some example queries you can use with the MCP server:

  • "What's the current price of Bitcoin on Binance?"
  • "Show me the order book for ETH/USDT on Coinbase"
  • "Get the 1-hour OHLCV data for BTC/USDT on Binance for the last 24 candles"
  • "Compare the price of SOL/USDT across different exchanges"
  • "What's my current balance on Binance?" (requires API keys)
  • "Place a market buy order for 0.1 ETH on Kraken" (requires API keys)

Available Tools

Public API Tools

  • list-exchanges: List all available cryptocurrency exchanges
  • get-ticker: Get current ticker information for a trading pair
  • batch-get-tickers: Get ticker information for multiple trading pairs at once
  • get-orderbook / get-order-book: Get market order book for a trading pair
  • get-ohlcv: Get OHLCV candlestick data for a trading pair
  • get-trades: Get recent trades for a trading pair
  • get-markets: Get all available markets for an exchange
  • get-exchange-info: Get exchange information and status
  • get-leverage-tiers: Get futures leverage tiers
  • get-funding-rates: Get current funding rates
  • get-positions: Get open positions information
  • get-open-orders: Get all open orders
  • get-order-history: Get order history

Private API Tools (requires API keys)

  • account-balance: Get your account balance from a crypto exchange
  • place-market-order: Place a market order on an exchange
  • place-limit-order: Place a limit order on an exchange
  • cancel-order: Cancel an existing order
  • cancel-all-orders: Cancel all open orders
  • set-leverage: Set leverage for futures
  • set-margin-mode: Set margin mode for futures
  • place-futures-market-order: Place futures market orders
  • place-futures-limit-order: Place futures limit orders
  • transfer-funds: Transfer funds between accounts (e.g., spot to futures)

Configuration & Utility Tools

  • cache-stats: Get CCXT cache statistics
  • clear-cache: Clear CCXT cache
  • set-log-level: Set logging level
  • get-proxy-config: Get proxy settings
  • set-proxy-config: Configure proxy settings
  • set-market-type: Set default market type
  • set-default-exchange: Change the default exchange
  • system-info: Get system and environment information

Performance Optimizations

MCP-CCXT includes several optimizations to ensure high performance:

  1. LRU Caching System:

    • Different TTLs for different types of data
    • Ticker data: 10 seconds
    • Order book data: 5 seconds
    • Market data: 1 hour
  2. Adaptive Rate Limiting:

    • Automatically adjusts request rates based on exchange responses
    • Implements exponential backoff for errors
    • Manages concurrent requests per exchange
  3. Exchange Connection Management:

    • Efficient initialization of exchange instances
    • Proper error handling and retries

Security Best Practices

API Key Security

  1. Create Dedicated API Keys:

    • Create separate API keys for different applications/purposes
    • Never reuse API keys across different services or applications
  2. Limit API Key Permissions:

    • Enable only the permissions you need (e.g., read-only for market data)
    • Disable withdrawal permissions if you only need trading functionality
    • Use IP whitelisting when available to restrict access to known IPs
  3. Secure Storage:

    • Never commit API keys to version control systems
    • Store API keys in environment variables or a secure vault
    • Use .env files that are excluded from git via .gitignore

Risk Disclaimer

This software is provided for informational purposes only. Using this software to interact with cryptocurrency exchanges involves significant risks:

  • Financial Risk: Cryptocurrency trading involves risk of loss
  • API Security: Ensure your API keys have appropriate permission limits
  • No Investment Advice: This tool does not provide investment advice
  • No Warranty: The software is provided "as is" without warranty of any kind

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Copyright and Attribution

This project uses the CCXT library (https://github.com/ccxt/ccxt), which is:

Copyright (c) 2016-2024 CCXT developers

CCXT is released under the MIT License, which is included below:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

For issues, feature requests, or contributions, please visit the GitHub repository.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "ccxt": {
      "command": "npx",
      "args": [
        "-y",
        "@mcpfun/mcp-server-ccxt"
      ]
    }
  }
}

Available Tools

  • cache-stats

    Get CCXT cache statistics

  • clear-cache

    Clear CCXT cache

  • set-log-level

    Set logging level

  • list-exchanges

    List all available cryptocurrency exchanges

  • get-ticker

    Get current ticker information for a trading pair

  • batch-get-tickers

    Get ticker information for multiple trading pairs at once

  • get-orderbook

    Get market order book for a trading pair

  • get-ohlcv

    Get OHLCV candlestick data for a trading pair

  • get-trades

    Get recent trades for a trading pair

  • get-markets

    Get all available markets for an exchange

  • get-exchange-info

    Get exchange information and status

  • get-leverage-tiers

    Get futures leverage tiers for trading pairs

  • get-funding-rates

    Get current funding rates for perpetual contracts

  • get-market-types

    Get market types supported by an exchange

  • account-balance

    Get your account balance from a crypto exchange

  • place-market-order

    Place a market order on an exchange

  • set-leverage

    Set leverage for futures trading

  • set-margin-mode

    Set margin mode for futures trading

  • place-futures-market-order

    Place a futures market order

  • get-proxy-config

    Get the current proxy configuration

  • set-proxy-config

    Configure proxy settings for all exchanges

  • test-proxy-connection

    Test the proxy connection with a specified exchange

  • clear-exchange-cache

    Clear exchange instance cache to apply configuration changes

  • set-market-type

    Set default market type for all exchanges

Use CCXT MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once CCXT is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add CCXT as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the CCXT MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "ccxt": {
      "command": "npx",
      "args": [
        "-y",
        "@mcpfun/mcp-server-ccxt"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the CCXT MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the CCXT MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use CCXT to help me with this task?
CCXT
Sure. I read it.
Here is what I found using CCXT.

Option 2: Add an MCP server URL

Use this when CCXT is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter your server URL in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste your server URL into the Server URL field.
  2. Enter a connection name for CCXT.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the CCXT connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the CCXT tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the CCXT tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use CCXT to help me with this task?
CCXT
Sure. I read it.
Here is what I found using CCXT.

Frequently asked questions

What is the CCXT MCP server used for?

CCXT is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use CCXT MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use CCXT with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use CCXT MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With CCXT connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect CCXT MCP to TypingMind?

CCXT can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does CCXT MCP provide in TypingMind?

CCXT exposes 24 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use CCXT MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If CCXT requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇