muvon/mcp-binance-futures

💰 Finance & Fintech
0 Views
0 Installs

🐍 ☁️ - MCP server for Binance USDT-M Futures trading — exposes tools for market data, account state, order management, and position/margin control.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "muvon-mcp-binance-futures": {
      "command": "npx",
      "args": [
        "-y",
        "muvon-mcp-binance-futures"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

mcp-binance-futures

MCP server for Binance USDT-M Futures trading. Exposes tools for market data, account state, order management, and position/margin control — designed to give an LLM everything it needs to monitor, place, and manage futures trades.

Built with FastMCP and httpx.

mcp-binance-futures MCP server

Tools

Market Data (public, no auth)

ToolDescription
pingTest API connectivity
get_tickerPrice, 24 h stats, mark price, funding rate for a symbol
get_order_bookTop N bids/asks for a symbol
get_recent_tradesLatest public trades
get_klinesOHLCV candlestick data (1m → 1w)
get_symbol_infoTrading rules: tick size, lot size, min notional, order types

Account (signed)

ToolDescription
get_balanceWallet balances (non-zero assets only)
get_positionsOpen positions with PnL, leverage, margin type — optionally scoped to one symbol
get_account_summaryTotal balance, unrealized PnL, margin usage, open position count

Orders (signed)

ToolDescription
place_orderPlace LIMIT, MARKET, STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET
modify_orderChange price or quantity of an open LIMIT order
cancel_orderCancel a single order by ID
cancel_all_ordersCancel all open orders for a symbol
get_open_ordersList all open orders for a symbol
get_orderGet a specific order by ID
get_order_historyRecent order history (all statuses)
get_trade_historyPersonal fill history for a symbol

Position Management (signed)

ToolDescription
set_leverageSet leverage multiplier (1–125×) for a symbol
set_margin_typeSwitch between ISOLATED and CROSSED margin
adjust_isolated_marginAdd or remove margin from an isolated position
set_position_modeSwitch between One-way and Hedge Mode
get_position_modeGet current position mode
get_leverage_bracketsLeverage tiers with maintenance margin rates

Setup

Requirements

  • Python 3.11+
  • uv (recommended) or pip

Install

# with uv (recommended)
uv sync

# or with pip
pip install -e .

API Keys

Create a Binance API key with Futures trading enabled. Set environment variables:

export BINANCE_API_KEY="your_api_key"
export BINANCE_API_SECRET="your_api_secret"

Security: Use IP whitelisting on your Binance API key. Never commit keys to version control.


Running

# stdio transport (default — for MCP clients like Claude Desktop)
python server.py

# or via the installed script
mcp-binance-futures

MCP Client Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "binance-futures": {
      "command": "python",
      "args": ["/path/to/mcp-binance-futures/server.py"],
      "env": {
        "BINANCE_API_KEY": "your_api_key",
        "BINANCE_API_SECRET": "your_api_secret"
      }
    }
  }
}

With uv

{
  "mcpServers": {
    "binance-futures": {
      "command": "uv",
      "args": ["run", "--project", "/path/to/mcp-binance-futures", "mcp-binance-futures"],
      "env": {
        "BINANCE_API_KEY": "your_api_key",
        "BINANCE_API_SECRET": "your_api_secret"
      }
    }
  }
}

Testing

# install dev dependencies
uv sync --extra dev

# run all tests
pytest

# run with output
pytest -v

Tests use respx to mock all HTTP calls — no real API keys or network required.


Common Usage Patterns

Open a long position with stop loss and take profit

1. get_ticker(symbol="BTCUSDT")          → check current price
2. get_balance()                          → check available margin
3. get_positions(symbol="BTCUSDT")        → confirm no existing position
4. set_leverage(symbol="BTCUSDT", leverage=10)
5. set_margin_type(symbol="BTCUSDT", margin_type="ISOLATED")
6. place_order(symbol="BTCUSDT", side="BUY", order_type="MARKET", quantity=0.01)
7. place_order(symbol="BTCUSDT", side="SELL", order_type="STOP_MARKET",
               stop_price=45000, close_position=True)
8. place_order(symbol="BTCUSDT", side="SELL", order_type="TAKE_PROFIT_MARKET",
               stop_price=55000, close_position=True)

Modify a limit order

1. get_open_orders(symbol="BTCUSDT")      → find the order ID
2. modify_order(symbol="BTCUSDT", order_id=123456, side="BUY",
                quantity=0.01, price=48500)

Emergency close all

1. cancel_all_orders(symbol="BTCUSDT")
2. place_order(symbol="BTCUSDT", side="SELL", order_type="MARKET",
               quantity=<position_size>, reduce_only=True)

Architecture

server.py      — FastMCP server, all tool definitions
client.py      — Async HTTP client: signing, transport, error handling
tests/
  test_client.py  — Unit tests for BinanceClient (signing, HTTP, errors)
  test_server.py  — Integration tests for all MCP tools

The client and server are intentionally kept in separate files: client.py handles all Binance API mechanics (HMAC signing, error parsing, HTTP verbs) while server.py contains only tool logic and MCP wiring. This makes both independently testable.

Related MCP Servers

@agentfund/mcp

📇 ☁️ - Fundraising infrastructure for AI agents on Solana — campaigns, x402 donations, and on-chain reputation. MCP tools for registering agents, creating campaigns, and donating via the x402 pay-to-call flow, backed by Anchor programs (agentregistry, escrow, reputation). npx -y @agentfund/mcp

💰 Finance & Fintech1 views
@asterpay/mcp-server

📇 ☁️ - EUR settlement for AI agents via x402 protocol. Market data, AI tools, crypto analytics — pay-per-call in USDC on Base. SEPA Instant EUR off-ramp.

💰 Finance & Fintech1 views
@czagents/cnb

📇 ☁️ 🏠 🍎 🪟 🐧 - Czech National Bank (ČNB) daily FX rates: fetch official CZK exchange rates, convert between currencies, fetch historical rates. Cached 10 min to ease upstream load. npm @czagents/cnb or HTTP at cnb.cz-agents.dev/mcp.

💰 Finance & Fintech1 views
@arbitova/mcp-server

📇 ☁️ - Non-custodial on-chain escrow + AI dispute arbitration for agent-to-agent USDC payments on Base. Seven tools covering the full EscrowV1 contract surface: create escrow, mark delivered with on-chain content hash, confirm or dispute, arbiter resolves with signed verdict, cancel/escalate on timeout. npx @arbitova/mcp-server

💰 Finance & Fintech0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.