Skip to main content
Glama
Binance MCP Server

Binance MCP Server

Binance MCP Server

Version Node.js License

A Binance USDT-M futures MCP server based on Model Context Protocol, providing AI assistants with 61 MCP tools covering market data, technical indicators, risk analysis, and futures trading.

Built on the MCP server v2 SDK and Binance's official SDK (@binance/derivatives-trading-usds-futures), all values are automatically normalized according to exchange precision rules, with two-level market data caching, -1007 timeout idempotent recovery, and clock skew detection.

Quick Start

Zero-Configuration Experience (Analysis Only, No Trading)

npx @iuk-ink/binance-mcp-server

No API key is required. Connect to the testnet by default and use the market data, indicator, and risk analysis tools.

Configuring an MCP Client

{
  "mcpServers": {
    "binance": {
      "command": "npx",
      "args": ["-y", "@iuk-ink/binance-mcp-server"],
      "env": {
        "BINANCE_TESTNET": "true"
      }
    }
  }
}

If you need trading features, add BINANCE_API_KEY and BINANCE_API_SECRET.

Environment Variables

Variable

Required

Default

Description

BINANCE_TESTNET

No

true

Testnet (virtual funds) / Mainnet

BINANCE_USE_DEMO

No

false

Demo trading environment (shares credentials with mainnet)

BINANCE_BASE_URL

No

—

Custom REST endpoint (highest priority)

BINANCE_API_KEY

No

—

Trading tools are not registered if not set

BINANCE_API_SECRET

No

—

Same as above

BINANCE_PROXY_URL

No

—

HTTP/HTTPS proxy address

BINANCE_TIMEOUT

No

10000

Request timeout (ms)

BINANCE_RETRIES

No

3

Network retry count

BINANCE_BACKOFF

No

1000

Retry backoff base (ms)

BINANCE_RECV_WINDOW

No

5000

Signature time window (ms)

MCP_TOOL_DOMAINS

No

All

Tool domain filter, comma-separated: market,trading,indicator,analysis

MCP_SERVER_NAME

No

binance-mcp-server

MCP server name

LOG_LEVEL

No

info

debug / info / warn / error

Related MCP server: Binance MCP Server

Tool List (61, Mainnet)

On testnet, there are 57 tools (the 4 sentiment endpoints are only available on mainnet and are not registered).

Market Data (18)

Tool

Description

market_price

Latest trade price

market_book_ticker

Best bid/ask price + quantity (much lighter than orderbook)

market_orderbook

Multi-level order book depth (5/10/20/50/100/500/1000)

market_klines

Historical K-line data

market_24hr_ticker

24h change / high / low / volume

market_mark_price

Mark price (= liquidation reference price, includes funding rate)

market_open_interest

Open interest (OI)

market_funding_rate

Current funding rate and bounds

market_funding_rate_history

Historical funding rates

market_continuous_klines

Perpetual / quarterly / next quarter continuous contract K-lines (basis analysis)

market_exchange_info

Trading rules / precision / minimum order size

market_overview

One-stop snapshot: market data + indicators + funding rate + order book, in a single call

market_ping / market_time

Connectivity test / server clock calibration

market_open_interest_hist

OI historical statistics (mainnet only)

market_long_short_ratio

All-account long/short ratio (mainnet only)

market_taker_volume

Aggressive buy/sell volume ratio (mainnet only)

market_top_trader_ratio

Large trader position long/short ratio (mainnet only)

Technical Indicators (19)

Direct-connection design: complete "fetch K-lines → calculate indicator" in one step, without needing to call market_klines.

Category

Tools

Trend

indicator_sma / indicator_ema / indicator_macd / indicator_adx / indicator_super_trend / indicator_vwap

Momentum

indicator_rsi / indicator_stoch / indicator_cci / indicator_mfi / indicator_obv

Volatility

indicator_atr / indicator_bbands / indicator_volatility_regime

Composite signals

indicator_ma_cross (MA cross) / indicator_macd_rsi / indicator_bb_rsi / indicator_divergence (RSI divergence)

Batch

indicator_multi (one call = RSI + MACD + BBands + optional ATR / ADX / Stoch)

Risk Analysis (3)

Tool

Description

analysis_sharpe

Sharpe + Sortino + annualized return / volatility (annualization factor automatically inferred from the K-line timeframe)

analysis_drawdown

Maximum drawdown (including peak/trough prices and positions)

analysis_var

VaR / CVaR (confidence level 0.5~0.99 adjustable)

Futures Trading (21, API Key Required)

Category

Tools

Account

trading_balance / trading_account / trading_positions / trading_income / trading_commission

Order

trading_place_order (includes dryRun simulation) / trading_place_algo (stop loss / take profit / trailing stop) / trading_modify_order / trading_cancel_order / trading_cancel_algo / trading_cancel_all

Query

trading_get_order / trading_open_orders / trading_order_history / trading_trades / trading_force_orders / trading_algo_orders

Configuration

trading_set_leverage / trading_set_margin_type / trading_position_margin / trading_position_mode

Orders are automatically handled: price / quantity precision rounded down (tickSize / stepSize), minimum notional value validation, and after a -1007 match timeout, it verifies whether the order was filled using an idempotent order ID before deciding whether to retry.

Migrating from 2.x to 3.x

Breaking Changes

  • MCP SDK: @modelcontextprotocol/sdk@1 → @modelcontextprotocol/server@2 (official package rename)

  • Binance integration: community package binance@3 → official @binance/derivatives-trading-usds-futures@38

  • Node.js: >=18 → >=20

  • Proxy environment variable: HTTP_PROXY → BINANCE_PROXY_URL

  • Toolset 76 → 61: removed the statistics helper domain (10 tools for mean / extremes / quartiles, etc.) and redundant standalone / signal variants of indicators; the legacy _direct tools are now direct-connect tools without the suffix (for example, rsi_direct → indicator_rsi); risk tools renamed (analysis_* from risk_*)

  • Tool name prefixes: all tools have a domain prefix (market_ / indicator_ / analysis_ / trading_); existing AI client prompts and workflows must adapt to the new names

New Capabilities

  • market_overview one-stop snapshot (aggregates market data / indicator / funding rate / order book in a single call)

  • MCP_TOOL_DOMAINS tool domain filtering, BINANCE_USE_DEMO / BINANCE_BASE_URL environment configuration

  • Two-level cache (exchangeInfo 5min + klines 3s, in-flight deduplication)

  • -1007 match timeout idempotent recovery, clock skew detection at startup

  • Automatic order precision rounding + upfront-order minimum notional validation

  • Parameter validation fully aligned with official constraints (clientOrderId character set, GTD upper bound, trailing drawdown rate 0.1~10, etc.)

AI Usage Guide (Skill)

The repository includes skills/binance-trader/SKILL.md — a usage manual written for AI assistant, covering tool selection decisions, cross-tool workflows, trading safety discipline, and error recovery scripts. Clients that support the Skill mechanism (Claude Code / Trae, etc.) can mount it directly, allowing the AI to upgrade from "can use tools" to "use tools well".

Local Development

git clone https://github.com/iuk-ink/binance-mcp-server
cd binance-mcp-server
npm install

Commands

Command

Description

npm run dev

Direct startup with tsx for development

npm run typecheck

TypeScript type checking

npm test

Run all 196 tests with node:test (no network dependencies)

npm run build

Compile to dist/

npm start

Run the compiled output

License

MIT

Available Tools

57 tools
analysis_drawdown最大回撤A
Read-only

直连版:拉取 K 线以收盘价为净值序列,计算标的最大回撤(负数)与峰谷位置(非账户绩效)。窗口越大越接近历史极值,建议 1d×365 起评估最大可能回撤。

Inputs: symbol (required), interval (required), limit. Returns: peak, trough, maxDrawdown, sampleCount

analysis_sharpe夏普·索提诺A
Read-only

直连版:拉取 K 线推导标的收益率序列,计算年化收益/波动、夏普与索提诺。度量对象为标的价格序列的风险特征(非账户绩效);periodPerYear 缺省按 interval 自动推断(1h→8760、1d→365);严肃评估建议使用 1d×365 及以上大窗口(小窗口年化统计意义有限)。

Inputs: symbol (required), interval (required), limit, riskFreeRate, +1 more. Returns: sharpe, sortino, sampleCount, annualReturn, +2 more

analysis_varVaR · CVaRA
Read-only

直连版:拉取 K 线推导收益率,按历史模拟法计算置信度下的 VaR 与 CVaR(负值=损失;度量标的单根 K 线尾部风险,非账户绩效)。可作止损距离参考:止损应 ≥ 单根 VaR × 杠杆,否则易被正常波动扫损。

Inputs: symbol (required), interval (required), limit, confidence. Returns: var, cvar, confidence, sampleCount

indicator_adx平均趋向指标A
Read-only

直连版:拉取 K 线后计算 ADX,返回稳定序列(衡量趋势强度,0-100,与方向无关)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_atr平均真实波幅A
Read-only

直连版:拉取 K 线后计算 ATR,返回稳定序列(衡量波动,默认 Wilder 平滑)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_bbands布林带C
Read-only

直连版:拉取 K 线后计算布林带,返回稳定三元组序列(lower / middle / upper)。

Inputs: symbol (required), interval (required), limit, period, +1 more.

indicator_bb_rsi布林带 + RSI 组合B
Read-only

直连版:拉取 K 线后同时计算布林带完整数据、RSI、%B 与价格分区。

Inputs: symbol (required), interval (required), limit, period, +2 more. Returns: rsi, zone, lower, upper, +2 more

indicator_cci顺势指标B
Read-only

直连版:拉取 K 线后计算 CCI,返回稳定序列(以典型价离差归一,可正可负)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_divergenceRSI 背离检测A
Read-only

直连版:拉取 K 线后检测价格与 RSI 的顶背离 / 底背离(前后半窗极值对比),返回背离类型与全部极值明细。

Inputs: symbol (required), interval (required), limit, lookback, +1 more. Returns: rsi, type, price, window

indicator_ema指数移动平均B
Read-only

直连版:拉取 K 线后计算指数移动平均,返回 EMA 序列(以首价为平滑种子,period 为周期)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_macdMACDC
Read-only

直连版:拉取 K 线后计算 MACD,返回稳定三元组序列(macd / signal / histogram)。

Inputs: symbol (required), interval (required), limit, longPeriod, +2 more. Returns: data

indicator_macd_rsiMACD + RSI 组合B
Read-only

直连版:拉取 K 线后同时计算 MACD 与 RSI 最新值,返回完整数据(不输出主观信号)。

Inputs: symbol (required), interval (required), fast, slow, +3 more. Returns: rsi, macd

indicator_ma_cross均线交叉A
Read-only

直连版:拉取 K 线后检测双均线交叉状态(golden_cross / death_cross / none)与多空偏向。

Inputs: symbol (required), interval (required), fast, slow, +2 more. Returns: bias, fast, slow, cross

indicator_mfi资金流量指标B
Read-only

直连版:拉取 K 线后计算 MFI,返回稳定序列(0-100,带成交量的 RSI 变体)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_multi批量指标A
Read-only

直连版:单次拉取 K 线,批量计算 RSI(14) + MACD(12/26/9) + BBands(20/2) 最新值。可选启用 ATR / ADX / Stoch。替代逐个调用 3-6 次网络往返。

Inputs: symbol (required), interval (required), limit, includeADX, +2 more. Returns: adx, atr, rsi, macd, +2 more

indicator_obv能量潮C
Read-only

直连版:拉取 K 线后计算 OBV,返回稳定序列(结合开盘与收盘方向的累计成交量)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_rsi相对强弱指标A
Read-only

直连版:拉取 K 线后计算 RSI,返回稳定序列(0-100,Wilder 平滑,period 为周期)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_sma简单移动平均A
Read-only

直连版:拉取 K 线后计算简单移动平均,返回稳定 SMA 序列(period 为周期)。

Inputs: symbol (required), interval (required), limit, period. Returns: data

indicator_stoch随机指标 KDJB
Read-only

直连版:拉取 K 线后计算随机指标,返回稳定 K / D / J 三元组序列(kPeriod / kSmoothing / dPeriod 可调)。

Inputs: symbol (required), interval (required), limit, dPeriod, +2 more. Returns: data

indicator_super_trendSuperTrendA
Read-only

直连版:拉取 K 线后计算 SuperTrend,返回稳定序列(supertrend 值 + BULLISH/BEARISH 方向)。period 为 ATR 周期,multiplier 为通道倍数。

Inputs: symbol (required), interval (required), limit, period, +1 more. Returns: data

indicator_volatility_regime波动率状态分类B
Read-only

直连版:基于布林带宽百分位判断 squeeze / low_volatility / normal / high_volatility / expansion,辅助仓位管理。

Inputs: symbol (required), interval (required), limit, bbPeriod, +1 more. Returns: regime, bandwidth, percentile

indicator_vwap成交量加权平均价B
Read-only

直连版:拉取 K 线后计算累计 VWAP,返回稳定序列。

Inputs: symbol (required), interval (required), limit. Returns: data

market_24hr_ticker24h 行情统计A
Read-only

获取 24h 滚动统计(涨跌幅/高低价/成交量额)。缺省 symbol 返回全市场(weight 高,慎用)。

Inputs: symbol.

market_book_ticker最优买卖报价A
Read-only

获取最优买/卖价与数量(比订单簿轻量)。缺省 symbol 返回全市场(weight 高,慎用)。

Inputs: symbol.

market_continuous_klines连续合约 K 线B
Read-only

获取连续合约(如季度/永续)的 K 线。

Inputs: pair (required), interval (required), contractType (required), limit.

market_exchange_info交易规则A
Read-only

获取交易对精度规格(价格/数量小数位、tickSize、stepSize、最小名义价值)。缺省返回全市场(数据量大,慎用)。

Inputs: symbol.

market_funding_rate资金费率规则A
Read-only

获取全市场资金费率规则(各币种费率上下限与结算间隔,无 symbol 过滤,weight 高慎用)。查单交易对当前费率数值请用 market_mark_price。

Inputs: no named parameters.

market_funding_rate_history历史资金费率B
Read-only

获取指定交易对的历史资金费率记录。

Inputs: limit, symbol.

market_klinesK 线历史B
Read-only

获取指定交易对与周期的 K 线(含 OHLCV 与成交信息),支持时间范围过滤。

Inputs: symbol (required), interval (required), limit, endTime, +1 more. Returns: data

market_mark_price标记价A
Read-only

获取标记价、指数价与资金费率信息。查单交易对资金费率数值(lastFundingRate + nextFundingTime)首选本工具。缺省 symbol 返回全市场(weight 高,慎用)。

Inputs: symbol.

market_open_interest未平仓量A
Read-only

获取指定交易对当前未平仓量。

Inputs: symbol (required). Returns: time, symbol, openInterest

market_orderbook订单簿深度A
Read-only

获取指定交易对的买卖盘快照。limit 合法值 5/10/20/50/100/500/1000。

Inputs: symbol (required), limit.

market_overview市场快照A
Read-only

一次返回单个交易对的完整分析数据(行情/流动性/资金/情绪/指标/派生量),供 AI 直接解读并给出分析结论。

Inputs: symbol (required), limit, interval. Returns: meta, price, candles, capital, +4 more

market_ping连通性测试A
Read-only

测试与币安交易所 REST API 的连通性。无需参数,成功返回 { ok: true }。

Inputs: no named parameters. Returns: ok

market_price最新成交价B
Read-only

获取交易对最新成交价。返回 symbol 与 price(number 类型)。

Inputs: symbol (required). Returns: price, symbol

market_time服务器时钟A
Read-only

获取币安交易所服务器时间(毫秒时间戳),用于时钟同步与签名校验。

Inputs: no named parameters. Returns: serverTime

trading_account账户总览A
Read-onlyIdempotent

返回:钱包余额 / 未实现盈亏 / 保证金等汇总。

Inputs: no named parameters. Returns: availableBalance, totalMarginBalance, totalWalletBalance, totalUnrealizedProfit…

trading_algo_orders条件单列表A
Read-onlyIdempotent

返回:当前挂出的未触发条件单。symbol 可选。

Inputs: symbol.

trading_balance资产余额A
Read-onlyIdempotent

返回:账户全部资产余额(含未实现盈亏)。

Inputs: no named parameters. Returns: data

trading_cancel_algo撤销条件单B
Destructive

撤销条件单。clientAlgoId 与 algoId 二选一。

Inputs: algoId, clientAlgoId.

trading_cancel_all撤销全部未成交A
Destructive

撤销指定交易对全部未成交订单。

Inputs: symbol (required).

trading_cancel_order撤单A
Destructive

撤销指定订单。orderId 与 origClientOrderId 二选一。

Inputs: symbol (required), orderId, origClientOrderId.

trading_commission用户费率A
Read-onlyIdempotent

返回:指定交易对的 maker/taker 费率(含 VIP 折扣与 BNB 抵扣)。

Inputs: symbol (required). Returns: symbol, makerCommissionRate, takerCommissionRate

trading_force_orders强平订单C
Read-onlyIdempotent

返回:强平/自动减仓(ADL)订单记录。

Inputs: limit, symbol, autoCloseType.

trading_get_order订单查询B
Read-onlyIdempotent

返回:指定订单详情。orderId 与 origClientOrderId 二选一。

Inputs: symbol (required), orderId, origClientOrderId.

trading_income收支流水C
Read-onlyIdempotent

返回:资金费/手续费/已实现盈亏等流水记录。income 负数为支出。incomeType 合法值与官方枚举一致(如 FUNDING_FEE / COMMISSION / REALIZED_PNL)。

Inputs: limit, symbol, endTime, startTime, +1 more.

trading_modify_order改单A
Destructive

修改未成交订单(仅 LIMIT)。orderId 与 origClientOrderId 二选一。

Inputs: side (required), price (required), symbol (required), quantity (required), +2 more.

trading_open_orders未成交订单B
Read-onlyIdempotent

返回:当前全部未成交订单。symbol 可选。

Inputs: symbol.

trading_order_history历史订单B
Read-onlyIdempotent

返回:指定交易对的历史订单(时间倒序)。

Inputs: symbol (required), limit, endTime, orderId, +1 more.

trading_place_algo创建条件单A
Destructive

创建条件委托(止损/止盈/追踪止损)。type 决定必填参数:

  • STOP_MARKET / TAKE_PROFIT_MARKET:需 triggerPrice

  • STOP / TAKE_PROFIT:需 triggerPrice + price(限价委托价)

  • TRAILING_STOP_MARKET:需 callbackRate(百分比,0.1~10),可选 activatePrice 触发价方向规则(违反将报 -2021 Order would immediately trigger):

  • 止损类(STOP*):BUY 须高于最新价,SELL 须低于最新价

  • 止盈类(TAKE_PROFIT*):BUY 须低于最新价,SELL 须高于最新价 closePosition=true 时触发后全平仓位,且要求该 symbol 已有对应方向持仓 (无持仓时报错 GTE can only be used with open positions),不可传 quantity / reduceOnly。 持仓模式:双向(Hedge)必须传 positionSide(LONG/SHORT),单向省略;可用 trading_position_mode 查询。

Inputs: side (required), type (required), symbol (required), price, +11 more.

trading_place_order下单A
Destructive

下单(自动精度规整)。dryRun=true 时仅校验不提交。reduceOnly 仅单向模式可用。timeInForce 为 GTD 时必须提供 goodTillDate。持仓模式约束:单向省略 positionSide,双向(Hedge)必须传 positionSide(LONG/SHORT),可用 trading_position_mode 查询。

Inputs: side (required), type (required), symbol (required), quantity (required), +8 more.

trading_position_margin调整逐仓保证金A
Destructive

调整逐仓保证金。type: 1=增加,2=减少(官方枚举);amount 恒为正数。双向(Hedge)模式下须提供 positionSide。

Inputs: type (required), amount (required), symbol (required), positionSide. Returns: type, amount

trading_position_mode持仓模式A

查询并切换持仓模式。dual=true 双向(Hedge),false 单向(One-way)。缺省 dual 时仅查询。

Inputs: dual.

trading_positions持仓查询B
Read-onlyIdempotent

返回:当前持仓列表。缺省 symbol 返回全部持仓。

Inputs: symbol.

trading_set_leverage设置杠杆C
Destructive

设置交易对杠杆倍数(1~125,视交易对而定)。

Inputs: symbol (required), leverage (required). Returns: symbol, leverage

trading_set_margin_type设置保证金模式A
Destructive

切换 ISOLATED(逐仓)/ CROSSED(全仓)。存在持仓时可能被拒绝。

Inputs: symbol (required), marginType (required).

trading_trades成交记录C
Read-onlyIdempotent

返回:指定交易对的逐笔成交记录。

Inputs: symbol (required), limit, orderId.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 57 tools

    Disambiguation4/5

    Most tools target distinct resources or actions with clear category prefixes. Some overlap exists among composite indicators (indicator_macd_rsi, indicator_bb_rsi, indicator_multi) and funding-rate related tools, but descriptions explicitly disambiguate which to use.

    Naming Consistency5/5

    All tools follow a strict <domain>_<object_or_action> pattern across market, trading, indicator, and analysis prefixes. Names are consistently snake_case, making the large set predictable and scannable.

    Tool Count2/5

    57 tools is well above the 25+ threshold for 'too many.' While grouped into coherent categories, the indicator subset alone could be consolidated (e.g., combined macd_rsi, bb_rsi, multi), and the overall surface feels excessive for a single server.

    Completeness4/5

    The server covers the core Binance futures/spot lifecycle well: market data, order management, positions, balance, leverage, margin, and algo orders. Minor gaps such as missing deposit/withdraw endpoints and batch order operations exist, but trading workflows are largely complete.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      F
      maintenance
      A Model Context Protocol server implementation that enables AI assistants to interact with the Paradex perpetual futures trading platform, allowing for retrieving market data, managing trading accounts, placing orders, and monitoring positions.
      16
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that exposes Binance cryptocurrency exchange data to LLMs, allowing agents to access real-time prices, order books, and historical market data without requiring API keys.
      21
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables automated cryptocurrency trading on Binance and provides integration for monitoring Base network operations. It allows users to execute trades, fetch market data, and calculate technical indicators like RSI and MACD through the Model Context Protocol.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time investment news, technical analysis via TA-Lib, and Binance trading capabilities including order management and market data retrieval. It enables AI assistants to perform financial market research and execute trades through the Model Context Protocol.
      -