๐ 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
โก Quick Start
๐ง Installation
Prerequisites
Python 3.11 or higher
A Binance account with API access
uv (recommended) or pip
Step 1: Clone and Install Dependencies
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:
Edit .env and add your API credentials:
Note: Never commit your
.envfile to version control. It's already in.gitignore.
๐ฏ Usage
Running Locally
Method 1: Using FastMCP (Recommended)
Development 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
Integrating 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)
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
Method 3: Using UV without FastMCP
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:
This 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
Development Workflow
Useful Commands
Adding New Tools
To add a new tool, use the @mcp.tool() decorator:
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! ๐
This server cannot be installed
This is binance mcp server to get the portfolio details and is ready only