xchange-mcp
Provides Binance spot and derivatives trading capabilities through xchange, including balance and position queries, order placement and cancellation, leverage settings, market data, and PnL retrieval.
Provides KuCoin exchange capabilities through xchange, including account balance and position queries, order creation and cancellation, trade history, and market data access.
Provides OKX exchange capabilities through xchange, including spot and derivatives session setup, ticker/order book/OHLCV market data, balance and position checks, order management, and PnL retrieval.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
xchange-mcp
MCP server exposing 17 crypto exchange tools via the xchange library. Supports 20+ exchanges (Binance, Bybit, OKX, Gate.io, Hyperliquid, Deribit, Kraken, KuCoin, Bitget, and more).
Join the Telegram community — share feedback, report bugs, request features.
Features
17 MCP tools: order management, balance/position queries, market data, PnL
Session management with Redis persistence and in-memory LRU pool
SSE and stdio transport support
Optional paper-trading mode (DryRun)
Structured error codes for reliable AI parsing
Related MCP server: hyperliquid-mcp
Quick Connect (Hosted Server)
No installation required. Connect to the hosted server directly from your AI client.
Claude Code
claude mcp add --transport http xchange-mcp https://xchange-mcp.ezcoin.cc/mcpVerify:
claude mcp list
# xchange-mcp: https://xchange-mcp.ezcoin.cc/mcp (HTTP) - ✓ ConnectedClaude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"xchange-mcp": {
"type": "http",
"url": "https://xchange-mcp.ezcoin.cc/mcp"
}
}
}Restart Claude Desktop after saving.
OpenCode
Add to opencode.json (or ~/.config/opencode/opencode.json):
{
"mcp": {
"xchange-mcp": {
"type": "remote",
"url": "https://xchange-mcp.ezcoin.cc/mcp"
}
}
}OpenClaw
Add to your OpenClaw MCP config (~/.config/openclaw/mcp.json):
{
"servers": {
"xchange-mcp": {
"type": "http",
"url": "https://xchange-mcp.ezcoin.cc/mcp"
}
}
}Usage Examples
All tools follow the same pattern: first call init_exchange to get a session_id, then pass that session_id to any other tool.
Check your Binance balance
Initialize a Binance connection with my API key
AKEYHEREand secretSECRETHERE, then fetch my balance.
Claude will call:
init_exchange(exchange_name="binance", api_key="AKEYHERE", api_secret="SECRETHERE", market_type="spot")→ returnssession_idfetch_balance(session_id="...")→ returns balances
Get BTC price on OKX
What's the current BTC/USDT price on OKX?
Claude will call:
init_exchange(exchange_name="okx", market_type="spot")→session_id(no keys needed for public data)fetch_ticker(session_id="...", symbol="BTC/USDT")→{"last": 67420.5, ...}
Place a limit buy order
On my Bybit futures account (API key: KEY, secret: SECRET), buy 0.01 BTC/USDT:USDT at $65,000 with 10x leverage.
Claude will call:
init_exchange(exchange_name="bybit", api_key="KEY", api_secret="SECRET", market_type="swap")set_leverage(session_id="...", symbol="BTC/USDT:USDT", leverage=10)create_order(session_id="...", symbol="BTC/USDT:USDT", order_type="limit", side="buy", amount=0.01, price=65000)
Check open positions and PnL
Show me all open positions and realized PnL on my Hyperliquid account.
Claude will call:
init_exchange(exchange_name="hyperliquid", api_key="KEY", api_secret="SECRET", market_type="swap")fetch_positions(session_id="...")get_closed_pnls(session_id="...")
Cancel all orders and close a position
Cancel all my open DOGE/USDT:USDT orders and close my short position on Bitget.
Claude will call:
init_exchange(exchange_name="bitget", api_key="KEY", api_secret="SECRET", market_type="swap")cancel_all_orders(session_id="...", symbol="DOGE/USDT:USDT")close_position(session_id="...", symbol="DOGE/USDT:USDT", side="short")
Get OHLCV candlestick data
Fetch the last 100 hourly candles for ETH/USDT on Kraken.
Claude will call:
init_exchange(exchange_name="kraken", market_type="spot")fetch_ohlcv(session_id="...", symbol="ETH/USDT", timeframe="1h", limit=100)
Tools
Tool | Description |
| Initialize exchange session with API credentials |
| Close an exchange session |
| Get account balances |
| Get open positions |
| Place a new order |
| Cancel an order by ID |
| Cancel all open orders |
| Get order details |
| List open orders |
| List closed orders |
| List recent trades |
| Close an open position |
| Set leverage for a symbol |
| Get realized PnL history |
| Get current price/ticker |
| Get order book depth |
| Get candlestick data |
| Get margin borrow rate for an asset |
| Get borrowed amount for a margin asset |
| Get borrowing records for a margin asset |
| Get margin trading configuration |
| Check if session is using testnet |
Telegram: t.me/xchange_mcp_bot
You can use xchange-mcp functions with free Telegram bot.
Useage example:
/help
/setKey bybit aaaaaaaa bbbbbbb
/balance bybit
/orders
/buy bybit BTC/USDT 0.01 70000 limit
/buy bybit BTC/USDT 0.01 70000 swap
/sell bybit BTC/USDT 0.01 70000 swap
/pnlsFeedback & Community
Three things I want to know:
What's working well for you?
What's broken or confusing? (include: exchange name + error message + what you tried)
What tool or feature is missing that you wish existed?
You can also open a GitHub Issue for bugs and feature requests.
Self-Hosting
For running your own xchange-mcp server. Not needed to use the hosted server above.
Prerequisites
Python 3.10+
Redis
# macOS
brew install redis && brew services start redis
# Ubuntu/Debian
sudo apt install redis-server && sudo systemctl start redisInstallation
git clone https://github.com/dchou/xchange-mcp.git
cd xchange-mcp
python -m venv .venv && source .venv/bin/activate
pip install -e .Start the server
cp .env.template .env # edit as needed
xchange-mcp --transport sse
# Listening on http://0.0.0.0:8000Test it's running:
curl http://localhost:8000/health
# {"status":"ok"}Configuration
Variable | Default | Description |
|
| Redis connection URL |
|
| Session expiry in seconds |
|
| Max live exchange connections |
| — | Optional Fernet key for encrypting stored credentials |
|
| Enable paper-trading mode |
SSE endpoints
Endpoint | Transport | Notes |
| SSE (legacy) | Older clients |
| Streamable-HTTP | Preferred for MCP ≥ 1.0 clients |
Note: WebSocket (
ws://) is not supported. Usehttp://localhost:8000/mcp.
License
Proprietary. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Trade Papertrade BTC and ETH perps from Claude, ChatGPT, Codex, Cursor and any MCP client.
Live crypto + IDX stock market intelligence for AI agents — 19 tools, no API key.
The trading toolkit for your AI. Strategies, settings, and reported activity in one workspace.
1Trade Hyperliquid perps, stocks, gold, oil and pre-IPO from AI agents. Hosted; keys can't withdraw.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to perform cryptocurrency trading analysis and execution with 38+ tools including real-time market data, technical indicators, risk management, and support for both paper trading and live execution on Hyperliquid.7MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely trade on Hyperliquid perpetual exchange, including order placement, position management, market data retrieval, and vault operations via natural language.24MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Hyperliquid perpetual futures exchange for market analysis, account management, and risk-managed trading.51MIT

AlgoVesta MCP Serverofficial
AlicenseNot gradedqualityBmaintenanceConnects AI assistants to 16 crypto exchanges and MetaTrader 5 over a single MCP endpoint, enabling trading and account management with server-side risk controls, paper trading by default, and auditable signed receipts.4CC BY-4.0