跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Binance,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 读取币安 (Binance) 的实时加密货币市场数据:每个交易对的现货价格和 24 小时涨跌、订单簿、最新成交和价格历史,以及 USD-M 合约的标记价格、资金费率、持仓量和多空比。公开数据,无需账户或密钥。只读:无法交易或转移资金。
试试这样问
Binance 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Binance、直接安装 (无需密钥)、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Binance + Gemini
让你的 AI 读取币安 (Binance) 的实时加密货币市场数据:每个交易对的现货价格和 24 小时涨跌、订单簿、最新成交和价格历史,以及 USD-M 合约的标记价格、资金费率、持仓量和多空比。公开数据,无需账户或密钥。只读:无法交易或转移资金。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
(无:公开数据,无需 API 密钥)
步骤 1 — 设置连接器
公开市场数据,无需密钥:无需任何设置。这个连接器从 Spot API 和 USD-M 合约 API 读取币安的公开市场数据。不需要币安账户、API 密钥或登录。
- 在连接器商店中选择 Binance 并安装。无需填写任何内容,也没有 Authorize with Provider 步骤。
- 用
binance_get_server_time检查:如果币安有响应,说明它为你的服务器所在地区提供服务。然后问一个价格:用BTCUSDT调用binance_get_price,就能知道一枚比特币现在值多少 Tether。
在哪里可用:币安会以 HTTP 451 拒绝来自美国和其他部分受限地区的请求。AnythingMCP Cloud 从欧盟调用币安,所以在 Cloud 上可以使用。位于受限地区的自托管服务器,每个工具都会收到 451。仅就现货数据而言,自托管服务器可以把连接器的基础 URL 指向币安的市场数据镜像 https://data-api.binance.vision,它提供相同的现货接口;合约工具始终调用 fapi.binance.com。Binance.US 是另一家交易所,有自己的价格,不在覆盖范围内。
按设计无法交易或转移资金:没有任何工具会下单或撤单,买入、卖出或兑换,或者划转、充值、提现任何资产,也没有可以打开的此类工具,因为连接器从不对请求签名,也从不接触币安账户。它也看不到任何人的余额、订单、持仓、成交或充值地址。查看你自己的账户,请使用币安应用或网站。
不构成投资建议:价格、成交量、资金费率和比率仅供参考。AI 不会建议你买入、卖出、持有、做多或做空。它会给出数字及其时间和来源,并提醒你加密货币价格波动很快,杠杆合约的亏损可能超过保证金。
可读取的内容:现货方面,一个、多个或全部交易对的价格,24 小时统计和 1 分钟到 7 天的滚动窗口统计,最优买价和卖价,订单簿,最新成交,K 线,以及交易对的交易规则,如最小价格变动和最小下单金额。USD-M 合约方面,最新成交价、24 小时统计、K 线、订单簿、标记价格和指数价格(含当前资金费率和下次资金结算时间)、历史资金费率、持仓量及其历史,以及账户多空比。合约列表还包括股票和大宗商品的永续合约以及季度交割合约。
为你说出的持仓估值:告诉 AI 你持有什么,例如 0.5 BTC 和 3 ETH。它会把每个数量乘以你所用计价资产的现货价格(BTCEUR、ETHEUR 或 USDT 交易对)并加总,同时说明所用价格的时间。USDT 和 USDC 是美元稳定币,接近但不完全等于 1 美元。
交易对代码:币安把交易对写成一个大写单词,基础资产在前:BTCUSDT(以 Tether 计价的比特币)、ETHBTC、BNBEUR。没有连字符,也没有斜杠。很多交易对并不存在(有 BTCEUR,但没有 SOLCHF),不存在的代码会返回 400 和代码 -1121。现货和合约是两个独立的市场,价格各不相同:合约里的 BTCUSDT 是永续合约,不是现货交易对。
数字和时间:价格以文本形式返回,以免丢失任何位数。时间是 UTC 的 Unix 毫秒,AI 会换算成你的时区。资金费率是每个结算周期的比例(0.0001 即 0.01 %),为正表示多头向空头支付。多空比统计的是账户数量,而不是持仓规模。持仓量历史和多空比只能查最近 30 天。
限制:币安按 IP 地址和请求权重限流:现货每分钟 6,000,合约每分钟 2,400,此外合约统计每 5 分钟 1,000 次请求,资金费率历史每 5 分钟 500 次。Cloud 服务器的所有用户共用一个 IP,所以 AI 会在一次调用中查询多个交易对,并尽量减少返回的数据量。遇到 429 时它会停下来等待;继续请求会导致 IP 被 HTTP 418 封禁 2 分钟到 3 天。
常见错误:400 且代码为 -1121 表示交易对不存在,-1100 或 -1102 表示参数格式错误或缺失。451 表示币安不为服务器所在地区提供服务。403 表示币安的防火墙拦截了请求,通常是触发了限流。遇到 429 和 418 时需要等待。
这个连接器不涉及任何需要币安账户或签名请求的功能(余额、订单、成交、持仓、杠杆倍数、划转、充值、提现、Earn、Convert、杠杆交易 (margin)),也不涉及 COIN-M 合约、期权、WebSocket 数据流或 Binance.US。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
Binance的工具。
可用工具
| Tool | What it does |
|---|---|
binance_get_server_time | Read Binance's current server time as Unix milliseconds (weight 1) |
binance_list_symbols | List the spot trading pairs that are trading on Binance right now (symbol names only, about 1,400, e.g |
binance_get_symbol_info | Read the trading rules of one Binance spot pair: status, base and quote asset, precisions, order types and filters such as tick size… |
binance_get_price | Read the latest spot price of one Binance pair, several pairs (symbols) or, with neither, every pair |
binance_get_24h_ticker | Read 24 hour statistics of Binance spot pairs: last price, change and change in percent, open, high, low, weighted average price, volume in… |
binance_get_rolling_ticker | Read price change statistics of Binance spot pairs over a window other than 24 hours, from 1 minute to 7 days: open, high, low, last price… |
binance_get_book_ticker | Read the best bid and best ask (price and quantity) of one Binance spot pair, several (symbols) or all |
binance_get_avg_price | Read the current average price of a Binance spot pair over the last few minutes (mins), the reference Binance uses for some order filters |
binance_get_order_book | Read the order book of a Binance spot pair: the best bids and asks as [price, quantity] pairs, best first. limit sets the levels per side… |
binance_get_recent_trades | Read the most recent public trades of a Binance spot pair: price, quantity in the base asset, value in the quote asset, time (Unix… |
binance_get_klines | Read price history of a Binance spot pair as candles (klines), oldest first: open time, open, high, low, close, volume in the base asset… |
binance_futures_list_symbols | List the USD-M futures contracts trading on Binance right now (symbol names only), grouped into crypto perpetuals, perpetuals on stocks… |
binance_futures_get_price | Read the latest traded price of one Binance USD-M futures contract, or of all with no symbol |
binance_futures_get_24h_ticker | Read 24 hour statistics of Binance USD-M futures contracts: last price, change in percent, open, high, low, weighted average price, volume… |
binance_futures_get_klines | Read price history of a Binance USD-M futures contract as candles (klines), oldest first: open time, open, high, low, close, volume, quote… |
binance_futures_get_mark_price | Read the mark price, index price and current funding rate of Binance USD-M perpetual contracts, with the time of the next funding (Unix… |
binance_futures_get_funding_rate_history | Read past funding rates of a Binance USD-M perpetual contract, oldest first: funding time (Unix milliseconds), fundingRate as a fraction… |
binance_futures_get_open_interest | Read the current open interest of a Binance USD-M futures contract: the number of open contracts in the base asset (BTC for BTCUSDT) and… |
binance_futures_get_open_interest_history | Read the open interest history of a Binance USD-M futures contract per period: sumOpenInterest in the base asset, sumOpenInterestValue in… |
binance_futures_get_long_short_ratio | Read the long/short account ratio of a Binance USD-M futures contract per period: the share of all accounts with a net long position… |
binance_futures_get_order_book | Read the order book of a Binance USD-M futures contract: the best bids and asks as [price, quantity] pairs, best first |
示例提示
- “比特币、以太坊和 Solana 现在值多少 USDT?过去 24 小时走势如何?”
- “我持有 0.5 BTC 和 3 ETH,现在值多少欧元?”
- “BTCUSDT 永续合约现在的资金费率是多少?过去一周有什么变化?”
- “现在哪些合约的资金费率最极端?”
- “按天显示 ETHUSDT 最近 7 天的持仓量和多空比。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?