Skip to content

Latest commit

Β 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

README.md

Binance MCP Server

A comprehensive Model Context Protocol (MCP) server for the Binance.com global exchange API.

Overview

This MCP server provides 156+ tools covering the full Binance.com API including:

  • Spot Trading - Market data, orders, account info
  • Wallet - Deposits, withdrawals, transfers
  • Staking - ETH & SOL staking operations
  • Simple Earn - Flexible/locked products
  • Convert - Asset conversion
  • Mining - Pool mining operations
  • Algo Trading - TWAP, VP algorithms
  • VIP Loan - Institutional lending
  • NFT - NFT transactions
  • Pay - Binance Pay
  • Copy Trading - Lead trader features
  • Dual Investment - Structured products
  • C2C/P2P - Peer-to-peer trading
  • Fiat - Fiat deposit/withdrawal
  • Rebate - Referral rebates

Installation

cd binance-mcp-server
npm install

Configuration

Create a .env file or set environment variables:

BINANCE_API_KEY=your_api_key
BINANCE_API_SECRET=your_api_secret

Usage

STDIO Transport (Claude Desktop, Cursor)

npm run start
# or
npx ts-node src/index.ts

SSE Transport (ChatGPT, Web Apps)

npm run start:sse
# or
npx ts-node src/index.ts --sse

Project Structure

binance-mcp-server/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts              # Entry point
β”‚   β”œβ”€β”€ binance.ts            # Module registration
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ binanceClient.ts  # API client with signing
β”‚   β”‚   └── client.ts         # HTTP client
β”‚   β”œβ”€β”€ server/
β”‚   β”‚   β”œβ”€β”€ base.ts           # Base server setup
β”‚   β”‚   β”œβ”€β”€ stdio.ts          # STDIO transport
β”‚   β”‚   └── sse.ts            # SSE transport
β”‚   β”œβ”€β”€ modules/              # All API modules
β”‚   β”‚   β”œβ”€β”€ spot/
β”‚   β”‚   β”‚   β”œβ”€β”€ general-api/
β”‚   β”‚   β”‚   β”œβ”€β”€ market-api/
β”‚   β”‚   β”‚   β”œβ”€β”€ trade-api/
β”‚   β”‚   β”‚   β”œβ”€β”€ account-api/
β”‚   β”‚   β”‚   └── userdatastream-api/
β”‚   β”‚   β”œβ”€β”€ wallet/
β”‚   β”‚   β”œβ”€β”€ staking/
β”‚   β”‚   β”œβ”€β”€ simple-earn/
β”‚   β”‚   β”œβ”€β”€ convert/
β”‚   β”‚   β”œβ”€β”€ mining/
β”‚   β”‚   β”œβ”€β”€ algo/
β”‚   β”‚   β”œβ”€β”€ vip-loan/
β”‚   β”‚   β”œβ”€β”€ nft/
β”‚   β”‚   β”œβ”€β”€ pay/
β”‚   β”‚   β”œβ”€β”€ copy-trading/
β”‚   β”‚   β”œβ”€β”€ dual-investment/
β”‚   β”‚   β”œβ”€β”€ c2c/
β”‚   β”‚   β”œβ”€β”€ fiat/
β”‚   β”‚   └── rebate/
β”‚   └── utils/
β”‚       └── logger.ts
β”œβ”€β”€ tools/                    # Legacy tools (preserved)
β”œβ”€β”€ package.json
└── tsconfig.json

Module Coverage

Module Tools Completeness
Wallet 40 70%
Spot 32 60%
Staking 22 80%
Mining 13 90%
Algo 11 50%
VIP Loan 9 70%
Convert 9 80%
Dual Investment 5 50%
Simple Earn 4 30%
NFT 4 60%
Fiat 2 50%
Copy Trading 2 20%
Rebate 1 30%
Pay 1 10%
C2C 1 10%

Total: ~156 tools

Missing APIs

See API_COVERAGE_SUMMARY.md for detailed gap analysis.

Major missing features:

  • Margin Trading (Cross & Isolated)
  • Futures Trading (USD-M & COIN-M)
  • Options Trading
  • Portfolio Margin
  • Auto-Invest
  • Crypto Loans
  • Sub-Account Management
  • Gift Card

Claude Desktop Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "binance": {
      "command": "npx",
      "args": ["ts-node", "/path/to/binance-mcp-server/src/index.ts"],
      "env": {
        "BINANCE_API_KEY": "your_key",
        "BINANCE_API_SECRET": "your_secret"
      }
    }
  }
}

Example Tools

Get Account Info

Tool: binance_account_info

Place Spot Order

Tool: binance_spot_new_order
Parameters:
  - symbol: "BTCUSDT"
  - side: "BUY"
  - type: "LIMIT"
  - quantity: 0.001
  - price: 50000
  - timeInForce: "GTC"

Get Order Book

Tool: binance_order_book
Parameters:
  - symbol: "BTCUSDT"
  - limit: 100

Development

Build

npm run build

Type Check

npx tsc --noEmit

Add New Tool

  1. Create file in appropriate module folder
  2. Export registration function
  3. Import in module's index.ts
  4. Register in src/binance.ts

API Documentation

License

MIT