Skip to content

Back to the catalog

OKX Agent Trade Kit (okx-trade-mcp / okx-trade-cli)
github.comrepo

OKX Agent Trade Kit (okx-trade-mcp / okx-trade-cli)

OKX Agent Trade Kit is an open-source MCP server (okx-trade-mcp) and CLI (okx-trade-cli) that let AI assistants like Claude Desktop, Cursor, Claude Code and VS Code place trades and query account data on the OKX exchange via natural-language commands. It runs locally with API keys never leaving the machine, supports module scoping (market, spot, swap, account, earn), a read-only mode for safe querying, multiple profiles, and includes pre-built skill files for agent frameworks plus structured JSON error reporting for debugging failed tool calls.

TL;DR An MCP server + CLI that lets AI agents execute OKX exchange trades locally via tool calls.
Document

What it claims

Two npm packages, @okx_ai/okx-trade-mcp (an MCP server) and @okx_ai/okx-trade-cli (the okx command), share one core client. Together they let an AI client place and query OKX trades. The process runs locally and stores API keys on the user's machine. The page states "No cloud services, no data leaving your device." This refers to the toolkit itself. Requests still go to the OKX API, for example POST /api/v5/trade/order.

How to use it

Requires Node.js >= 18.

npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli
okx config init
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

Module scoping and modes:

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

Points the summary does not cover:

  • The default is not read-only. With no flags, the server exposes spot, swap and account tools, which include order placement. You must pass --read-only explicitly.
  • market needs no credentials. You can trial the server without creating an API key.
  • earn is only enabled through --modules all.
  • Live trading uses a named profile (--profile live). Live setup is documented on a separate configuration page, not in this README.

Direct CLI use:

okx market ticker BTC-USDT
okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
okx account balance

Naming trap: CLI subcommands are space-separated (okx swap algo place). The MCP tool names use underscores (swap_place_algo_order). Converting an MCP name to a hyphenated command, such as okx swap place-algo, is invalid. Keep this in mind if an agent is meant to drive the CLI through the bundled skills/ files.

Structured MCP errors carry tool, type (e.g. OkxApiError), the OKX code, endpoint, traceId and serverVersion. CLI errors print TraceId and a Hint line, e.g. "Check order size against instrument minSz."

Building from source uses pnpm (pnpm install && pnpm build). The repo is split into packages/core, packages/mcp and packages/cli.

Limits

  • The page states no licence.
  • The source-build instructions don't match this repo. The clone URL is okx/agent-tradekit.git, not agent-trade-kit, and the next step is cd okx-trade-mcp. Check both before scripting a build.
  • The version shown in the examples is 1.0.4, which suggests an early release.
  • The README describes no safeguards beyond --read-only and module scoping: no order-size caps and no confirmation step.
  • Support for Windsurf and other clients is only linked, not described.

Organisations named here

  • OKX
  • Claude Code
  • Cursor

Technologies named here

  • okx-trade-mcp
  • okx-trade-cli
  • Model Context Protocol
  • Node.js
  • Claude Code
  • Cursor
  • Claude Desktop
  • VS Code
  • Windsurf