
OKX Agent Trade Kit
MCPOKX 官方交易工具包里的 MCP 服务器(okx-trade-mcp),提供行情与技术指标、现货与合约下单、算法单、账户、理财、交易机器人与资讯等工具。本地运行,交易类工具需 OKX API Key,行情无需认证,支持只读模式。
OKX Agent Trade Kit
OKX Agent Trade Kit — an AI-powered trading toolkit with two standalone packages:
| Package | Description |
|---|---|
okx-trade-mcp | MCP server for Claude / Cursor and any MCP-compatible AI client |
okx-trade-cli | CLI for operating OKX from terminal |
What is this?
OKX Agent Trade Kit connects AI assistants directly to your OKX account via the Model Context Protocol. Instead of switching between your AI and the exchange UI, you describe what you want — the AI calls the right tools and executes it.
It runs as a local process with your API keys stored only on your machine. No cloud services, no data leaving your device.
Features
| Feature | Description |
|---|---|
| 174 tools across 11 modules (17 sub-modules) | Full trading lifecycle: market data → orders → algo orders → account management → earn → trading bots → event contracts → news → smart money signals |
| Algo orders built-in | Conditional, OCO take-profit/stop-loss, trailing stop |
| Safety controls | --read-only flag, per-module filtering, built-in rate limiter |
| Zero infrastructure | Local stdio process, no server or database required |
| MCP standard | Works with Claude Desktop, Cursor, openCxxW, and any MCP-compatible client |
| Agent Skills included | Pre-built skill files for AI agent frameworks — drop-in instructions covering market data, trading, portfolio, bots, and earn |
| Open source | MIT license, API keys never leave your machine |
Modules
| Module | Tools | Description | Docs |
|---|---|---|---|
market | 19 | Ticker, orderbook, candles (+history), index ticker, index candles, price limit, funding rate, mark price, open interest, stock tokens, technical indicators (70+ indicators: MA/EMA/RSI/MACD/BB/ATR/KDJ/BTCRAINBOW/AHR999 and more — no auth required), indicator list, market filter (screen by price/change/marketCap/volume/fundingRate/OI), OI history, OI change filter | → |
spot | 13 | Place/cancel/amend orders, batch orders, fills (+archive), order history (+archive), conditional orders, OCO | → |
swap | 17 | Perpetual trading, batch orders, positions, leverage, conditional orders, OCO, trailing stop | → |
futures | 18 | Delivery contract trading, positions, fills, order history, amend/close/leverage, batch orders, algo orders (TP/SL, OCO, trailing stop) | → |
option | 10 | Options trading: place/cancel/amend/batch-cancel, order history, positions (with Greeks), fills, option chain, IV + Greeks | → |
account | 14 | Balance, bills (+archive), positions, positions history, fee rates, config, position mode, max withdrawal, max avail size, audit log | → |
event | 9 | Event contract trading: browse, series, events, markets (query); place, amend, cancel, orders, fills (private). Semantic outcome values: UP/YES/DOWN/NO | → |
earn | 24 | Simple Earn: balance, purchase, redeem, lending rate, fixed-term products query, fixed-term orders (10). On-chain staking/DeFi (6). Dual Currency Deposit/双币赢 (6). Flash Earn (1). Sub-modules: earn.savings, earn.onchain, earn.dcd, earn.flash. Included in all. | → |
bot | 30 | Trading bots: Grid (9), DCA — Spot & Contract (9) and Smart Portfolio (12). Sub-modules: bot.grid, bot.dca, bot.smartportfolio. Recurring Buy is available as CLI-only okx bot recurring commands (no MCP tools) | → |
news | 7 | Crypto news: latest news, by-coin filter, full-text search, article detail, news sources, coin sentiment (snapshot + trend) | → |
smartmoney | 10 | Smart money analytics: leaderboard ranking, trader performance / positions / position history / order history, top-coin signals, single-asset signal (by coin / by traders), signal history (by coin / by traders) — all read-only, split by entry mode for AI-agent disambiguation | → |
Quick Start
Prerequisites: Node.js >= 18
# 1. Install
npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli
# 2. Configure OKX API credentials (interactive wizard)
okx config init
# 3. Register the MCP server with your AI client
okx-trade-mcp setup --client claude-desktop
okx-trade-mcp setup --client cursor
okx-trade-mcp setup --client claude-code
okx-trade-mcp setup --client vscode # writes .mcp.json in current directory
Alternative: One-line install script — handles Node.js check, install, and client detection automatically.
For live trading, multiple profiles, or other clients, see configuration →.
okx-trade-mcp
okx-trade-mcp # default: spot, swap, account
okx-trade-mcp --modules market # market data only (no auth needed)
okx-trade-mcp --modules spot,account # spot trading + account
okx-trade-mcp --profile live --modules all # all modules including earn
okx-trade-mcp --read-only # query tools only, no writes
Startup scenarios → — VS Code · Windsurf →
okx-trade-cli
okx market ticker BTC-USDT
okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
okx account balance
Naming note — CLI subcommands use spaces (
okx swap algo place). AI agents see the same features under underscored MCP tool names (swap_place_algo_order). Do not convert MCP identifiers into hyphen-joined CLI commands —okx swap place-algois not valid. See CLI reference · CLI vs MCP tool names.
Agent Skills
Pre-built skill files for AI agent frameworks are included in the skills/ directory. Each skill tells the agent when to activate and how to use the okx CLI for a specific task category.
| Skill | Description | Auth |
|---|---|---|
okx-cex-market | Market data: prices, candles, order books, funding rates, technical indicators | No |
okx-cex-trade | Order management: spot, swap, futures, options, algo orders | Yes |
okx-cex-portfolio | Account: balances, positions, P&L, transfers | Yes |
okx-cex-bot | Trading bots: grid, DCA (spot & contract), Smart Portfolio and Recurring Buy | Yes |
okx-cex-earn | Earn: Simple Earn, On-chain staking, Dual Investment, AutoEarn | Yes |
okx-cex-smartmoney | Smart Money: trader leaderboard, consensus signals, position analysis | Yes |
Reporting Issues
If a tool call or CLI command fails, open an issue and include the full error output.
MCP — copy the structured error block shown in your AI client:
{
"tool": "swap_place_order",
"error": true,
"type": "OkxApiError",
"code": "51020",
"message": "Order quantity invalid",
"endpoint": "POST /api/v5/trade/order",
"traceId": "abc123def456",
"timestamp": "2026-03-03T10:00:00.000Z",
"serverVersion": "1.0.4"
}
CLI — paste the full stderr output:
Error: Order quantity invalid
TraceId: abc123def456
Hint: Check order size against instrument minSz.
Version: okx-trade-cli@1.0.4
See FAQ → for common issues.
Build from Source
git clone https://github.com/okx/agent-tradekit.git && cd okx-trade-mcp
pnpm install && pnpm build
See CONTRIBUTING.md for the full development guide.
packages/
├── core/ # shared client & tools
├── mcp/ # MCP Server
└── cli/ # CLI tool
Documentation
| Document | Description |
|---|---|
| Architecture | System design and module overview |
| Contributing | Development setup and PR guidelines |
| Changelog | Version history |
| Agent Skills | Pre-built skills for AI agent frameworks |
| Security | Vulnerability reporting |
相關資源

Kraken CLI
CLIKraken 交易所官方命令行,查加密货币、代币化美股、外汇与期货行情并交易,内置 MCP 服务和模拟盘,查行情与模拟交易无需 API Key。官方标注为实验性软件;实盘需 Kraken 账户与 API Key、动用真实资金,请先确认所在地区是否允许并人工确认交易;结论需专业人员复核。
krakenfx/kraken-cli830
Vibe-Trading
MCP港大 HKUDS 开源的交易研究 agent,MCP 服务有 70 余个工具,覆盖 A 股、港美股与加密货币的行情、财报、回测和投研分析。需本地装 Python,港美股与加密研究免 API Key;结果仅供研究,投资决策需专业人员复核。
HKUDS/Vibe-Trading39.4k
Freqtrade
CLI开源加密货币量化交易框架:命令行下载行情、回测策略、优化参数并以模拟盘运行,agent 可代跑策略迭代。推荐用 Docker 运行,初始化配置需按提示作答,写策略需懂 Python,实盘要交易所 API Key;回测不代表实际收益,交易决策需自行评估风险并请专业人士复核。
freqtrade/freqtrade57.5k
Binance Skills Hub
Skill币安官方加密资产技能库:查询代币信息与 K 线、市场热度排行、聪明钱交易信号、钱包持仓和代币安全审计,也能通过 binance-cli 做现货、合约交易。需要 Node.js 22 以上;行情类可直接用,交易类需币安 API Key;加密资产波动大且受各地监管限制,输出不构成投资建议。
binance/binance-skills-hub1.2k
Claude Trading Skills (AGIPro)
Skill68 个交易与量化技能,以加密货币和 DeFi 为主:行情与链上数据、技术指标、回测、仓位与风控、预测市场,以及成本计算、洗售识别等税务记账。多数需本机 Python 和数据平台的 API Key(多有免费档);结果需专业人员复核。
agiprolabs/claude-trading-skills613
TradingView MCP
MCP提供股票、加密货币、外汇与期货的实时行情、涨跌榜与放量筛选、多周期技术分析和策略回测。无需 TradingView 账号或 API Key;社区项目,与 TradingView 官方无关。
atilaahmettaner/tradingview-mcp5.4k