mcp-服务器-cex-bn
该MCP服务器与币安的现货和期货交易业务提供全面整合。
特征
现货交易操作
执行现货交易操作(限价/市价单)
监控账户余额
跟踪和管理未结订单
取消现有订单
期货交易操作
创建各种类型的期货订单(LIMIT、MARKET、STOP、TAKE_PROFIT 等)
管理杠杆设置(1-125倍)
监控期货仓位和账户信息
追踪融资利率
支持单向和对冲模式仓位
高级订单类型包括追踪止损和仅减少订单
工具
API 配置
configure_api_keys
安全存储您的 Binance API 凭证:
现货交易工具
create_spot_order
创建限价单或市价单:
cancel_order
取消现有订单:
get_balances
检查您的帐户余额:
get_open_orders
列出所有未完成的订单:
期货交易工具
create_futures_order
创建各种类型的期货订单:
set_futures_leverage
调整交易对的杠杆:
get_futures_positions
获取所有未平仓期货仓位:
get_futures_account
获取期货账户详细信息:
get_funding_rate
获取期货交易品种的融资利率:
cancel_futures_order
取消现有的期货订单:
期货交易详情
位置模式
单向模式:每个符号单一仓位
默认模式,仓位管理更简单
总仓位规模是所有订单的总和
对冲模式:多空仓位分离
允许同时持有多头和空头头寸
每个仓位都有独立的保证金要求
保证金类型
逐仓保证金:每个仓位固定保证金
风险仅限于分配的保证金
每个仓位都有自己的杠杆设置
全仓保证金:跨仓位共享保证金
更高的资本效率
所有职位共担风险
资金费率
永续期货合约使用资金利率来保持期货价格与现货价格一致:
正利率:多头支付空头
负利率:空头支付多头
每 8 小时付款一次
安全注意事项
现货交易安全
切勿将 API 密钥提交到版本控制
使用环境变量或安全密钥存储
将 API 密钥权限限制为仅执行必需的操作
定期轮换您的 API 密钥
期货交易安全
根据风险承受能力设定适当的杠杆限制
始终使用止损单来限制潜在损失
仔细监控清算价格
定期检查持仓风险和保证金比率
考虑使用仅减少订单进行风险管理
由于风险共担,对跨保证金需谨慎
速率限制
遵守币安 API 速率限制
默认速率限制:
每分钟 1200 个订单操作请求
每秒 100 个市场数据请求
对速率限制错误实施适当的错误处理
错误处理
常见错误场景
API 凭证无效
余额或保证金不足
订单参数无效
超出速率限制
网络连接问题
期货特有的错误
InsufficientMarginError:操作保证金不足
InvalidPositionModeError:错误的位置模式设置
OrderValidationError:期货订单参数无效
错误处理示例:
项目结构
发展
设置环境变量:
在根目录中创建.env
文件,并设置您的 Binance API 凭证:
安装依赖项:
构建服务器:
对于使用自动重建的开发:
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Binance Trading Server:
手动安装
克隆存储库
安装依赖项:
在
.env
中配置您的 Binance API 凭证构建并启动服务器:
调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
检查器将提供一个 URL 来访问浏览器中的调试工具。
mcp-服务器-bn
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
该服务器为币安现货交易操作提供了强大的界面,包括 API 凭证的安全管理、现货订单的执行和管理以及账户余额和未结订单的监控。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA server implementation that streams real-time Binance market data (spot and futures) via WebSockets, enabling applications to receive and process cryptocurrency market information through the Model Context Protocol.Last updated -62018MIT License
- AsecurityFlicenseAqualityA backend service that enables interaction with the Binance exchange API, allowing users to view their portfolio, convert tokens, and execute trades with minimal market impact.Last updated -1054
- -securityFlicense-qualityBackend service that enables users to connect with Binance exchange for viewing portfolio data, converting tokens, and executing trades with minimal market impact through the Model Context Protocol framework.Last updated -0
- -securityAlicense-qualityA server that enables interaction with Upbit cryptocurrency exchange API through Server-Sent Events, allowing users to access market data, manage accounts, execute trades, and perform technical analysis.Last updated -1MIT License