使用说明
BloFin MCP服务器
模型上下文协议(MCP)服务器 BloFin 加密货币交易所API。提供市场数据、账户管理和交易操作工具。
特性
公共数据(无需身份验证)
get_instruments-获取可用的交易工具和合约规格get_tickers-获取最新价格、买卖、24小时交易量get_orderbook-获取订单簿深度get_trades-获取最近的交易get_mark_price-获取标记/指数价格get_candlesticks-获取OHLCV烛台数据get_funding_rate-获取当前资金利率get_funding_rate_history-获取历史融资率
帐户(需要身份验证)
get_balance-获取期货账户余额get_positions-获取空缺职位get_leverage_info-获取工具的杠杆信息set_leverage-为工具设置杠杆get_margin_mode-获取仪器的当前保证金模式set_margin_mode-设置仪器的保证金模式get_position_mode-获取当前位置模式set_position_mode-设置位置模式get_account_config-获取帐户配置
交易(需要身份验证)
place_order-下一个新订单(市场、限额、仅限邮政、fok、ioc)cancel_order-取消订单batch_orders-一次下多个订单cancel_batch_orders-一次取消多个订单close_position-关闭头寸get_open_orders-获取待处理订单get_order_history-获取订单历史记录get_order_detail-获取具体订单详细信息get_fills_history-获取交易填充历史记录place_tpsl-下达止盈/止损订单cancel_tpsl-取消止盈/止损订单get_pending_tpsl-获取待定的TP/SL订单get_tpsl_history-获取TP/SL订单历史记录place_algo_order-下算法订单(触发/条件)cancel_algo_order-取消算法订单get_pending_algo_orders-获取待处理的算法订单get_algo_order_history-获取算法订单历史记录
资产管理(需要身份验证)
get_asset_balances-获取不同账户类型的余额fund_transfer-在账户之间转账get_fund_transfer_history-获取转账历史记录get_deposit_history-获取存款历史记录get_withdrawal_history-获取提款历史记录get_apikey_info-获取API关键信息
重要风险通知
- 交易工具可以下达和取消真实订单。
- 首先使用演示环境,然后在准备就绪后切换到生产环境。
- 尽可能以最少的权限创建API密钥,并通过IP进行限制。
- 切勿共享您的API密钥、机密或密码。
工具覆盖范围
当前实施登记簿 40工具 总计:
- 公开市场数据:8种工具
- 账户:9个工具
- 交易:17种工具
- 资产管理:6个工具
获取API密钥
- 首选 blofin.com 登录(或创建帐户)
- 引导到 应用程序编程接口 页
- 点击 创建API密钥 并选择 BloFin MCP 作为API类型
- 设置您的权限(市场数据只读,或根据需要启用交易)
- 保存您的 API密钥, 密钥,以及 口令短语 --您需要它们进行以下配置
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
BLOFIN_API_KEY |
是 | 您的BloFin API密钥 |
BLOFIN_API_SECRET |
是 | 您的BloFin API秘密 |
BLOFIN_PASSPHRASE |
是 | 您的BloFin API密码 |
BLOFIN_BASE_URL |
否 | API基础URL(默认为模拟交易) |
基本URL
- 模拟交易:
https://demo-trading-openapi.blofin.com(默认) - 生产:
https://openapi.blofin.com
安装和构建
npm install
npm run typecheck
npm run build
安装
克劳德桌面(扩展)
下载最新 blofin-mcp.mcpb 从 GitHub 发布 然后双击进行安装。ClaudeDesktop将提示您输入API密钥、API密钥和密码短语。
克劳德桌面(手册)
添加到您的Claude桌面配置(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"
}
}
}
}
克劳德代码
claude mcp add blofin -- npx -y blofin-mcp
然后在shell配置文件中设置环境变量或 .env 文件:
export BLOFIN_API_KEY="your-api-key"
export BLOFIN_API_SECRET="your-api-secret"
export BLOFIN_PASSPHRASE="your-passphrase"
export BLOFIN_BASE_URL="https://openapi.blofin.com"
光标
添加 .cursor/mcp.json 在项目根目录(或全局配置)中 ~/.cursor/mcp.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"
}
}
}
}
帆板运动
添加到您的Windsurf MCP配置(~/.codeium/windsurf/mcp_config.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"
}
}
}
}
Cline(VS代码)
打开临床MCP设置(Cline → MCP Servers → Configure)并添加:
{
"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"
}
}
}
}
开爪
添加 "mcpServers" 到你的 ~/.openclaw/openclaw.json (顶级字段,旁边 identity, agent等等):
{
"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"
}
}
}
}
如果你的 openclaw.json 已经有了 "mcpServers" 与其他服务器的部分,只需添加 "blofin": { ... } 里面。
保存后重新启动OpenClaw。代理将自动发现40个BloFin工具。
开源项目文件
- 许可证:
LICENSE - 贡献指南:
CONTRIBUTING.md - 安全策略:
SECURITY.md - 社区行为政策:
CODE_OF_CONDUCT.md - 更改历史记录:
CHANGELOG.md
报告和支持
- Bug报告和功能请求:GitHub问题
- 安全问题:请关注
SECURITY.md - API参考: BloFin API文档