- 115 tools across market data, spot trading, collateral trading, wallet, lending, sub-accounts, mining pool, and currency conversion
- Runs as a local Docker container — API keys never leave the machine
- Credentials are passed per tool call and are not stored or logged by the server
The MCP server documented on this page enables trading via AI clients. For documentation search via MCP (searching the WhiteBIT API docs in Cursor or VS Code), see Docs search via MCP.
Prerequisites
- Docker installed and running, or Python 3.10+ for the no-Docker option
- A WhiteBIT account with an API key (for trading tools) — see API key generation
- A supported AI client: Claude Code, Cursor, Claude Desktop, Codex, or OpenClaw
Quick start
Start the server
Stop the server at any time:
Run without Docker
http://0.0.0.0:8000. Replace port 8080 with 8000 in all client configurations below.
Connect an AI client
- Claude Code
- Cursor
- Claude Desktop
- Codex
- OpenClaw
Global registration (all projects):Verify the connection:Project-scoped registration:The repository includes a
.mcp.json file at the project root. Running claude from inside the cloned whitebit-mcp directory registers the server automatically at project scope.Use /mcp inside a Claude Code session to see live server status and available tools.API keys
Generate API keys at whitebit.com → Profile → API Keys. Use the minimum permissions required for the intended use case — read-only keys are sufficient for balance and order queries. How credentials work: API keys are passed as parameters in each tool call. The AI client sends the credentials on behalf of the account holder when provided at the start of the conversation. Public market data tools (market info, tickers, order book) query public endpoints. Pass"public" for both api_key and secret_key when only public data is needed.
Example: provide credentials at session start
Example prompts
Market data — no API key required
Pass"public" for both key fields when querying public endpoints.
- “What is the current BTC_USDT price?”
- “Show the order book for ETH_USDT”
- “List all available markets”
- “What are the deposit fees for USDT?”
- “What is the funding rate history for BTC_USDT?”
- “Is WhiteBIT in maintenance mode?”
Spot trading — API key required
- “Show the spot balance”
- “List open orders on BTC_USDT”
- “Place a limit buy order for 0.001 BTC at 90000 on BTC_USDT”
- “Cancel all open orders on ETH_USDT”
- “Show order history for the last 30 days”
Wallet — API key required
- “What is the deposit address for USDT on TRC20?”
- “Show recent deposits and withdrawals”
- “Transfer 100 USDT from the main account to spot trading”
- “Create a WhiteBIT code for 50 USDT”
Collateral trading — API key required
- “List open collateral positions”
- “Place a collateral limit buy for 0.01 BTC on BTC_USDT”
- “What is the current leverage?”
- “Close the BTC_USDT position”
Sub-accounts — API key required
- “List all sub-accounts”
- “Show the balance of sub-account ID 123”
- “Transfer 200 USDT to sub-account ID 456”
Configuration reference
| Variable | Default | Description |
|---|---|---|
WHITEBIT_BASE_URL | https://whitebit.com | API base URL — override for custom deployments |
docker-compose.yml or as a shell variable:
Safe account practices
Before using the MCP server with a live account:- Create a dedicated sub-account with a separate API key for AI tool access.
- Fund the sub-account with only the amount allocated for AI-assisted trading.
- Generate API keys with the minimum required permissions — use read-only keys for monitoring.
- Use IP whitelisting on the API key to restrict access to the machine running the server.
- Test with a small amount before executing larger trades.
What’s next
- CLI — Trade and query account data directly from the terminal without an AI client
- AI tools FAQ — Answers to common questions about API key safety, supported clients, and account practices
- AI tools overview — All WhiteBIT AI tools in one place
- Authentication — How to generate and manage WhiteBIT API keys
- API Reference Overview — Full REST API endpoint listing