The binance-mcp server is a Model Context Protocol (MCP) server that provides programmatic access to Binance Spot exchange data and trading functionality through standardized tools.
Market Data (Public)
Retrieve real-time ticker prices for any trading symbol
Fetch historical klines/candlestick data with customizable intervals and limits (1-1000 candles) for technical analysis
Access comprehensive exchange metadata including trading rules, symbol filters, and specifications
Account Management (Requires API Key)
View account balances across all assets
List open orders for specific trading symbols
Trading Operations (Requires API Key + BINANCE_TRADE_ENABLED)
Place MARKET or LIMIT spot orders (BUY/SELL) with configurable parameters like quantity, price, quote amount, and time-in-force settings
Cancel existing orders by symbol and order ID
Safety & Security Features
Protected by
BINANCE_TRADE_ENABLEDenvironment variable toggle for read-only modeConfigurable recvWindow parameter to prevent replay attacks
Support for both mainnet and testnet Binance environments for risk-free testing
Deployment & Integration
Supports stdio (default) and HTTP transports for local agent integration or web inspection
Compatible with Docker containerization and tools like Glama
JSON-formatted responses optimized for LLM and AI agent consumption
Provides tools for accessing Binance Spot REST API, including market data (ticker prices, klines, exchange info), account management (balances, open orders), and trading operations (place and cancel orders) with configurable safety controls.
binance-mcp
Binance Spot REST MCP server providing market data, account state, and guarded trading tools. Built with FastMCP so it can run over stdio (local agents) or HTTP (Glama inspection / Docker deployments).
Features
Latest ticker price, klines, and
exchangeInfofor any symbol.Account tools (balances, open orders) with recvWindow helper.
Trading helpers (place/cancel) protected by
BINANCE_TRADE_ENABLEDtoggle.Works with Glama thanks to HTTP transport +
glama.yaml/Dockerfilemetadata.
Getting started
Install dependencies (Node 20+ recommended):
npm installCopy the example env file and fill in your Binance key/secret (testnet keys work too):
cp .env.example .env # BINANCE_TRADE_ENABLED=false keeps the server in read-only modeBuild + run (stdio transport by default):
npm run build npm startDevelopment / watch mode:
npm run dev
HTTP transport
Set MCP_TRANSPORT=http and optionally PORT to expose the tools over HTTP (required for Glama inspection):
The provided Dockerfile bakes this configuration automatically.
Tools
name | description |
| Latest ticker price for a symbol. |
| Candles (symbol + interval, configurable limit). |
| Full exchange metadata + filters. |
| Account snapshot (requires API key/secret). |
| Open orders for a symbol. |
| Places MARKET/LIMIT orders with guardrails. |
| Cancels an order by symbol + orderId. |
All tools return JSON payloads stringified for LLM consumption.
Environment variables
key | description |
| Required for account/trade tools (public tools work without). |
| Required for account/trade tools. |
| Defaults to |
| RecvWindow in ms (default |
| Set to |
|
|
| HTTP port when using |
Glama & Docker
glama.yaml/glama.jsondefine build/start commands and required env vars.Dockerfilebuilds a production image, exposes port8080, and defaults to HTTP transport for inspection support.
License
Released under the MIT License (see LICENSE).