Binance MCP Server
Provides read-only tools for Binance spot, USDT-M futures, margin accounts, deposits and withdrawals, portfolio distribution, and public market data such as prices, 24-hour statistics, and announcements; it does not execute trades, transfers, or withdrawals.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Binance MCP Server show my portfolio distribution across spot, margin, and futures accounts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ Binance MCP Server
A comprehensive Model Context Protocol (MCP) server for Binance, providing read-only access to your trading accounts, portfolio data, market information, and more through AI assistants like Claude.
โจ Features
This MCP server provides 20+ read-only tools across multiple categories:
๐ข Public Market Data
fetch_latest_announcements- Get latest Binance announcementsget_ticker_price- Current price for any symbol or all symbolsget_24hr_ticker- 24-hour statistics (price change, volume, high/low)
๐ผ Spot Account
get_account_info- Account balances, permissions, and commission ratesget_spot_open_orders- All open spot ordersget_spot_trade_history- Recent trade history for any symbol
๐ฏ USDT-M Futures
get_futures_account_balance- Futures wallet balance and active positionsget_futures_open_orders- All open futures ordersget_futures_income_history- Realized PnL, funding fees, commissions
๐ Margin Trading
get_margin_account- Cross margin account details and balancesget_isolated_margin_account- Isolated margin positions and margin levels
๐ Portfolio Overview
get_asset_distribution- Complete portfolio snapshot across all accounts
๐ฐ Deposits & Withdrawals
get_deposit_address- Get deposit addresses for any coin/networkget_deposit_history- View deposit transaction historyget_withdraw_history- View withdrawal transaction history
Related MCP server: Binance Cryptocurrency MCP
โก Quick Start
# 1. Clone and install
git clone <your-repo-url>
cd binance-mcp
uv sync
# 2. Configure API keys
cp .env.example .env
# Edit .env with your Binance API keys
# 3. Test it locally with inspector UI
uv run fastmcp dev main.py
# 4. Add to Claude Desktop config (see Integration section below)๐ง Installation
Prerequisites
Python 3.11 or higher
A Binance account with API access
uv (recommended) or pip
Step 1: Clone and Install Dependencies
# Clone the repository
git clone <your-repo-url>
cd binance-mcp
# Install dependencies with uv (recommended)
uv sync
# Or with pip
pip install -e .Step 2: Create Binance API Keys
Log in to Binance
Go to Profile โ API Management
Create a new API key
Important: Only enable "Enable Reading" permission (read-only)
Save your API Key and Secret Key securely
Step 3: Configure Environment Variables
Create a .env file in the project root:
cp .env.example .envEdit .env and add your API credentials:
BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_api_secret_here
BINANCE_ENVIRONMENT=productionNote: Never commit your
.envfile to version control. It's already in.gitignore.
๐ฏ Usage
Running Locally
Method 1: Using FastMCP (Recommended)
# Development mode with auto-reload and inspector UI
uv run fastmcp dev main.py
# Production mode
uv run fastmcp run main.pyDevelopment mode provides:
๐ Auto-reload on file changes
๐ Web inspector UI at http://localhost:5173
๐ Real-time tool testing and debugging
Method 2: Using Python Directly
# Activate virtual environment (if using uv)
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Run the MCP server
python main.pyIntegrating with Claude Desktop
Add this to your Claude Desktop configuration file:
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%\Claude\claude_desktop_config.json
Method 1: Using FastMCP with UV (Recommended)
{
"mcpServers": {
"binance": {
"command": "uv",
"args": [
"--directory",
"C:/Users/YourUsername/Documents/code/MCP/binance-mcp",
"run",
"fastmcp",
"run",
"main.py"
]
}
}
}Note: Make sure the
.envfile is in the project directory. Theuv run fastmcp runcommand will automatically handle dependencies and environment setup.
Method 2: Using Python Directly
{
"mcpServers": {
"binance": {
"command": "python",
"args": [
"C:/Users/YourUsername/Documents/code/MCP/binance-mcp/main.py"
],
"env": {
"BINANCE_API_KEY": "your_api_key_here",
"BINANCE_API_SECRET": "your_api_secret_here",
"BINANCE_ENVIRONMENT": "production"
}
}
}
}Method 3: Using UV without FastMCP
{
"mcpServers": {
"binance": {
"command": "uv",
"args": [
"--directory",
"C:/Users/YourUsername/Documents/code/MCP/binance-mcp",
"run",
"python",
"main.py"
]
}
}
}Restart Claude Desktop
After updating the configuration, completely quit and restart Claude Desktop for changes to take effect.
๐งช Testing the Server
Before integrating with Claude Desktop, you can test the server locally:
# Start development server with inspector UI
uv run fastmcp dev main.pyThis will:
Start the MCP server
Open a web inspector at
http://localhost:5173Allow you to test all tools interactively
Auto-reload when you make code changes
Inspector Features:
๐ List all available tools
๐ง Test tools with custom parameters
๐ See real-time request/response data
๐ Debug issues before deploying to Claude
๐ Example Queries
Once integrated with Claude, you can ask:
"What's my current portfolio across all accounts?"
"Show me my open orders on futures"
"What's the current price of BTCUSDT?"
"Get my spot trading history for ETHUSDT"
"Show me my recent futures PnL"
"What are the latest Binance announcements?"
"Check my margin account status"
"Show my deposit history for the last 20 transactions"
๐ Security Best Practices
Read-Only Keys: Only enable "Enable Reading" permission on your API keys
Never Share: Keep your API keys private and never commit them to version control
IP Whitelist: Consider restricting API key access to specific IP addresses in Binance settings
Regular Rotation: Periodically rotate your API keys for enhanced security
Monitor Usage: Regularly check your API key usage in Binance
๐ Testnet Support
To use Binance Testnet for testing:
Create testnet API keys at Binance Testnet
Set
BINANCE_ENVIRONMENT=testnetin your.envfile
๐ ๏ธ Development
Project Structure
binance-mcp/
โโโ main.py # Main MCP server with all tools
โโโ pyproject.toml # Project dependencies
โโโ .env # Your API credentials (not committed)
โโโ .env.example # Example environment file
โโโ .gitignore # Git ignore rules
โโโ LICENSE # MIT License
โโโ README.md # This fileDevelopment Workflow
# 1. Install dependencies
uv sync
# 2. Create .env file with your API keys
cp .env.example .env
# Edit .env with your actual keys
# 3. Start development server
uv run fastmcp dev main.py
# 4. Open the inspector UI (opens automatically)
# http://localhost:5173
# 5. Make changes to main.py - server auto-reloads!Useful Commands
# Development mode (with inspector & auto-reload)
uv run fastmcp dev main.py
# Production mode (for Claude Desktop)
uv run fastmcp run main.py
# Install new dependencies
uv add package-name
# Update dependencies
uv sync
# Run linting (if configured)
uv run ruff check main.pyAdding New Tools
To add a new tool, use the @mcp.tool() decorator:
@mcp.tool()
async def your_new_tool(param: str) -> str:
"""
Description of your tool.
Args:
param: Description of parameter
Returns:
Markdown formatted result
"""
# Your implementation
return "Result in Markdown format"After adding a tool:
The dev server will auto-reload
Test it in the inspector UI
Restart Claude Desktop to use it there
๐ API Rate Limits
Binance has rate limits on API requests:
Spot: 1200 requests per minute
Futures: 2400 requests per minute
Other endpoints: Varies by endpoint
This server respects these limits. Avoid making excessive requests in a short time.
This server is READ-ONLY and cannot execute trades, transfers, or withdrawals.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License Summary:
โ Commercial use
โ Modification
โ Distribution
โ Private use
โ ๏ธ No liability
โ ๏ธ No warranty
๐ Troubleshooting
"API keys not configured" error
Ensure your
.envfile exists and contains valid API credentialsCheck that environment variables are loaded correctly
"Signature verification failed" error
Verify your API secret is correct
Ensure your system clock is synchronized (Binance API requires accurate time)
"Permission denied" errors
Confirm "Enable Reading" permission is enabled on your API key
Some endpoints may require additional permissions
Connection errors
Check your internet connection
Verify you're not behind a restrictive firewall
Try using testnet to isolate issues
๐ Support
For issues and questions:
Check the Binance API Documentation
Review closed issues in this repository
Open a new issue with details about your problem
Happy Trading! ๐
Available Tools
15 toolsfetch_latest_announcementsA
Fetch the latest Binance announcements in Markdown format.
Args: count: Number of announcements to fetch (max 20) page: Page number to fetch (default 1)
Returns: Markdown formatted string with announcement titles, URLs, and timestamps
Inputs: page, count. Returns: result
get_24hr_tickerB
Get 24-hour price change statistics for a symbol.
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT')
Returns: Markdown formatted 24hr statistics
Inputs: symbol (required). Returns: result
get_account_infoA
Get current spot account information including balances and permissions.
Returns: Markdown formatted account information
Inputs: no named parameters. Returns: result
get_asset_distributionA
Get a portfolio distribution snapshot showing asset allocation across spot, futures, and margin accounts.
Returns: Markdown formatted portfolio distribution
Inputs: no named parameters. Returns: result
get_deposit_addressB
Get deposit address for a specific coin and network.
Args: coin: Coin name (e.g., 'BTC', 'ETH', 'USDT') network: Network name (e.g., 'BTC', 'ETH', 'TRX'). If None, returns all networks
Returns: Markdown formatted deposit address information
Inputs: coin (required), network. Returns: result
get_deposit_historyA
Get deposit history for all coins or a specific coin.
Args: coin: Coin name (e.g., 'BTC', 'ETH'). If None, returns all coins status: 0=pending, 1=success, 6=credited but cannot withdraw. If None, returns all statuses limit: Number of records to fetch (default 10, max 1000)
Returns: Markdown formatted deposit history
Inputs: coin, limit, status. Returns: result
get_futures_account_balanceA
Get USDT-M Futures account balance and positions.
Returns: Markdown formatted futures account information
Inputs: no named parameters. Returns: result
get_futures_income_historyA
Get futures income history (realized PnL, funding fees, commissions, etc.).
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT'). If None, returns all symbols income_type: Type of income (TRANSFER, WELCOME_BONUS, REALIZED_PNL, FUNDING_FEE, COMMISSION, etc.) limit: Number of records to fetch (default 20, max 1000)
Returns: Markdown formatted income history
Inputs: limit, symbol, income_type. Returns: result
get_futures_open_ordersA
Get all open futures orders for a symbol or all symbols.
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT'). If None, returns all open orders
Returns: Markdown formatted list of open futures orders
Inputs: symbol. Returns: result
get_isolated_margin_accountA
Get isolated margin account details for all symbols or a specific symbol.
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT'). If None, returns all isolated margin accounts
Returns: Markdown formatted isolated margin account information
Inputs: symbol. Returns: result
get_margin_accountA
Get cross margin account details including balances and margin level.
Returns: Markdown formatted margin account information
Inputs: no named parameters. Returns: result
get_spot_open_ordersA
Get all open spot orders for a symbol or all symbols.
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT'). If None, returns all open orders
Returns: Markdown formatted list of open orders
Inputs: symbol. Returns: result
get_spot_trade_historyB
Get recent spot trade history for a symbol.
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT') limit: Number of trades to fetch (default 10, max 1000)
Returns: Markdown formatted trade history
Inputs: symbol (required), limit. Returns: result
get_ticker_priceA
Get current price ticker for a symbol or all symbols.
Args: symbol: Trading pair symbol (e.g., 'BTCUSDT'). If None, returns all symbols
Returns: Markdown formatted price information
Inputs: symbol. Returns: result
get_withdraw_historyA
Get withdrawal history for all coins or a specific coin.
Args: coin: Coin name (e.g., 'BTC', 'ETH'). If None, returns all coins status: 0=email sent, 1=cancelled, 2=awaiting approval, 3=rejected, 4=processing, 5=failure, 6=completed limit: Number of records to fetch (default 10, max 1000)
Returns: Markdown formatted withdrawal history
Inputs: coin, limit, status. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 15 tools
Most tools are cleanly separated by resource + market type (spot vs futures vs margin) and by data kind (orders, history, balance, ticker). The only soft overlaps are get_account_info vs get_asset_distribution vs get_margin_account, but the descriptions make the distinction (raw spot balances vs cross-account allocation snapshot vs margin-specific) reasonably clear.
Nearly every tool follows a get_<domain>_<resource> snake_case pattern (get_spot_open_orders, get_futures_income_history, get_deposit_address). The single outlier is fetch_latest_announcements, which breaks the get_ verb convention but remains readable and unambiguous.
15 tools is within a reasonable range and each maps to a distinct data view (spot, futures, margin, funding, market data, announcements). A few pairs are near-mirrors (spot vs futures open orders, deposit vs withdraw history) but they cover genuinely different endpoints.
The surface is thorough on the read/monitoring side but has no write operations at all: no place/cancel order, no transfer between accounts, no withdraw execution. It also lacks common market data like order book depth or klines, so an agent trying to act (not just observe) will hit dead ends.
Maintenance
Related MCP Connectors
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Read-only access to your own crypto portfolio across 11+ exchanges and 20+ chains: holdings, full history, FIFO cost basis and P&L, fees and income. Ask Claude or ChatGPT about your portfolio; the connector can never trade, move funds or act as a login.
Read-only MetaTrader 5 for AI agents: balances, positions, history and prices. Sign in with OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with OKX trading accounts through read-only access to retrieve portfolio information, trading positions, order history, and account analytics. Provides secure, local processing of trading data without storing sensitive information or enabling trade execution.54MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to access real-time Binance cryptocurrency market data including prices, order books, candlestick charts, trading history, and 24-hour statistics through natural language queries.Apache 2.0
- AlicenseDqualityDmaintenanceEnables AI agents to access real-time Binance cryptocurrency market data including prices, order books, candlestick charts, trading history, and 24-hour statistics through natural language queries.12Apache 2.0
- AlicenseAqualityCmaintenanceEnables Claude to query Binance Spot market data, account balances, and execute trades via natural language, with withdrawals disabled by default for security.11MIT