Binance MCP Server
Enables Claude to query Binance Spot market data, account balances, and execute trades via natural language, with withdrawals disabled by default for security.
README
Binance MCP Server
Servidor MCP (Model Context Protocol) que le da a Claude (u otro cliente MCP) acceso a la REST API de Binance Spot: consultar precios, velas, balances, y operar — con los retiros desactivados por defecto por seguridad.
An MCP server that gives Claude (or any MCP client) access to the Binance Spot REST API: prices, candlesticks, balances, and trading — with withdrawals disabled by default for safety.
🇪🇸 Español
¿Qué es esto?
Un servidor MCP en Python que expone la API de Binance Spot como herramientas (tools) que un modelo como Claude puede invocar en lenguaje natural. Le preguntas "¿a cuánto está el BTC?" o "compra 0.01 ETH" y el modelo llama a la herramienta correspondiente.
Seguridad primero 🔒
Mover dinero con un LLM es delicado, así que el servidor está diseñado a la defensiva:
- Retiros desactivados a nivel de código.
withdrawno hace nada salvo que pongasENABLE_WITHDRAWALS=truey la API key tenga permiso de retiro. La recomendación es no dárselo. - Testnet por defecto (
BINANCE_TESTNET=true): prueba contra el entorno de pruebas de Binance antes de tocar fondos reales. - Firma HMAC SHA256 en cada request privado, igual que exige Binance.
- Recomendado: crear la API key sin permiso de retiro y con IP whitelist.
Herramientas disponibles
| Herramienta | Tipo | Descripción |
|---|---|---|
get_price |
pública | Precio actual de un símbolo (BTCUSDT) |
get_24h_stats |
pública | Estadísticas 24h: volumen, cambio %, máx/mín |
get_klines |
pública | Velas / candlesticks (1m…1w) |
get_order_book |
pública | Libro de órdenes (bids/asks) |
get_account |
firmada | Balances y permisos de tu cuenta spot |
get_open_orders |
firmada | Órdenes abiertas |
get_my_trades |
firmada | Tu historial de trades |
place_order |
firmada | Crea orden MARKET o LIMIT |
cancel_order |
firmada | Cancela una orden por orderId |
cancel_all_orders |
firmada | Cancela todas las órdenes de un símbolo |
withdraw |
firmada | Retiro (desactivado por defecto) |
Instalación
Requiere uv (gestor de paquetes de Python).
git clone https://github.com/Lubodi-Code/binance-mcp.git
cd binance-mcp
uv sync
Configuración
Copia .env.example a .env y rellena tus claves de Binance:
cp .env.example .env
BINANCE_API_KEY=tu_api_key
BINANCE_API_SECRET=tu_secret
BINANCE_TESTNET=true # empieza siempre en testnet
ENABLE_WITHDRAWALS=false # no lo cambies salvo que sepas lo que haces
Para el testnet de spot, genera tus claves en https://testnet.binance.vision
Conectarlo a Claude Desktop
Añade esto a tu claude_desktop_config.json:
{
"mcpServers": {
"binance": {
"command": "uv",
"args": ["--directory", "/ruta/absoluta/a/binance-mcp", "run", "server.py"],
"env": {
"BINANCE_API_KEY": "tu_api_key",
"BINANCE_API_SECRET": "tu_secret",
"BINANCE_TESTNET": "true"
}
}
}
}
Reinicia Claude Desktop y pídele, por ejemplo: "¿a cuánto está el BTC y cómo se movió en las últimas 24h?"
🇬🇧 English
What is this?
A Python MCP server that exposes the Binance Spot API as tools an LLM like Claude can call from natural language. Ask "what's the BTC price?" or "buy 0.01 ETH" and the model invokes the right tool.
Safety first 🔒
Moving money with an LLM is risky, so the server is defensive by design:
- Withdrawals disabled in code.
withdrawis a no-op unless you setENABLE_WITHDRAWALS=trueand the API key has withdraw permission. The recommendation is not to grant it. - Testnet by default (
BINANCE_TESTNET=true): test against Binance's sandbox before touching real funds. - HMAC SHA256 signing on every private request, as Binance requires.
- Recommended: create the API key without withdraw permission and with an IP whitelist.
Available tools
| Tool | Type | Description |
|---|---|---|
get_price |
public | Current price of a symbol (BTCUSDT) |
get_24h_stats |
public | 24h stats: volume, % change, high/low |
get_klines |
public | Candlesticks (1m…1w) |
get_order_book |
public | Order book (bids/asks) |
get_account |
signed | Spot account balances & permissions |
get_open_orders |
signed | Open orders |
get_my_trades |
signed | Your trade history |
place_order |
signed | Create a MARKET or LIMIT order |
cancel_order |
signed | Cancel an order by orderId |
cancel_all_orders |
signed | Cancel all orders for a symbol |
withdraw |
signed | Withdraw (disabled by default) |
Install
Requires uv.
git clone https://github.com/Lubodi-Code/binance-mcp.git
cd binance-mcp
uv sync
cp .env.example .env # then fill in your keys
Run
uv run server.py
Then wire it into Claude Desktop's claude_desktop_config.json (see the Spanish section above for the exact config block).
⚠️ Disclaimer
Este proyecto es educativo. Operar con criptomonedas conlleva riesgo financiero. El autor no se hace responsable de pérdidas. Úsalo bajo tu propia responsabilidad y empieza siempre en testnet.
This project is for educational purposes. Crypto trading carries financial risk. The author is not liable for any losses. Use at your own risk and always start on testnet.
Stack
Python 3.10+ · MCP SDK (FastMCP) · httpx · uv
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。