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 with your API keys stored only on your machine. No cloud services, no data leaving your device.
local process
Features
| Feature | Description |
|---------|-------------|
| 164 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 | 10 | Trading bots: Grid (5) and DCA — Spot & Contract (5). Sub-modules: bot.grid, bot.dca | → |
| 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 | → |
| outcomes | 0 (wrapper) | OKX Outcomes (YES/NO event contracts, formerly OKX Predictions) — CLI-only wrapper that forwards to the external okx-outcomes binary (installed via install.sh from github.com/okx/outcomes-cli). Browse events, account queries (OAuth), CLOB price/orderbook, dry-run-gated trade placement, and CTF split/merge/redeem | → |
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
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-algo is not valid. See CLI reference · CLI vs MCP tool names.
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.