mcp-binance-futures
The mcp-binance-futures server provides comprehensive access to Binance USDT-M Futures trading, enabling market analysis, account management, order execution, and position control.
Market Data (no authentication required)
ping— Test API connectivityget_ticker— Latest price, 24h stats, mark/index price, and funding rateget_order_book— Top N bids and asks (5–1000 depth levels)get_recent_trades— Most recent public trades for a symbolget_klines— OHLCV candlestick data (intervals: 1m to 1w)get_symbol_info— Trading rules (tick size, lot size, min notional, max leverage, order types)
Account Management (requires API keys)
get_balance— Wallet balances for all non-zero assetsget_positions— Open positions with PnL, leverage, margin type, and liquidation priceget_account_summary— Total balance, unrealized PnL, margin usage, and open position count
Order Management (requires API keys)
place_order— Place LIMIT, MARKET, STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET, or TRAILING_STOP_MARKET ordersmodify_order— Change price or quantity of an existing open LIMIT ordercancel_order— Cancel a single order by ID (supports regular and algo/conditional orders)cancel_all_orders— Cancel all open orders for a symbolget_open_orders— List all open orders (regular, algo, or all)get_order— Retrieve a specific order by order ID or client order IDget_order_history— Recent order history for a symbolget_trade_history— Personal fill/execution history for a symbol
Position & Margin Control (requires API keys)
set_leverage— Set leverage multiplier (1–125×) for a symbolset_margin_type— Switch between ISOLATED and CROSSED margin modeadjust_isolated_margin— Add or remove margin from an isolated positionset_position_mode— Switch between One-way and Hedge modeget_position_mode— Check the current position modeget_leverage_brackets— View leverage tiers and maintenance margin rates
Provides tools for monitoring and trading Binance USDT-M Futures, including access to market data, account balances, position management, and order execution.
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.
Tools
Market Data (public, no auth)
Tool | Description |
| Test API connectivity |
| Price, 24 h stats, mark price, funding rate for a symbol |
| Top N bids/asks for a symbol |
| Latest public trades |
| OHLCV candlestick data (1m → 1w) |
| Trading rules: tick size, lot size, min notional, order types |
Account (signed)
Tool | Description |
| Wallet balances (non-zero assets only) |
| Open positions with PnL, leverage, margin type — optionally scoped to one symbol |
| Total balance, unrealized PnL, margin usage, open position count |
Orders (signed)
Tool | Description |
| Place LIMIT, MARKET, STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET |
| Change price or quantity of an open LIMIT order |
| Cancel a single order by ID |
| Cancel all open orders for a symbol |
| List all open orders for a symbol |
| Get a specific order by ID |
| Recent order history (all statuses) |
| Personal fill history for a symbol |
Position Management (signed)
Tool | Description |
| Set leverage multiplier (1–125×) for a symbol |
| Switch between |
| Add or remove margin from an isolated position |
| Switch between One-way and Hedge Mode |
| Get current position mode |
| Leverage tiers with maintenance margin rates |
Related MCP server: binance-data MCP Server
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-futuresMCP 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 -vTests 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 toolsThe 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.
Available Tools
23 toolsadjust_isolated_marginA
Add or remove margin from an isolated position.
Only valid when the symbol is in ISOLATED margin mode with an open position.
Inputs: symbol (required), amount (required), direction (required), position_side. Returns: object
cancel_all_ordersA
Cancel all open orders for a symbol.
With source='all' (default), cancels both regular and algo (conditional) orders in parallel.
Inputs: symbol (required), source. Returns: object
cancel_orderA
Cancel a single open order by orderId or clientOrderId.
For algo (conditional) orders returned by get_open_orders with '_isAlgo': True, set is_algo=True — this routes to the Algo API using algoId.
Inputs: symbol (required), order_id, client_order_id, is_algo. Returns: object
get_account_summaryB
Get account-level summary: total balance, unrealized PnL, margin ratio, positions count.
Inputs: no named parameters. Returns: object
get_balanceA
Get futures wallet balances for all assets with non-zero balance.
Returns list of: asset, balance, availableBalance, crossWalletBalance, unrealizedProfit.
Inputs: no named parameters. Returns: result
get_klinesA
Get OHLCV candlestick data for a symbol.
Returns list of dicts with: openTime, open, high, low, close, volume, closeTime, quoteVolume, trades, takerBuyVolume, takerBuyQuoteVolume.
Inputs: symbol (required), interval, limit. Returns: result
get_leverage_bracketsA
Get leverage brackets for a symbol: max leverage per notional tier with maintenance margin rates.
Inputs: symbol (required). Returns: result
get_open_ordersA
Get open orders for a symbol.
Returns list of: orderId, clientOrderId, symbol, status, type, side, positionSide, price, origQty, executedQty, avgPrice, stopPrice, timeInForce, reduceOnly, closePosition, updateTime. Algo (conditional) orders also include '_isAlgo': True.
Inputs: symbol (required), source. Returns: result
get_orderB
Get details of a specific order by orderId or clientOrderId.
Inputs: symbol (required), order_id, client_order_id. Returns: object
get_order_bookA
Get order book bids and asks for a symbol.
Returns top limit bids and asks as [[price, qty], ...] lists.
Inputs: symbol (required), limit. Returns: object
get_order_historyB
Get recent order history for a symbol (all statuses).
Inputs: symbol (required), limit. Returns: result
get_position_modeB
Get current position mode: Hedge Mode or One-way Mode.
Inputs: no named parameters. Returns: object
get_positionsA
Get current open positions (non-zero size).
Per position: symbol, side, size, entryPrice, markPrice, unrealizedPnl, percentage, leverage, marginType, isolatedMargin, liquidationPrice.
Inputs: symbol. Returns: result
get_recent_tradesB
Get the most recent public trades for a symbol.
Inputs: symbol (required), limit. Returns: result
get_symbol_infoB
Get trading rules for a symbol: tick size, lot size, min notional, max leverage, etc.
Inputs: symbol (required). Returns: object
get_tickerB
Get latest price, 24 h stats, and mark/index prices for a symbol.
Returns a merged dict with:
price, priceChange, priceChangePct, high, low, volume, quoteVolume
markPrice, indexPrice, fundingRate, nextFundingTime
Inputs: symbol (required). Returns: object
get_trade_historyB
Get your personal trade execution history for a symbol (fills).
Inputs: symbol (required), limit. Returns: result
modify_orderA
Modify price or quantity of an existing open LIMIT order (PUT /fapi/v1/order).
Inputs: symbol (required), side (required), quantity (required), order_id, +2 more. Returns: object
pingA
Test connectivity to the Binance Futures API. Returns {} on success.
Inputs: no named parameters. Returns: object
place_orderA
Place a new futures order.
ORDER TYPE GROUPS — choose the right one:
Immediate orders (fill now or queue at price): MARKET: side=BUY, quantity=0.01 LIMIT: side=SELL, quantity=0.01, price=50000, time_in_force=GTC
Conditional orders (wait for stop_price trigger, then execute): Stop-loss full close: side=SELL, type=STOP_MARKET, stop_price=45000, close_position=True Take-profit full close: side=SELL, type=TAKE_PROFIT_MARKET, stop_price=60000, close_position=True Stop-loss partial: side=SELL, type=STOP_MARKET, stop_price=45000, quantity=0.01, reduce_only=True Trailing stop: side=SELL, type=TRAILING_STOP_MARKET, stop_price=45000, quantity=0.01, callback_rate=1.0
IMPORTANT — close_position=True vs quantity+reduce_only: close_position=True → closes the ENTIRE position, no quantity needed, max 1 SL + 1 TP active at a time. reduce_only=True → closes a PARTIAL quantity, multiple allowed simultaneously. Never mix both on the same order.
Inputs: symbol (required), side (required), order_type (required), quantity, +8 more. Returns: object
set_leverageB
Set leverage for a symbol. Returns the new leverage and max notional value.
Inputs: symbol (required), leverage (required). Returns: object
set_margin_typeA
Switch margin type for a symbol between ISOLATED and CROSSED.
Note: Cannot change margin type while a position or open order exists.
Inputs: symbol (required), margin_type (required). Returns: object
set_position_modeA
Switch between One-way Mode and Hedge Mode for the account.
Note: Cannot change while any positions or open orders exist.
Inputs: hedge_mode (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes targeting specific futures trading operations like orders, positions, account info, and market data. However, some overlap exists between get_order and get_order_history (specific vs. recent orders) and between get_ticker and get_symbol_info (price stats vs. trading rules), though descriptions help clarify their differences.
Tool names follow a highly consistent verb_noun pattern throughout, such as get_account_summary, cancel_order, set_leverage, and adjust_isolated_margin. All tools use snake_case with clear, descriptive verbs, making the set predictable and easy to navigate.
With 23 tools, the count is borderline high for a single server, though it covers a comprehensive range of futures trading operations. It feels slightly heavy but is justifiable given the complexity of the domain, including orders, positions, account management, and market data.
The tool set provides complete coverage for Binance Futures trading, including full CRUD/lifecycle operations for orders (place, modify, cancel, get), positions (get, adjust margin), account settings (leverage, margin type, position mode), and market data (klines, ticker, order book). No obvious gaps are present for core trading workflows.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Hosted MCP server for MT4 and MT5: read accounts, prices and candles, and place or close orders.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceComprehensive Binance Futures trading MCP server with 41 professional trading tools across account management, order execution, market data, and risk management. Features smart ticker caching, secure authentication, and Docker support for seamless integration with MCP clients.67 PyPI4PythonMIT
- FlicenseNot gradedqualityCmaintenanceMCP server providing access to Binance public market data, including klines, order book depth, and 24hr ticker.-
- FlicenseBqualityDmaintenanceCustom MCP server for Binance Futures, providing market data, trading, and quant tools.19-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that enables any compatible AI model to autonomously trade Binance USDT-margined perpetual futures. Includes a separate paper-trading strategy lab that requires no credentials.1MIT