Skip to main content

Binance MCP Server for cryptocurrency market data and trading

Project description

Binance Context Server

MCP (Model Context Protocol) server for accessing Binance cryptocurrency data. Provides real-time price data, technical analysis, and market statistics.

Features

  • 📊 Real-time price data - Current prices for all cryptocurrency trading pairs
  • 📈 Technical analysis - Technical indicators like RSI, SMA
  • 📋 Market statistics - 24-hour changes, volume, high/low prices
  • 🔍 Search and filtering - Cryptocurrency search and category filtering
  • Fast access - Direct connection to Binance API

Installation

1. Install from PyPI (Recommended)

pip install binance-context-server

2. Install from Source

git clone https://github.com/hocestnonsatis/binance-context-server.git
cd binance-context-server
pip install -e .

Configuration

1. Environment Variables (Optional)

cp env.example .env

Edit the .env file:

BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_api_secret_here
BINANCE_TESTNET=false
LOG_LEVEL=INFO

Note: API keys are only required for account operations. Not needed for public data.

Usage

Running the Server

python -m binance_context_server.server

Using with MCP Clients

This server supports the MCP protocol and can be used with any MCP-compatible client.

Basic Examples

Using with Python:

from binance_context_server import BinanceClientWrapper
import asyncio

async def main():
    client = BinanceClientWrapper()
    
    # Bitcoin price
    btc_price = await client.get_symbol_price(symbol="BTCUSDT")
    print(f"BTC: ${float(btc_price['price']):,.2f}")
    
    # Market statistics
    stats = await client.get_ticker_24hr(symbol="ETHUSDT")
    if stats:
        eth = stats[0]
        print(f"ETH: ${float(eth.lastPrice):,.2f}")

asyncio.run(main())

MCP Tool calls:

# Price data
await tools.call_tool("get_crypto_price", {"symbol": "BTCUSDT"})
await tools.call_tool("get_market_stats", {"symbol": "ETHUSDT"})

# Technical analysis
await tools.call_tool("get_klines_with_indicators", {
    "symbol": "BTCUSDT", 
    "interval": "1h", 
    "limit": 100
})

# Search
await tools.call_tool("search_symbols", {"query": "bitcoin"})

IDE Configuration

MCP Settings for Cursor/VS Code

Add the following configuration to your settings.json file:

{
  "mcpServers": {
    "binance-context-server": {
      "command": "python",
      "args": ["-m", "binance_context_server.server"],
      "env": {
        "BINANCE_API_KEY": "your_api_key_here",
        "BINANCE_API_SECRET": "your_api_secret_here"
      }
    }
  }
}

Available Tools

  • get_crypto_price - Cryptocurrency price
  • get_market_stats - 24-hour market statistics
  • get_top_cryptocurrencies - Most traded cryptocurrencies
  • get_order_book - Buy/sell prices
  • get_candlestick_data - Candlestick chart data
  • get_klines_with_indicators - Technical analysis indicators
  • search_symbols - Cryptocurrency search
  • get_account_balance - Account balance (API required)

License

MIT License

Support

For questions, please open an issue on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binance_context_server-1.1.0.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binance_context_server-1.1.0-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file binance_context_server-1.1.0.tar.gz.

File metadata

  • Download URL: binance_context_server-1.1.0.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for binance_context_server-1.1.0.tar.gz
Algorithm Hash digest
SHA256 724287a113d8bd966e6f636be43121bdb9f1314427698e925eb66785a9a37557
MD5 cee6eb0b68698ae3201b6c14b3759982
BLAKE2b-256 24546199443b34a45defc0dd043f3e00132ffebe226cb532b01f222e69ad86f5

See more details on using hashes here.

File details

Details for the file binance_context_server-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for binance_context_server-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 932fe6d71a7666b662483d2b7828f657b554bc34f6f89bc4d64a46905394e382
MD5 1d0079505a8ce84fa8eea3189adc6e4c
BLAKE2b-256 f976c57470cde3a9f3b1a5bc4c0060b002c8f8baf6de63d833e5732688cdbf55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page