home / mcp / binance mcp server
🤖 Binance交易所MCP服务 - 支持现货/期货/期权交易,为非技术用户提供安全易用的加密货币交易工具
Configuration
View docs{
"mcpServers": {
"shanrichard-binance-mcp": {
"command": "python",
"args": [
"-m",
"binance_mcp.simple_server"
],
"env": {
"YOUR_PASSPHRASE": "S3cureP@ss"
}
}
}
}You can run a Binance MCP Server to empower AI agents to safely and efficiently perform spot, futures, and options trading through Binance, with local key storage, multi-account support, and a complete MCP toolset that covers trading, risk management, data, and account operations.
You will start by running a local MCP server and then connect your MCP client or AI framework to it. Once connected, you can invoke tools to place orders, fetch market data, manage risk, and monitor your accounts. The server is designed to be secure, with local encryption for API keys and support for multiple accounts in separate environments.
Steps you will typically follow are: install the server package, configure your Binance API keys, start the server, and then connect your MCP client to the running server. After that, you can issue commands through your client or AI assistant to perform trades, check balances, or retrieve market data.
Prerequisites you need before installing are Python 3.x and the pip package manager. You will install the MCP package from its repository and then configure your accounts.
pip install git+https://github.com/shanrichard/binance-mcp.gitConfigure your Binance API keys and account settings using the interactive configuration command.
binance-mcp configView configured accounts to verify setup.
binance-mcp listStart the MCP server in the foreground to see logs, or run in the background for production use.
# Foreground with logs
binance-mcp start
# Background (detached)
binance-mcp start -d
# Optional: specify a custom port
binance-mcp start --port 9002Security and multi-account management are core features. API keys are stored locally with encryption, and access is restricted to the minimum permissions required. You can manage multiple accounts for spot, futures, and sandbox environments without mixing data.
If you encounter issues starting the server or connecting clients, ensure the port you intend to use is not already in use and that your API keys have the necessary permissions.
Common checks include confirming the server is running, restarting client tools, and validating that configuration reflects the correct account types and environments.
Place a new spot order with specified symbol, side, amount, and price or type.
Cancel a specific active order by order id.
Retrieve all currently open orders for an account.
Query the status of a single order by its id.
Fetch the trade history for an account.
Cancel all open orders for an account.
Create a stop loss order to manage downside risk.
Create a take profit order to secure gains.
Create a stop loss with a price limit.
Create a trailing stop order that follows price movement.
Create an OCO (one-cancels-the-other) order.
Get the latest price for a trading pair.
Retrieve the order book depth for a trading pair.
Fetch K-line (candlestick) data for analysis.
Obtain current funding rates for futures.
Place an options order (Call/Put) on supported markets.
Retrieve available option contracts.
Query current option positions.
Get detailed information about an option contract.
Create a futures/contract order for leveraged trading.
Close all or selected futures positions.
Get detailed futures position information.
Check available balances across accounts.
View open positions in spot or futures.
Adjust leverage on a futures position.
Switch between margin modes (e.g., cross, isolated).
Transfer funds between different accounts.
Retrieve current server status and configuration details.