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 priceget_market_stats- 24-hour market statisticsget_top_cryptocurrencies- Most traded cryptocurrenciesget_order_book- Buy/sell pricesget_candlestick_data- Candlestick chart dataget_klines_with_indicators- Technical analysis indicatorssearch_symbols- Cryptocurrency searchget_account_balance- Account balance (API required)
License
MIT License
Support
For questions, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
724287a113d8bd966e6f636be43121bdb9f1314427698e925eb66785a9a37557
|
|
| MD5 |
cee6eb0b68698ae3201b6c14b3759982
|
|
| BLAKE2b-256 |
24546199443b34a45defc0dd043f3e00132ffebe226cb532b01f222e69ad86f5
|
File details
Details for the file binance_context_server-1.1.0-py3-none-any.whl.
File metadata
- Download URL: binance_context_server-1.1.0-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
932fe6d71a7666b662483d2b7828f657b554bc34f6f89bc4d64a46905394e382
|
|
| MD5 |
1d0079505a8ce84fa8eea3189adc6e4c
|
|
| BLAKE2b-256 |
f976c57470cde3a9f3b1a5bc4c0060b002c8f8baf6de63d833e5732688cdbf55
|