Binance Futures MCP server

Integrates with Binance Futures API to provide real-time market data access and account management functionality for cryptocurrency trading applications.
Back to servers
Setup instructions
Provider
alexcandrabersiva
Release date
Jul 02, 2025
Stats
1 star

This MCP server provides comprehensive access to Binance Futures API endpoints, implementing all major trading, account management, and market data functionality. It allows you to interact with Binance Futures directly from your MCP-enabled applications.

Installation

PyPI Installation (Recommended)

Install the package from PyPI:

pip install binance_futures_mcp

Docker Deployment

For containerized deployment:

# Clone the repository
git clone https://github.com/alexcandrabersiva/bin-mcp.git
cd binance-mcp-server

# Build the Docker image
docker build -t binance-mcp-server .

# Run with environment variables
docker run -e BINANCE_API_KEY="your_api_key" -e BINANCE_SECRET_KEY="your_secret_key" \
  binance-mcp-server --binance-api-key "$BINANCE_API_KEY" --binance-secret-key "$BINANCE_SECRET_KEY"

Docker Compose (Optional)

Create a docker-compose.yml:

version: '3.8'
services:
  binance-mcp:
    build: .
    environment:
      - BINANCE_API_KEY=${BINANCE_API_KEY}
      - BINANCE_SECRET_KEY=${BINANCE_SECRET_KEY}
    command: [
      "--binance-api-key", "${BINANCE_API_KEY}",
      "--binance-secret-key", "${BINANCE_SECRET_KEY}"
    ]

Then run:

docker-compose up

Configuration

API Requirements

Your Binance API key needs the following permissions:

  • Futures Trading: For order placement and management
  • Futures Reading: For account and market data access

MCP Client Setup

This server can be integrated with various MCP clients. Here are configuration examples:

VS Code

Add to your VS Code settings.json:

{
  "mcp": {
    "servers": {
      "binance": {
        "command": "uvx",
        "args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
      }
    }
  }
}

Cursor

Add to your Cursor configuration file (.cursor/mcp.json):

{
  "servers": {
    "binance": {
      "command": "uvx", 
      "args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
    }
  }
}

Windsurf

Add to your Windsurf configuration (.windsurf/mcp.json):

{
  "mcpServers": {
    "binance": {
      "command": "uvx",
      "args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
    }
  }
}

Claude Desktop

Add to your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "binance": {
      "command": "uvx",
      "args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
    }
  }
}

Configuration Notes

  1. No path needed: With PyPI installation, you don't need to specify paths or working directories
  2. Set API credentials: Replace your_api_key and your_secret_key with your actual Binance API credentials
  3. Alternative commands: You can also use uvx binance_futures_mcp or python -m binance_mcp
  4. Security: For production use, consider storing credentials in environment variables

Available Tools

The server provides 11 essential tools organized into the following categories:

Account Information

  • get_account_info - Get account information
  • get_balance - Get account balance
  • get_position_info - Get position information
  • get_position_mode - Get position mode (Hedge vs. One-way)
  • get_commission_rate - Get commission rate

Market Data

  • get_exchange_info - Get exchange trading rules
  • get_book_ticker - Get best price/qty on the order book
  • get_price_ticker - Get latest price for a symbol
  • get_order_book - Get order book depth
  • get_klines - Get candlestick data
  • get_mark_price - Get mark price and funding rate

Example Usage

Place a Market Order

{
  "tool": "place_order",
  "arguments": {
    "symbol": "BTCUSDT",
    "side": "BUY",
    "order_type": "MARKET",
    "quantity": 0.001
  }
}

Place a Limit Order

{
  "tool": "place_order",
  "arguments": {
    "symbol": "BTCUSDT",
    "side": "BUY",
    "order_type": "LIMIT",
    "quantity": 0.001,
    "price": 50000.0,
    "time_in_force": "GTC"
  }
}

Get Account Information

{
  "tool": "get_account_info",
  "arguments": {}
}

Get Market Data

{
  "tool": "get_klines",
  "arguments": {
    "symbol": "BTCUSDT",
    "interval": "1h",
    "limit": 100
  }
}

Get 24hr Price Statistics

{
  "tool": "get_24hr_ticker",
  "arguments": {
    "symbol": "BTCUSDT"
  }
}

Get Taker Buy/Sell Volume Ratio

{
  "tool": "get_taker_buy_sell_volume",
  "arguments": {
    "symbol": "BTCUSDT"
  }
}

Security

API Key Security

Your Binance API key and secret remain completely local to your computer. The MCP server runs entirely on your machine; neither the package author nor any third-party remote service can access your credentials.

Key Security Points:

  • Store credentials in environment variables (recommended) or local config files
  • Keys are never transmitted unless you publish them
  • Never commit credentials to version control
  • Never share screenshots/logs containing credentials
  • Use API keys with minimal required permissions
  • IP-whitelist your keys when possible
  • Consider using Binance Testnet for development

Rate Limiting & Error Handling

  • Respects Binance's weight-based rate limits
  • Automatic order placement rate limiting
  • Automatic HMAC SHA256 signature generation
  • Comprehensive error handling with clear messages
  • Parameter validation before API calls

API Reference

This server implements all endpoints documented in the Binance Futures API:

  • Base URL: https://fapi.binance.com
  • API Type: Binance USD-S Margined Futures
  • Authentication: API Key + HMAC SHA256 Signature
  • Rate Limits: Respected automatically

For detailed parameter specifications, see the Binance Futures API Documentation.

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 "binance" '{"command":"uvx","args":["--from","binance_futures_mcp","binance-mcp-server.exe","--binance-api-key","your_api_key","--binance-secret-key","your_secret_key"]}'

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": {
        "binance": {
            "command": "uvx",
            "args": [
                "--from",
                "binance_futures_mcp",
                "binance-mcp-server.exe",
                "--binance-api-key",
                "your_api_key",
                "--binance-secret-key",
                "your_secret_key"
            ]
        }
    }
}

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": {
        "binance": {
            "command": "uvx",
            "args": [
                "--from",
                "binance_futures_mcp",
                "binance-mcp-server.exe",
                "--binance-api-key",
                "your_api_key",
                "--binance-secret-key",
                "your_secret_key"
            ]
        }
    }
}

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