Skip to content
Back to search

agent-trade-kit

OKX trading MCP server — connect AI agents to spot, swap, futures, options & grid bots via the Model Context Protocol.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/okx/agent-trade-kit with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/okx/agent-trade-kit'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/okx--agent-trade-kit/badge.svg)](/listings/okx--agent-trade-kit)

HTML

<a href="/listings/okx--agent-trade-kit"><img src="/api/listings/okx--agent-trade-kit/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**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](docs/configuration.md#one-line-install) — handles Node.js check, install, and client detection automatically. > > For live trading, multiple profiles, or other clients, see [configuration →](docs/configuration.md).

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 186 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # OKX Agent Trade Kit
  2. [![CI](https://github.com/okx/agent-tradekit/actions/workflows/ci.yml/badge.svg)](https://github.com/okx/agent-tradekit/actions/workflows/ci.yml)
  3. [![codecov](https://codecov.io/gh/okx/agent-tradekit/branch/master/graph/badge.svg)](https://codecov.io/gh/okx/agent-tradekit)
  4. [![npm: mcp](https://img.shields.io/npm/v/okx-trade-mcp?label=okx-trade-mcp)](https://www.npmjs.com/package/okx-trade-mcp)
  5. [![npm downloads: mcp](https://img.shields.io/npm/dt/okx-trade-mcp?label=mcp+total+downloads)](https://www.npmjs.com/package/okx-trade-mcp)
  6. [![npm: cli](https://img.shields.io/npm/v/okx-trade-cli?label=okx-trade-cli)](https://www.npmjs.com/package/okx-trade-cli)
  7. [![npm downloads: cli](https://img.shields.io/npm/dt/okx-trade-cli?label=cli+total+downloads)](https://www.npmjs.com/package/okx-trade-cli)
  8. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
  9. [English](README.md) | [中文](README.zh-CN.md)
  10. OKX Agent Trade Kit — an AI-powered trading toolkit with two standalone packages:
  11. | Package | Description |
  12. |---|---|
  13. | `okx-trade-mcp` | MCP server for Claude / Cursor and any MCP-compatible AI client |
  14. | `okx-trade-cli` | CLI for operating OKX from terminal |
  15. ---
  16. ## What is this?
  17. OKX Agent Trade Kit connects AI assistants directly to your OKX account via the [Model Context Protocol](https://modelcontextprotocol.io). Instead of switching between your AI and the exchange UI, you describe what you want — the AI calls the right tools and executes it.
  18. It runs as a **local process** with your API keys stored only on your machine. No cloud services, no data leaving your device.
  19. ## Features
  20. | Feature | Description |
  21. |---------|-------------|
  22. | **170 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 |
  23. | **Algo orders built-in** | Conditional, OCO take-profit/stop-loss, trailing stop |
  24. | **Safety controls** | `--read-only` flag, per-module filtering, built-in rate limiter |
  25. | **Zero infrastructure** | Local stdio process, no server or database required |
  26. | **MCP standard** | Works with Claude Desktop, Cursor, openCxxW, and any MCP-compatible client |
  27. | **Agent Skills included** | Pre-built skill files for AI agent frameworks — drop-in instructions covering market data, trading, portfolio, bots, and earn |
  28. | **Open source** | MIT license, API keys never leave your machine |
  29. ## Modules
  30. | Module | Tools | Description | Docs |
  31. |--------|-------|-------------|------|
  32. | `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** | [→](docs/modules/market.md) |
  33. | `spot` | 13 | Place/cancel/amend orders, batch orders, fills (+archive), order history (+archive), conditional orders, OCO | [→](docs/modules/spot.md) |
  34. | `swap` | 17 | Perpetual trading, batch orders, positions, leverage, conditional orders, OCO, trailing stop | [→](docs/modules/swap.md) |
  35. | `futures` | 18 | Delivery contract trading, positions, fills, order history, amend/close/leverage, batch orders, algo orders (TP/SL, OCO, trailing stop) | [→](docs/modules/futures.md) |
  36. | `option` | 10 | Options trading: place/cancel/amend/batch-cancel, order history, positions (with Greeks), fills, option chain, IV + Greeks | [→](docs/modules/option.md) |
  37. | `account` | 14 | Balance, bills (+archive), positions, positions history, fee rates, config, position mode, max withdrawal, max avail size, audit log | [→](docs/modules/account.md) |
  38. | `event` | 9 | Event contract trading: browse, series, events, markets (query); place, amend, cancel, orders, fills (private). Semantic outcome values: UP/YES/DOWN/NO | [→](docs/modules/event.md) |
  39. | `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`. | [→](docs/modules/earn.md) |
  40. | `bot` | 26 | Trading bots: Grid (9), DCA — Spot & Contract (9) and Smart Portfolio (8). Sub-modules: `bot.grid`, `bot.dca`, `bot.smartportfolio`. Recurring Buy is available as CLI-only `okx bot recurring` commands (no MCP tools) | [→](docs/modules/bot.md) |
  41. | `news` | 7 | Crypto news: latest news, by-coin filter, full-text search, article detail, news sources, coin sentiment (snapshot + trend) | [→](docs/modules/news.md) |
  42. | `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 | [→](docs/modules/smartmoney.md) |
  43. ---
  44. ## Quick Start
  45. **Prerequisites:** Node.js >= 18
  46. ```bash
  47. # 1. Install
  48. npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli
  49. # 2. Configure OKX API credentials (interactive wizard)
  50. okx config init
  51. # 3. Register the MCP server with your AI client
  52. okx-trade-mcp setup --client claude-desktop
  53. okx-trade-mcp setup --client cursor
  54. okx-trade-mcp setup --client claude-code
  55. okx-trade-mcp setup --client vscode # writes .mcp.json in current directory
  56. ```
  57. > **Alternative:** [One-line install script](docs/configuration.md#one-line-install) — handles Node.js check, install, and client detection automatically.
  58. >
  59. > For live trading, multiple profiles, or other clients, see [configuration →](docs/configuration.md).
  60. ---
  61. ## okx-trade-mcp
  62. ```bash
  63. okx-trade-mcp # default: spot, swap, account
  64. okx-trade-mcp --modules market # market data only (no auth needed)
  65. okx-trade-mcp --modules spot,account # spot trading + account
  66. okx-trade-mcp --profile live --modules all # all modules including earn
  67. okx-trade-mcp --read-only # query tools only, no writes
  68. ```
  69. [Startup scenarios →](docs/configuration.md#startup-scenarios) — [VS Code · Windsurf →](docs/configuration.md)
  70. ---
  71. ## okx-trade-cli
  72. ```bash
  73. okx market ticker BTC-USDT
  74. okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
  75. okx account balance
  76. ```
  77. > **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](docs/cli-reference.md#cli-vs-mcp-tool-names).
  78. **[Full CLI reference →](docs/cli-reference.md)**
  79. ---
  80. ## Agent Skills
  81. Pre-built skill files for AI agent frameworks are included in the [`skills/`](skills/) directory. Each skill tells the agent when to activate and how to use the `okx` CLI for a specific task category.
  82. | Skill | Description | Auth |
  83. |-------|-------------|:----:|
  84. | [`okx-cex-market`](skills/okx-cex-market/SKILL.md) | Market data: prices, candles, order books, funding rates, technical indicators | No |
  85. | [`okx-cex-trade`](skills/okx-cex-trade/SKILL.md) | Order management: spot, swap, futures, options, algo orders | Yes |
  86. | [`okx-cex-portfolio`](skills/okx-cex-portfolio/SKILL.md) | Account: balances, positions, P&L, transfers | Yes |
  87. | [`okx-cex-bot`](skills/okx-cex-bot/SKILL.md) | Trading bots: grid, DCA (spot & contract), Smart Portfolio and Recurring Buy | Yes |
  88. | [`okx-cex-earn`](skills/okx-cex-earn/SKILL.md) | Earn: Simple Earn, On-chain staking, Dual Investment, AutoEarn | Yes |
  89. | [`okx-cex-smartmoney`](skills/okx-cex-smartmoney/SKILL.md) | Smart Money: trader leaderboard, consensus signals, position analysis | Yes |
  90. **[Skills documentation →](skills/README.md)**
  91. ---
  92. ## Reporting Issues
  93. If a tool call or CLI command fails, open an issue and include the full error output.
  94. **MCP** — copy the structured error block shown in your AI client:
  95. ```json
  96. {
  97. "tool": "swap_place_order",
  98. "error": true,
  99. "type": "OkxApiError",
  100. "code": "51020",
  101. "message": "Order quantity invalid",
  102. "endpoint": "POST /api/v5/trade/order",
  103. "traceId": "abc123def456",
  104. "timestamp": "2026-03-03T10:00:00.000Z",
  105. "serverVersion": "1.0.4"
  106. }
  107. ```
  108. **CLI** — paste the full stderr output:
  109. ```
  110. Error: Order quantity invalid
  111. TraceId: abc123def456
  112. Hint: Check order size against instrument minSz.
  113. Version: okx-trade-cli@1.0.4
  114. ```
  115. See **[FAQ →](docs/faq.md)** for common issues.
  116. ---
  117. ## Build from Source
  118. ```bash
  119. git clone https://github.com/okx/agent-tradekit.git && cd okx-trade-mcp
  120. pnpm install && pnpm build
  121. ```
  122. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full development guide.
  123. ```
  124. packages/
  125. ├── core/ # shared client & tools
  126. ├── mcp/ # MCP Server
  127. └── cli/ # CLI tool
  128. ```
  129. ---
  130. ## Documentation
  131. | Document | Description |
  132. |----------|-------------|
  133. | [Architecture](ARCHITECTURE.md) | System design and module overview |
  134. | [Contributing](CONTRIBUTING.md) | Development setup and PR guidelines |
  135. | [Changelog](CHANGELOG.md) | Version history |
  136. | [Agent Skills](skills/README.md) | Pre-built skills for AI agent frameworks |
  137. | [Security](SECURITY.md) | Vulnerability reporting |

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.