MCP server/ai-tools

Binance MCP Server

Automated cryptocurrency trading on Binance and Base network integration.

jordy33/binance_mcp ↗by jordy33updated
Manual setup required. The maintainer's config contains paths only you know - edit the placeholders below before adding it to Claude Code.
1

Prepare the server locally

Run this once before adding it to Claude Code.

git clone https://github.com/jordy33/binance_mcp
cd binance_mcp

Then follow the repository README for any remaining dependency or build steps.

2

Register it in Claude Code

claude mcp add -e "BINANCE_API_KEY=${BINANCE_API_KEY}" -e "BINANCE_SECRET_KEY=${BINANCE_SECRET_KEY}" binance-mcp-3b6d -- python /path/to/binance_mcp/mcp_server.py

Replace any placeholder paths in the command with the real path on your machine.

Required:BINANCE_API_KEYBINANCE_SECRET_KEY
3

Make your agent remember this setup

binance-mcp-3b6d's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Automated trading tools for Binance including order placement and leverage adjustment.
  • Built-in technical analysis indicators like RSI, MACD, and Bollinger Bands.
  • Base network integration for monitoring blockchain health and gas prices.
  • Secure API handling via environment variables.
  • Integrated logging system for debugging trading operations.

Tools 9

get_account_balanceGet balance for a specific asset.
get_market_priceGet current market price.
fetch_chart_dataFetch historical OHLCV data.
calculate_indicatorsCalculate technical indicators (RSI, MACD, Bollinger Bands, etc.).
get_symbol_rulesGet trading rules and precision requirements.
adjust_leverageAdjust leverage for futures trading.
place_orderPlace a market order.
get_base_network_statusCheck Base network health (block number, gas price).
read_bot_logsRead bot logs for debugging.

Environment Variables

BINANCE_API_KEYrequiredYour Binance API key
BINANCE_SECRET_KEYrequiredYour Binance secret key

Try it

What is the current balance of my USDT in my Binance account?
Calculate the RSI and MACD for BTCUSDT over the last 100 hours.
Place a market buy order for 0.001 BTCUSDT.
Check the current gas price and block status on the Base network.
Read the last 20 lines of the general bot logs to check for errors.
Original README from jordy33/binance_mcp

Binance MCP Server

A Model Context Protocol (MCP) server for cryptocurrency trading on Binance and Base network interactions. This server provides tools for automated trading, market analysis, and blockchain operations.

Features

  • Binance Trading Tools: Place orders, check balances, fetch market data, and calculate technical indicators.
  • Base Network Integration: Monitor blockchain status and prepare for DeFi operations.
  • Technical Analysis: Built-in RSI, MACD, Bollinger Bands, and moving averages.
  • Secure API Handling: Environment variables for API keys.

Installation

  1. Clone or navigate to the project directory.

  2. Create a virtual environment:

    python3 -m venv .venv
    
  3. Activate the virtual environment:

    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  4. Upgrade pip and install dependencies:

    pip install --upgrade pip
    pip install -r requirements.txt
    

Environment Variables

Create a .env file in the root directory with your API credentials:

# Binance API Configuration
BINANCE_API_KEY=your_binance_api_key_here
BINANCE_SECRET_KEY=your_binance_secret_key_here

Security Note: Never commit the .env file to version control. It is already included in .gitignore.

Running the MCP Server

Start the server with Server-Sent Events (SSE) transport:

python mcp_server.py

The server will run on http://127.0.0.1:8080/sse by default.

Available Tools

The MCP server exposes the following tools for integration with AI agents:

Trading Tools

  • get_account_balance(asset="USDT"): Get balance for a specific asset.
  • get_market_price(symbol="BTCUSDT"): Get current market price.
  • fetch_chart_data(symbol="BTCUSDT", interval="1h", limit=100): Fetch historical OHLCV data.
  • calculate_indicators(symbol="BTCUSDT", interval="1h", limit=100): Calculate technical indicators (RSI, MACD, Bollinger Bands, etc.).
  • get_symbol_rules(symbol="BTCUSDT"): Get trading rules and precision requirements.
  • adjust_leverage(symbol="BTCUSDT", leverage=5): Adjust leverage for futures trading.
  • place_order(symbol="BTCUSDT", side="BUY", quantity=0.001): Place a market order.

Blockchain Tools

  • get_base_network_status(): Check Base network health (block number, gas price).

Utility Tools

  • read_bot_logs(lines=20, log_type="general"): Read bot logs for debugging.

Testing

Run the tests to verify functionality:

python -m pytest tests/

Or run a specific test:

python tests/test_mcp_registration.py

Configuration

Trading parameters can be adjusted in config.py:

  • TRADING_PAIRS: List of symbols to trade.
  • MIN_ORDER_VALUE: Minimum order value in USDT.
  • STOP_LOSS_PERCENTAGE: Stop loss percentage.
  • TAKE_PROFIT_PERCENTAGE: Take profit percentage.
  • POLLING_INTERVAL: Time between checks (in seconds).

Security Considerations

  • Use testnet for initial testing.
  • Implement proper risk management.
  • Monitor API rate limits.
  • Keep API keys secure and rotate regularly.

Contributing

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes.
  4. Add tests for new functionality.
  5. Submit a pull request.

License

This project is licensed under the MIT License.

Frequently Asked Questions

What are the key features of Binance MCP Server?

Automated trading tools for Binance including order placement and leverage adjustment.. Built-in technical analysis indicators like RSI, MACD, and Bollinger Bands.. Base network integration for monitoring blockchain health and gas prices.. Secure API handling via environment variables.. Integrated logging system for debugging trading operations..

What can I use Binance MCP Server for?

Automating market entry and exit strategies based on technical indicators.. Monitoring portfolio balances across different crypto assets in real-time.. Tracking Base network performance to optimize DeFi transaction timing.. Debugging automated trading bot performance using integrated log reading tools..

How do I install Binance MCP Server?

Install Binance MCP Server by running: python mcp_server.py

What MCP clients work with Binance MCP Server?

Binance MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep Binance MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest