Binance MCP 服务器
一种服务器实现,通过 WebSockets 实时流式传输 Binance 市场数据(现货和期货),使应用程序能够通过模型上下文协议接收和处理加密货币市场信息。
可用工具 (6 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
get_market_data 2 个参数 需填 2 项
Get comprehensive market data for a trading pair
必填参数:symbol、type
test_futures_endpoints 1 个参数 需填 1 项
Test individual futures endpoints
必填参数:symbol
get_futures_open_interest 1 个参数 需填 1 项
Get current open interest for a futures trading pair
必填参数:symbol
get_futures_funding_rate 1 个参数 需填 1 项
Get current funding rate for a futures trading pair
必填参数:symbol
get_klines 4 个参数 需填 3 项
Get historical candlestick data
必填参数:symbol、type、interval
subscribe_market_data 3 个参数 需填 3 项
Subscribe to real-time market data updates
必填参数:symbol、type、streams
服务介绍
Binance MCP 服务器
适用于币安市场数据的模型上下文协议 (MCP) 服务器实现,支持 WebSocket。
功能
- 通过 WebSocket 实时流式传输市场数据
- 同时支持现货和期货市场
- 带有指数退避的自动重连
- 类型安全的消息处理
- 全面的错误处理
安装
npm install
使用
启动服务器
npm start
WebSocket 流类型
支持以下流类型:
trade:实时交易数据ticker:24小时滚动窗口价格变动统计bookTicker:最优买/卖价格和数量kline:K线数据markPrice:标记价格和资金费率(仅限期货)fundingRate:资金费率数据(仅限期货)
在 Claude 桌面中的示例用法
// Subscribe to trade and ticker streams for BTC/USDT
await server.subscribe('BTCUSDT', 'spot', ['trade', 'ticker']);
// Handle incoming data
server.onStreamData('BTCUSDT', 'trade', (data) => {
console.log('New trade:', data);
});
开发
运行测试
npm test
构建
npm run build
许可证
私有