blofin-mcp
v1.1.2
Published
MCP server for BloFin exchange API - market data, trading, account management
Downloads
433
Readme
BloFin MCP Server
A Model Context Protocol (MCP) server for the BloFin cryptocurrency exchange API. Provides tools for market data, account management, and trading operations.
Features
Public Data (no authentication required)
get_instruments- Get available trading instruments and contract specsget_tickers- Get latest prices, bid/ask, 24h volumeget_orderbook- Get order book depthget_trades- Get recent tradesget_mark_price- Get mark/index pricesget_candlesticks- Get OHLCV candlestick dataget_funding_rate- Get current funding ratesget_funding_rate_history- Get historical funding rates
Account (authentication required)
get_balance- Get futures account balanceget_positions- Get open positionsget_leverage_info/set_leverage- View/set leverageget_margin_mode/set_margin_mode- View/set margin modeget_position_mode/set_position_mode- View/set position modeget_account_config- Get account configuration
Trading (authentication required)
place_order- Place a new order (market, limit, post_only, fok, ioc)cancel_order- Cancel an orderbatch_orders/cancel_batch_orders- Batch order operationsclose_position- Close a positionget_open_orders- Get pending ordersget_order_history- Get order historyget_order_detail- Get specific order detailsget_fills_history- Get trade fill historyplace_tpsl/cancel_tpsl- Take-profit/stop-loss ordersget_pending_tpsl/get_tpsl_history- View TP/SL ordersplace_algo_order/cancel_algo_order- Algo/trigger ordersget_pending_algo_orders/get_algo_order_history- View algo orders
Asset Management (authentication required)
get_asset_balances- Get balances across account typesfund_transfer- Transfer funds between accountsget_fund_transfer_history- Get transfer historyget_deposit_history/get_withdrawal_history- Deposit/withdrawal recordsget_apikey_info- Get API key information
Setup
Environment Variables
| Variable | Required | Description |
|---|---|---|
| BLOFIN_API_KEY | Yes | Your BloFin API key |
| BLOFIN_API_SECRET | Yes | Your BloFin API secret |
| BLOFIN_PASSPHRASE | Yes | Your BloFin API passphrase |
| BLOFIN_BASE_URL | No | API base URL (defaults to demo trading) |
| BLOFIN_BROKER_ID | No | Broker ID provided by BloFin (auto-injected into trading requests) |
Base URLs
- Demo Trading:
https://demo-trading-openapi.blofin.com(default) - Production:
https://openapi.blofin.com
Install & Build
npm install
npm run buildClaude Desktop
Add to your Claude Desktop config (Settings → Developer → Edit Config):
{
"mcpServers": {
"blofin": {
"command": "npx",
"args": ["-y", "blofin-mcp"],
"env": {
"BLOFIN_API_KEY": "your-api-key",
"BLOFIN_API_SECRET": "your-api-secret",
"BLOFIN_PASSPHRASE": "your-passphrase",
"BLOFIN_BASE_URL": "https://openapi.blofin.com",
"BLOFIN_BROKER_ID": "your-broker-id"
}
}
}
}Cursor / Windsurf / Cline
Same configuration format as above. Add to each client's MCP settings.
OpenClaw
Add "mcpServers" to your ~/.openclaw/openclaw.json (top-level field, alongside identity, agent, etc.):
{
"identity": { "name": "Clawd", "emoji": "🦞" },
"agent": { "workspace": "~/.openclaw/workspace" },
// Add this section ↓
"mcpServers": {
"blofin": {
"command": "npx",
"args": ["-y", "blofin-mcp"],
"env": {
"BLOFIN_API_KEY": "your-api-key",
"BLOFIN_API_SECRET": "your-api-secret",
"BLOFIN_PASSPHRASE": "your-passphrase",
"BLOFIN_BASE_URL": "https://openapi.blofin.com",
"BLOFIN_BROKER_ID": "your-broker-id"
}
}
}
}If your openclaw.json already has a "mcpServers" section with other servers, just add "blofin": { ... } inside it.
Restart OpenClaw after saving. The agent will automatically discover the 36 BloFin tools.
API Documentation
See BloFin API Docs for full API reference.
