Gate MCP Server
OfficialGate MCP 服务器
一个 Gate MCP(模型上下文协议)服务器,使 AI 代理能够与 Gate 加密货币交易所交互,进行市场数据、交易和账户管理。
功能特性
🔍 公共市场数据 - 现货、合约、杠杆、期权、交割、理财、Alpha 行情、订单簿、K 线、资金费率、强平历史(无需认证)
💹 交易 - 创建/取消/修改现货、合约、期权、交割订单;价格触发订单;追踪订单
💼 账户与钱包 - 余额、转账、充值、提现、子账户、统一账户
📊 杠杆与理财 - 杠杆借贷、理财、多币种闪兑
🎯 活动与福利 - 活动中心、优惠券、Launchpool、广场、福利
🌍 TradFi、CrossEx、P2P - 传统金融、跨交易所、P2P 交易
🌐 DEX - 链上钱包、兑换(单链与跨链)、代币信息、20+ 链的市场数据
📰 信息 - 币种发现、市场快照、技术/平台指标、链上与宏观数据
📢 新闻 - 加密新闻、社交洞察、市场事件、预测市场
📚 文档 - 研究报告、论文和文档搜索
🔐 OAuth2 - 交易和私有工具的安全授权
Related MCP server: hvip MCP Server
MCP 端点
该服务提供以下 MCP 端点:
端点 | 认证 | 工具 |
| 无 | 公共市场数据(58 个工具:现货、合约、杠杆、期权、交割、理财、Alpha、活动、Launchpool、广场、闪兑) |
| OAuth2 | CEX 交易与账户(400+ 工具:现货/合约/期权/交割/杠杆交易、钱包、统一账户、子账户、理财、闪兑、返佣、TradFi、CrossEx、P2P、Alpha、活动中心、优惠券、Launchpool、广场、福利) |
| Google / Gate OAuth | DEX 钱包与兑换(33 个工具:认证、钱包、链配置、转账、兑换、市场数据、代币信息、代理、20+ 链的 RPC) |
| 无 | 币种信息与分析(32 个工具:币种、快照、趋势、链上、平台指标、宏观、市场详情) |
| 无 | 新闻与研究(18 个工具:新闻/UGC/X/网页、公告、情绪、事件、预测市场) |
| 无 | 文档研究(3 个工具:研究搜索、币种研究、论文) |
仅市场数据 → 使用
/mcp(无需 Gate 账户)CEX 交易、余额、转账 → 使用
/mcp/exchange(需要 Gate OAuth2)DEX 钱包、兑换、链上 → 使用
/mcp/dex(需要 Google / Gate OAuth)币种信息、技术分析 → 使用
/mcp/info(无需认证)新闻、公告 → 使用
/mcp/news(无需认证)研究文档与论文 → 使用
/mcp/docs(无需认证)
传输方式:Streamable HTTP(带 SSE 回退)。
授权(OAuth2)
/mcp/exchange 需要 Gate OAuth2;/mcp/dex 需要 Google 或 Gate OAuth。 端点 /mcp、/mcp/info、/mcp/news 和 /mcp/docs 不需要任何认证。
使用 mcporter
先决条件:Node.js >= 18、npm。完整安装步骤请参阅 快速入门 - mcporter。
# Add Private MCP (trading, requires OAuth)
mcporter config add gate-mcp --url https://api.gatemcp.ai/mcp/exchange --auth oauth
# Authorize (opens browser to log in)
mcporter auth gate-mcp作用域(用于 /mcp/exchange)
作用域 | 用途 |
| 公共市场数据(行情、订单簿、K 线等) |
| 账户信息、订单、持仓(只读) |
| 创建/取消/修改订单 |
| 转账、充值、提现 |
| 统一账户、子账户 |
快速入门
先决条件
Gate 账户(仅
/mcp/exchange需要)兼容 MCP 的客户端(Cursor、Claude CLI、Trae、OpenClaw 等)
Node.js >= 18(用于 mcporter、Trae、Qoder 及其他基于 npm 的客户端)
Python >= 3.9(可选,用于 Claude Desktop 代理)
Cursor
方法 1:一键安装(推荐)
只需将以下内容粘贴到 Cursor AI 聊天中——代理将自动安装所有 Gate MCP 服务器和技能:
帮我自动安装 Gate Skills 和 MCP:https://github.com/gate/gate-skills
详情请参阅 gate-skills。
方法 2:手动配置
用于完整交易(连接时 OAuth):
编辑 ~/.cursor/mcp.json:
{
"mcpServers": {
"Gate": {
"url": "https://api.gatemcp.ai/mcp/exchange",
"transport": "streamable-http",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream"
}
}
}
}仅用于市场数据(无需认证):
{
"mcpServers": {
"Gate": {
"url": "https://api.gatemcp.ai/mcp",
"transport": "streamable-http",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream"
}
}
}
}用于 DEX(链上钱包、兑换):
{
"mcpServers": {
"Gate-Dex": {
"url": "https://api.gatemcp.ai/mcp/dex",
"headers": {
"x-api-key": "MCP_AK_8W2N7Q",
"Authorization": "Bearer ${GATE_MCP_TOKEN}"
}
}
}
}用于信息与新闻(无需认证):
{
"mcpServers": {
"Gate-Info": {
"url": "https://api.gatemcp.ai/mcp/info"
},
"Gate-News": {
"url": "https://api.gatemcp.ai/mcp/news"
}
}
}请参阅 Cursor 设置。
mcporter / OpenClaw
方法 1:一键安装(推荐)
只需将以下内容粘贴到 OpenClaw AI 聊天中——代理将自动安装所有 Gate MCP 服务器和技能:
帮我自动安装 Gate Skills 和 MCP:https://github.com/gate/gate-skills
详情请参阅 gate-skills。
方法 2:手动配置
先决条件(安装 mcporter 之前)
Node.js >= 18(mcporter 需要 npm)
npm(随 Node.js 附带)——使用
node -v和npm -v验证Gate 账户(使用
/mcp/exchange时用于 OAuth 登录)
安装 mcporter
# Global install
npm install -g mcporter
# Verify installation
mcporter --version或者,无需安装即可运行:npx mcporter <command>(使用当前的 Node.js/npm)。
添加 MCP 并授权
# Add Private MCP (trading, OAuth)
mcporter config add gate-mcp --url https://api.gatemcp.ai/mcp/exchange --auth oauth
# Authorize (opens browser to log in)
mcporter auth gate-mcp
# Add DEX MCP
mcporter config add gate-dex --url https://api.gatemcp.ai/mcp/dex
# Add Info MCP (no auth)
mcporter config add gate-info --url https://api.gatemcp.ai/mcp/info
# Add News MCP (no auth)
mcporter config add gate-news --url https://api.gatemcp.ai/mcp/news详细步骤请参阅 OpenClaw 设置。
Claude CLI
方法 1:一键安装(推荐)
只需将以下内容粘贴到 Claude CLI 中——代理将自动安装所有 Gate MCP 服务器和技能:
帮我自动安装 Gate Skills 和 MCP:https://github.com/gate/gate-skills
详情请参阅 gate-skills。
方法 2:手动配置
brew install claude-code
# Full trading (OAuth)
claude mcp add --transport http Gate https://api.gatemcp.ai/mcp/exchange
# Restart Claude CLI after authorization is complete
# Info (no auth)
claude mcp add --transport http Gate-Info https://api.gatemcp.ai/mcp/info
# News (no auth)
claude mcp add --transport http Gate-News https://api.gatemcp.ai/mcp/news
claude mcp listTrae
编辑 Trae 设置。使用 mcp-remote 代理 HTTP MCP(首次连接 /mcp/exchange 时提示 OAuth):
{
"mcpServers": {
"gate": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.gatemcp.ai/mcp/exchange"
]
},
"gate-info": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.gatemcp.ai/mcp/info"
]
},
"gate-news": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.gatemcp.ai/mcp/news"
]
}
}
}Qoder
编辑 Qoder MCP 设置(例如 ~/.qoder/mcp.json 或在 Qoder 设置中):
{
"mcpServers": {
"gate": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.gatemcp.ai/mcp/exchange"
]
},
"gate-info": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.gatemcp.ai/mcp/info"
]
},
"gate-news": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.gatemcp.ai/mcp/news"
]
}
}
}Claude Desktop
Claude Desktop 需要本地 stdio 代理。
下载 Python 代理文件
编辑
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"Gate": {
"command": "python3",
"args": ["/path/to/gate-mcp-proxy.py"]
}
}
}详细说明请参阅 Claude Desktop 设置。
备选方案:gate-local-mcp(使用 API 密钥的本地 stdio)
对于无需 OAuth 的本地开发,请使用 gate-local-mcp(npm:gate-mcp)——一个使用 GATE_API_KEY / GATE_API_SECRET(仅公共市场数据可选)的 stdio MCP 服务器。将其配置为基于命令的 MCP 服务器(例如 "command": "npx", "args": ["-y", "gate-mcp"])。默认情况下,它注册了 22 个模块中的 384 个工具(现货、合约、交割、杠杆、钱包、账户、期权、理财、闪兑、统一账户、子账户、多抵押贷款、P2P、TradFi、CrossEx、Alpha、返佣、活动、优惠券、Launchpool、广场、福利)。使用 GATE_MODULES 或 --modules=spot,futures 减少集合,或使用 GATE_READONLY=true / --readonly 启用只读模式。
重要提示: 线路级工具名称使用缩写(futures→fx、delivery→dc、sub_account→sa 等);它们与远程 api.gatemcp.ai 命名不同。始终使用 tools/list 返回的名称。
完整工具列表:gate-local-mcp-tools.md。
LobeHub(桌面版)
在 LobeHub MCP 市场 上,此服务器显示为标识符 gate-gate-mcp。npm 包名是 gate-mcp —— 运行 npx -y gate-mcp,而不是 gate-gate-mcp。
根据 LobeHub 自定义 MCP,stdio 服务器仅适用于桌面应用;为 Gate API 认证注入环境变量。添加自定义技能时使用导入 JSON。
仅公共端点:
{
"mcpServers": {
"gate-mcp": {
"command": "npx",
"args": ["-y", "gate-mcp"],
"type": "stdio"
}
}
}使用 API 密钥认证:
{
"mcpServers": {
"gate-mcp": {
"command": "npx",
"args": ["-y", "gate-mcp"],
"type": "stdio",
"env": {
"GATE_API_KEY": "your-api-key",
"GATE_API_SECRET": "your-api-secret"
}
}
}
}您可以根据需要在 env 中添加 GATE_MODULES、GATE_READONLY 或 GATE_BASE_URL。保存前点击测试连接。
其他客户端
基本用法
查询价格
BTC/USDT 的当前价格是多少?
获取订单簿
显示 ETH/USDT 的订单簿
K 线数据
获取 BTC 最近 7 天的日 K 线数据
可用工具
所有工具都使用 cex_ 前缀。工具分为公共 MCP(无需认证)和私有 MCP(OAuth2)。
公共 MCP(/mcp — 无需认证,58 个工具)
业务 | 工具数 | 描述 |
现货 | 8 |
|
合约 | 14 | 合约、订单簿、成交、K线、行情、资金费率、溢价指数、强平、合约统计、保险基金账本、指数成分、批量资金费率、风险限额档位 |
杠杆 | 3 |
|
期权 | 12 | 标的资产、到期日、合约、结算、订单簿、行情、K线、成交 |
交割 | 8 | 合约、订单簿、成交、K线、行情、保险基金账本、风险限额档位 |
理财 | 5 |
|
Alpha | 3 |
|
活动 | 1 |
|
Launch | 1 |
|
Square | 2 |
|
闪兑 | 1 |
|
私有 MCP(/mcp/exchange — OAuth2,400+ 工具)
注意:私有端点不包含公共市场数据工具。市场数据查询请使用
/mcp。
业务 | 权限范围 | 主要工具 |
现货 | profile / trade | 账户、订单、成交、批量订单、价格触发订单、倒计时撤单、全仓强平 |
合约 | profile / trade | 账户、持仓、订单、成交、双向持仓、追踪委托、价格触发、BBO 订单 |
杠杆 | profile / trade | 杠杆账户、借款、自动还款、uni 借款 |
期权 | profile / trade | 账户、持仓、订单、MMP 设置 |
交割 | profile / trade | 账户、持仓、订单、价格触发订单 |
钱包 | wallet | 总余额、划转、充值、提现、充值地址、SA 余额、小额资产兑换 |
统一账户 | account | 统一账户、模式、借款、风险单元、可借额度、抵押品、杠杆配置 |
子账户 | account | 创建/查询/锁定/解锁 SA、API 密钥 |
账户 | account | 账户详情、主密钥、频率限制、手续费抵扣、STP 组 |
返佣 | profile | 代理/合作伙伴/经纪商佣金历史、用户信息 |
闪兑 | profile / trade |
|
理财 | profile / trade | 双币/结构化/uni 产品、订单、ETH2 兑换、借出记录 |
Alpha | profile / trade | Alpha 账户、订单、报价/下单 |
TradFi | profile / trade | 分类、交易对、MT5 账户、资产、订单、持仓 |
CrossEx | profile / trade | 规则交易对、账户、持仓、订单、划转、兑换 |
P2P | profile / trade | 用户信息、广告、聊天、交易、确认收款/付款 |
活动 | profile | 活动类型、推荐活动、用户参与 |
优惠券 | profile | 用户优惠券、优惠券详情 |
Launch Pool | profile / trade | LaunchPool 项目、质押/赎回、奖励记录 |
Square | market | AI 搜索、直播回放 |
福利 | profile | 新手资格、任务列表和奖励 |
完整的工具参数请参阅 Gate API 文档 或 gate-exchange-mcp。
DEX — 认证
工具 | 描述 |
| 启动 Google OAuth 登录流程,返回验证 URL |
| 轮询登录状态,成功时返回 mcp_token |
| 使用 Google OAuth 授权码登录 |
| 启动 Gate OAuth 登录流程,返回验证 URL |
| 轮询 Gate OAuth 登录状态,成功时返回 mcp_token |
| 直接使用 Gate OAuth 授权码登录 |
| 撤销当前会话 |
DEX — 钱包
工具 | 描述 |
| 获取各链(EVM、Solana)的钱包地址 |
| 代币余额,含价格和分页 |
| 总资产价值和 24 小时变化 |
| 使用钱包私钥签署消息(EVM / Solana) |
| 使用钱包私钥签署原始交易 |
DEX — 链与交易
工具 | 描述 |
| 链配置(链 ID、能力) |
| 估算 Gas 价格和 Gas 上限 |
| 签署前预览转账详情 |
| 代币授权预览:构建 ERC20/SPL 授权交易 |
| 使用最新区块哈希构建未签名的 Solana SOL 转账 |
| 在链上广播已签名的交易 |
| 兑换报价,含路由、价格影响和 Gas 估算 |
| 一键兑换:报价 → 构建 → 签名 → 提交 |
| 按订单 ID 查询兑换订单状态 |
| 交易与兑换/跨链桥历史 |
DEX — 市场数据与代币信息
工具 | 描述 |
| K 线(蜡烛图)数据:1m、5m、1h、4h、1d |
| 交易量和交易者统计(5m / 1h / 4h / 24h) |
| 流动性池添加/移除事件 |
| 指定链上可用于兑换的代币 |
| 可跨链桥接的代币 |
| 代币信息:价格、市值、供应量、持有者分布 |
| 24 小时涨幅榜 / 跌幅榜 |
| 按创建时间范围发现新代币 |
| 安全审计:蜜罐、买入/卖出税、黑名单、权限 |
DEX — 智能代理与 RPC
工具 | 描述 |
| 向钱包服务上报智能代理钱包地址 |
| 向区块链节点执行 JSON-RPC 调用 |
如需完整的 DEX 工具参数,请参阅 gate-dex-mcp。如需 Agentic Wallet 子集(认证、钱包、市场数据、资源),请参阅 gate-agentic-wallet-mcp。
Info(/mcp/info — 32 个工具,无需认证)
公开、只读的市场研究。分类(完整参数表:gate-info-mcp):
分类 | 工具 |
币种 |
|
市场快照 |
|
市场趋势 |
|
链上数据 |
|
合规 |
|
平台指标 |
|
宏观 |
|
市场详情 |
|
News(/mcp/news — 18 个工具,无需认证)
公开、只读的新闻和社交研究。分类(完整参数表:gate-news-mcp):
分类 | 工具 |
新闻流 |
|
事件 |
|
预测 |
|
MCP 资源
/mcp 和 /mcp/exchange 端点还提供用于静态参考数据的 MCP 资源:
资源 URI | 描述 |
| 所有现货交易对 |
| 所有支持的币种 |
| USDT 结算的期货合约 |
| BTC 结算的期货合约 |
| 按结算币种划分的期货合约 |
常见问题
问:我需要 Gate 账户吗?
答:仅 CEX 交易和 DEX 钱包需要。 /mcp、/mcp/info、/mcp/news 和 /mcp/docs 完全公开——无需账户。/mcp/exchange(CEX 交易、余额、转账)需要 Gate OAuth2。/mcp/dex(链上钱包、兑换)需要 Google 或 Gate OAuth。
问:支持交易吗?
答:支持。使用 OAuth2 连接到 https://api.gatemcp.ai/mcp/exchange。该服务器支持现货和期货交易、账户管理、钱包转账和子账户。每个工具都需要相应的权限范围(例如 trade、wallet)。
问:数据多久更新一次?
答:数据通过 Gate 的 API 实时查询。
隐私与安全
通过 Gate 账户进行 OAuth2 授权(配置中不存储 API 密钥)
所有 API 调用均使用 HTTPS
请参阅 Gate 隐私政策
支持与反馈
API 文档:Gate API 文档
问题报告:请联系 Gate 支持
商务咨询:联系 Gate 官方渠道
贡献
请参阅 CONTRIBUTING.md。
许可证
MIT © gate.com
This server cannot be deployed
Maintenance
Related MCP Connectors
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Crypto trading intelligence MCP — 34+ endpoints, x402 pay-per-use, AI agent strategy & execution
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Live crypto + IDX stock market intelligence for AI agents — 19 tools, no API key.
Related MCP Servers
- AlicenseBqualityDmaintenanceConnects MCP-compatible AI agents to GT Protocol trading accounts, enabling natural language control of automated trading bots, strategy backtesting, deal execution, and balance monitoring on Binance and Hyperliquid exchanges.1MIT
- AlicenseDqualityCmaintenanceEnables AI agents to access the full OKX exchange API for trading, market data, account management, and more through 300+ MCP tools.100518 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI tools to execute trades and fetch market data across six crypto exchanges via natural language or API, with dual Telegram and MCP interfaces.2-
- FlicenseNot gradedqualityCmaintenanceEnables agents to access live crypto market data and execute risk-controlled paper trades through standardized MCP tool calls.-