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.
Metadata
Release files for binance-context-server 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binance_context_server-1.1.0.tar.gz | 28.3 kB | Without provenance | Details for binance_context_server-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| binance_context_server-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for binance_context_server-1.1.0-py3-none-any.whl |
Total release size: 55.8 kB
Release files / binance_context_server-1.1.0.tar.gz
| Download URL | binance_context_server-1.1.0.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
724287a113d8bd966e6f636be43121bdb9f1314427698e925eb66785a9a37557
|
|
BLAKE2b-256 checksum How to use checksums |
24546199443b34a45defc0dd043f3e00132ffebe226cb532b01f222e69ad86f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / binance_context_server-1.1.0-py3-none-any.whl
| Download URL | binance_context_server-1.1.0-py3-none-any.whl |
|---|---|
| Size | 27.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
932fe6d71a7666b662483d2b7828f657b554bc34f6f89bc4d64a46905394e382
|
|
BLAKE2b-256 checksum How to use checksums |
f976c57470cde3a9f3b1a5bc4c0060b002c8f8baf6de63d833e5732688cdbf55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for binance-context-server 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.