Skip to content

Repository files navigation

binance-mcp

A Model Context Protocol (stdio) server that wraps tiagosiebler/binanceUSDMClient for USD-M futures (REST). Use it from Cursor, Claude, or any MCP host.

Prerequisites

Install

cd binance-mcp
pnpm install
cp .env.example .env
# Edit .env if you need signed endpoints or trading
pnpm run build

Run (stdio)

pnpm start
# or
node dist/index.js

Cursor / IDE

Add a server entry that runs this package (similar to other stdio MCPs):

{
"mcpServers": {
"binance-usdm": {
"command": "node",
"args": ["/absolute/path/to/auto_trade/binance-mcp/dist/index.js"],
"env": {
"BINANCE_API_KEY": "...",
"BINANCE_SECRET_KEY": "...",
"BINANCE_TRADING_ENABLED": "false"
}
}
}
}

Use pnpm + tsx for dev without building:

"command": "pnpm",
"args": ["exec", "tsx", "src/index.ts"],
"cwd": "/absolute/path/to/auto_trade/binance-mcp"

Tools

NameAuthNotes
usdm_pingPublicConnectivity
usdm_get_server_timePublicServer time
usdm_get_exchange_infoPublicOptional symbol filter
usdm_get_mark_pricePublicOne or all symbols
usdm_get_funding_ratesPublicCurrent funding
usdm_get_orderbookPublicsymbol, optional limit
usdm_get_24h_tickerPublicOne or all symbols
usdm_get_account_balanceSignedNeeds API keys
usdm_get_account_informationSignedFull account state
usdm_get_positionsSignedOptional symbol
usdm_get_open_ordersSignedOptional symbol
usdm_get_open_algo_ordersSignedOptional symbol
usdm_get_orderSignedorderId or origClientOrderId
usdm_get_historical_ordersSignedPast orders for a symbol (time / limit / orderId anchor)
usdm_get_account_tradesSignedFills / executions (use for trade-level questions)
usdm_get_income_historySignedPnL, funding, commission ledger
usdm_get_algo_orderSignedOne conditional order by algoId / clientAlgoId
usdm_get_historical_algo_ordersSignedPast algo/TP/SL orders for a symbol
usdm_submit_orderSigned + tradingBINANCE_TRADING_ENABLED=true
usdm_cancel_orderSigned + trading
usdm_cancel_all_open_ordersSigned + tradingPer symbol
usdm_cancel_algo_orderSigned + tradingalgoId or clientAlgoId

Without API keys, only public tools are registered (plus a small usdm_private_tools_disabled hint). With keys but BINANCE_TRADING_ENABLED unset/false, read-only account tools work; a usdm_trading_disabled tool explains how to enable order placement.

Safety

  • Default: trading tools are off until BINANCE_TRADING_ENABLED=true.
  • Prefer testnet (BINANCE_TESTNET=true) or demo trading (BINANCE_DEMO_TRADING=true) while integrating — but not both: the binance SDK has no demo-trading URL for USDM testnet, so if both env vars are true the server drops demo trading and uses testnet only (you’ll see a stderr warning).
  • This server exposes real trading capability when enabled and on mainnet — treat API keys like root passwords.

License

MIT (same spirit as the upstream binance SDK; confirm your own compliance with Binance ToS).

About

MCP server enabling AI agents to run Binance trading ops: open positions, check status, close or partially close, summarize trade outcomes, and more.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages