Binance MCP Server
Provides tools for interacting with Binance's futures API, enabling AI agents to access real-time market data, trade orders, and technical indicators.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Binance MCP ServerWhat is the current price of BTCUSDT?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Binance MCP Server
🌐 Language: English | 日本語 | 한국어 | 简体中文
基于 Model Context Protocol (MCP) 的 Binance 合约 API 服务器,为 AI 助手(Claude Code、Cursor、Trae、OpenCode 等)提供实时行情、交易下单和技术指标计算能力。
快速开始
环境: Node.js >= 18
API Key: 可选(不配只给行情和指标,配了才有下单)
npm install
cp .env.example .env
npm run dev # 或:npm run build && npm start工具全景(76 个)
期货公开(11 个,无需 Key)
工具 | 功能 |
| 连通性测试 |
| 服务器时间 |
| 交易规则 / 费率 / 最小下单量 |
| 订单簿深度 |
| K 线数据(1m ~ 1M) |
| 聚合成交(分页+时间范围) |
| 最新逐笔成交 |
| 24 小时统计 |
| 全市场实时价 |
| 最优买卖挂单 |
| 标记价格(强平依据) |
期货认证(19 个,需要 API Key)
分类 | 工具 | 功能 |
🏦 账户查询 |
| 账户余额 |
| 收益流水(费率/盈亏/佣金) | |
| 成交历史 | |
⚙️ 杠杆与保证金 |
| 调整杠杆 1-125x |
| 逐仓/全仓切换 | |
| 逐仓保证金调增/调减 | |
| 保证金变更记录 | |
📊 杠杆分层 |
| 名义仓位杠杆阶梯(⚠️建议传symbol) |
📝 下单与改单 |
| 下单(7 种类型) |
| 修改订单(建议传 side+type) | |
| 查单 | |
| 全量订单(含历史) | |
| 批量下单(≤5) | |
| 批量取消 | |
❌ 取消与活跃 |
| 单笔取消(支持条件单 algoId) |
| 一键清仓(需确认) | |
| 当前活跃订单(含条件单) | |
🛠️ 辅助工具 |
| 账户全景报告(紧凑/完整可配) |
| 一键止损/止盈(百分比自动算价) |
下单类型速查表
type | 用途 | 必需参数 | 平仓方式 |
| 市价开平 |
| SELL+LONG 自动 reduceOnly |
| 限价挂单 |
| 同上 |
| 市价止损 |
|
|
| 市价止盈 |
|
|
| 追踪止损 |
|
|
| 限价止损 |
|
|
平仓速查表
场景 | 参数组合 |
市价平掉全部持仓 |
|
止损平仓 |
|
止盈平仓 |
|
追踪止损平仓 |
|
取消条件单 |
|
技术指标(46 个,无需 Key)
分类 | 数量 | 工具列表 |
趋势 | 12 |
|
动量 | 11 |
|
波动率 | 5 |
|
工具函数 | 9 |
|
组合信号 | 4 |
|
风险/绩效 | 5 |
|
环境配置
变量 | 必填 | 说明 |
| 否 | 币安 API 密钥 |
| 否 | 币安 API 私钥 |
| 否 | 测试网开关,默认 |
| 否 | 期货端点,留空按 testnet 自动切换 |
| 否 | HTTP 代理,如 |
| 否 | 服务器名,默认 |
| 否 | 日志级别: |
环境变量优先级
MCP 配置 env 块 > .env 文件 > 代码默认值MCP 配置文件(如 mcp.json)里设的 env 优先级最高,.env 兜底。dotenv 不会覆盖 进程已存在的环境变量。
安全建议: 用 MCP 配置的
env块管理密钥,.env的 Key 值清空。
配置 AI 助手
注意: MCP 配置文件不在项目目录,必须用绝对路径。以下假设项目在
E:/Github/I-binance-mcp,替换为你实际路径。
前置:先构建
npm run buildCursor / Trae / OpenCode
{
"mcpServers": {
"binance": {
"command": "node",
"args": ["E:/Github/I-binance-mcp/dist/index.js"],
"env": {
"BINANCE_API_KEY": "your_key",
"BINANCE_API_SECRET": "your_secret",
"BINANCE_TESTNET": "true"
}
}
}
}Claude Code
claude mcp add binance -- node E:/Github/I-binance-mcp/dist/index.js架构
src/
├── index.ts ← 入口
├── server.ts ← McpServer 创建 + 条件注册
├── config/binance.ts ← 配置(端点 / 代理 / 认证)
├── types/common.ts ← ToolDefinition 泛型 + BinanceClient 类型
├── utils/ ← 响应工厂 / 日志 / 校验 / 脱敏 / 限流
└── domain/
├── futures/ ← 期货:公开(11) + 认证(19)
│ ├── schemas.ts ← Zod Schema(聚合导出)
│ ├── schemas/
│ │ ├── public.ts ← 公开 Schema (10)
│ │ └── authenticated.ts ← 认证 Schema (18)
│ ├── public.ts ← 公开 handler
│ ├── authenticated.ts ← 认证 handler
│ └── index.ts
└── indicators/ ← 技术指标(46)
├── schemas.ts ← 指标参数 Schema
├── format.ts ← 精度格式化
├── trend.ts (12) / momentum.ts (11)
├── volatility.ts (5) / utility.ts (9)
├── signals.ts (4) / risk.ts (5)
└── index.ts条件注册: API Key 存在 → 76 工具;不存在 → 57 工具。
命令
命令 | 说明 |
| 开发模式(tsx) |
| 编译 |
| 运行编译产物 |
| 类型检查 |
| 热重载 |
| 冒烟测试(30 项) |
技术栈
组件 | 版本 | 用途 |
| ^1.29 | MCP 框架( |
| ^0.13 | 币安 API 客户端 |
| ^7.4 | 技术指标计算 |
| ^4.4 | Schema → JSON Schema 自动生成 |
| ^17.4 | 环境变量 |
| ^6.0 | 主语言 |
安全
密钥仅从环境变量注入,不写入代码或日志
错误消息自动脱敏(
api_key→[API_KEY]、signature→[SIGNATURE])STOP_MARKET/TAKE_PROFIT_MARKET自动显式传closePosition(避免undefined被 JSON 丢弃)Hedge 模式下
SELL+LONG自动设reduceOnly=true,防止误开反向仓位建议始终在
BINANCE_TESTNET=true模式下测试交易功能生产环境设
LOG_LEVEL=error
许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iuk-ink/binance-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server