Crypto Trading MCP server

Provides a bridge to multiple cryptocurrency exchanges (Upbit, Gate.io, and Binance) for spot trading operations, market data retrieval, and portfolio management across different platforms.
Back to servers
Setup instructions
Provider
vkdnjznd
Release date
Apr 20, 2025
Language
Python
Stats
4 stars

Crypto Trading MCP is a Model Context Protocol server that enables price lookup and trading functionality across multiple cryptocurrency exchanges. It provides a standardized interface to interact with various exchanges through a simple API, currently supporting Upbit, Gate.io, and Binance for spot trading.

Installation Requirements

  • Python 3.10 or higher

Setting Up Authentication

Before using the server, you need to configure authentication information for each exchange you plan to use. Set the required environment variables for your exchanges:

Upbit Authentication

export UPBIT_ACCESS_KEY="your-access-key"
export UPBIT_SECRET_KEY="your-secret-key"

Gate.io Authentication

export GATE_API_KEY="your-api-key"
export GATE_API_SECRET="your-api-secret"

Binance Authentication

export BINANCE_API_KEY="your-api-key"
export BINANCE_API_SECRET="your-api-secret"

Starting the MCP Server

To start the MCP server:

python -m crypto_trading_mcp.server

By default, the server runs on port 8000. You can specify a different port using the --port option:

python -m crypto_trading_mcp.server --port 9000

Using the MCP API

Once the server is running, you can interact with it using HTTP requests. Here are common operations:

Getting Price Information

Retrieve current price for a specific trading pair:

curl "http://localhost:8000/price?exchange=binance&symbol=BTC-USDT"

Placing Orders

Place a limit buy order:

curl -X POST "http://localhost:8000/order" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange": "binance",
    "symbol": "BTC-USDT",
    "side": "buy",
    "type": "limit",
    "price": "30000",
    "amount": "0.001"
  }'

Place a market sell order:

curl -X POST "http://localhost:8000/order" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange": "upbit",
    "symbol": "BTC-KRW",
    "side": "sell",
    "type": "market",
    "amount": "0.001"
  }'

Checking Order Status

Get the status of a specific order:

curl "http://localhost:8000/order/status?exchange=binance&order_id=123456789"

Getting Account Balance

Retrieve account balance for a specific exchange:

curl "http://localhost:8000/balance?exchange=upbit"

Supported Exchange Parameters

When making API requests, use the following exchange identifiers:

  • upbit - Upbit exchange
  • gate - Gate.io exchange
  • binance - Binance exchange

For trading pairs, use the format specific to each exchange:

  • Upbit: BTC-KRW, ETH-KRW
  • Gate.io: BTC_USDT, ETH_USDT
  • Binance: BTCUSDT, ETHUSDT

The MCP server will automatically convert these formats as needed for consistent handling across exchanges.

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 "crypto-trading" '{"command":"python","args":["-m","crypto_trading_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": {
        "crypto-trading": {
            "command": "python",
            "args": [
                "-m",
                "crypto_trading_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": {
        "crypto-trading": {
            "command": "python",
            "args": [
                "-m",
                "crypto_trading_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