home / mcp / binance mcp server

Binance MCP Server

🤖 Binance交易所MCP服务 - 支持现货/期货/期权交易,为非技术用户提供安全易用的加密货币交易工具

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.git

Configure your Binance API keys and account settings using the interactive configuration command.

binance-mcp config

View configured accounts to verify setup.

binance-mcp list

Start 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 9002

Additional content and notes

Security 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.

Troubleshooting and tips

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.

Available tools

create_spot_order

Place a new spot order with specified symbol, side, amount, and price or type.

cancel_order

Cancel a specific active order by order id.

get_open_orders

Retrieve all currently open orders for an account.

get_order_status

Query the status of a single order by its id.

get_my_trades

Fetch the trade history for an account.

cancel_all_orders

Cancel all open orders for an account.

create_stop_loss_order

Create a stop loss order to manage downside risk.

create_take_profit_order

Create a take profit order to secure gains.

create_stop_limit_order

Create a stop loss with a price limit.

create_trailing_stop_order

Create a trailing stop order that follows price movement.

create_oco_order

Create an OCO (one-cancels-the-other) order.

get_ticker

Get the latest price for a trading pair.

get_order_book

Retrieve the order book depth for a trading pair.

get_klines

Fetch K-line (candlestick) data for analysis.

get_funding_rate

Obtain current funding rates for futures.

create_option_order

Place an options order (Call/Put) on supported markets.

get_option_chain

Retrieve available option contracts.

get_option_positions

Query current option positions.

get_option_info

Get detailed information about an option contract.

create_contract_order

Create a futures/contract order for leveraged trading.

close_position

Close all or selected futures positions.

get_futures_positions

Get detailed futures position information.

get_balance

Check available balances across accounts.

get_positions

View open positions in spot or futures.

set_leverage

Adjust leverage on a futures position.

set_margin_mode

Switch between margin modes (e.g., cross, isolated).

transfer_funds

Transfer funds between different accounts.

get_server_info

Retrieve current server status and configuration details.