Trade on BloFin with AI | BloFin MCP Server

BloFin MCP

AI-Native. Trade-Ready.

An open-source MCP server for BloFin. Built for AI agents and LLM-powered apps — 40 tools across market data, trading, account, and asset management.

npm v1.2.0

Why BloFin MCP?

40 tools covering the full BloFin API, from market data to advanced trading strategies.

Demo Trading Ready

Test with BloFin's demo trading environment before going live. No real funds at risk.

Real-time Market Data

Access tickers, order books, trades, candlesticks, funding rates and more — all in real time.

Full Trading Support

Place orders, set TP/SL, manage algo orders, and close positions with natural language commands.

Secure Authentication

HMAC-SHA256 signed requests. Your API keys stay local and are never sent to third parties.

Account Management

Check balances, positions, leverage, margin mode, and account configuration.

Asset Operations

Transfer funds, view deposit/withdrawal history, and manage your assets across accounts.

Quick Setup

Get up and running in under a minute. Works with Claude Desktop, Cursor, and any MCP-compatible client.

1

Get your BloFin API credentials

Create an API key at blofin.com with the permissions you need (read, trade, or both). Save your MCP API Key, Secret, and Passphrase.

2

Install the BloFin API package

bash
npm install -g blofin-mcp
3

Configure your BloFin MCP client

Add the following to your MCP client configuration file (e.g. claude_desktop_config.json for Claude Desktop):
json
{
  "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"
      }
    }
  }
}
Tip: For demo trading, set BLOFIN_BASE_URL to https://demo-trading-openapi.blofin.com or omit it entirely (demo is the default).

All 40 MCP Trading Tools

Complete coverage of the BloFin API. Click each category to explore the available tools.

get_instruments

Get available trading instruments and contract specs

get_tickers

Get latest prices, bid/ask, 24h volume

get_orderbook

Get order book depth

get_trades

Get recent trades

get_mark_price

Get mark/index prices

get_candlesticks

Get OHLCV candlestick data

get_funding_rate

Get current funding rates

get_funding_rate_history

Get historical funding rates

get_balance

Get futures account balance

get_positions

Get open positions

get_leverage_info

View leverage settings

set_leverage

Set leverage for an instrument

get_margin_mode

View margin mode (cross/isolated)

set_margin_mode

Set margin mode

get_position_mode

View position mode (one-way/hedge)

set_position_mode

Set position mode

get_account_config

Get account configuration

place_order

Place a new order (market, limit, post_only, fok, ioc)

cancel_order

Cancel an order by ID

batch_orders

Place multiple orders at once

cancel_batch_orders

Cancel multiple orders at once

close_position

Close an open position

get_open_orders

Get pending orders

get_order_history

Get historical orders

get_order_detail

Get specific order details

get_fills_history

Get trade fill history

place_tpsl

Place take-profit / stop-loss order

cancel_tpsl

Cancel a TP/SL order

get_pending_tpsl

Get pending TP/SL orders

get_tpsl_history

Get TP/SL order history

place_algo_order

Place an algo/trigger order

cancel_algo_order

Cancel an algo order

get_pending_algo_orders

Get pending algo orders

get_algo_order_history

Get algo order history

get_asset_balances

Get balances across account types

fund_transfer

Transfer funds between accounts

get_fund_transfer_history

Get transfer history

get_deposit_history

Get deposit records

get_withdrawal_history

Get withdrawal records

get_apikey_info

Get API key information and permissions

BloFin MCP 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)

Frequently Asked Questions