← All tools · Guides

OKX Agent Trade Kit: connecting AI agents to OKX with MCP, the CLI and Agent Skills

Decide what the AI is allowed to do before it says a word

Short answer: if you already trade on OKX and only want an AI to read prices and positions, use the MCP server with --read-only or a demo key. If you want your own scripts or scheduled jobs, use the CLI and leave the language model out. If your client loads skill files instead of MCP servers, add okx/agent-skills. None of this backtests anything, and it is not a bot that trades around the clock: a misread sentence can become a real order.

This site has no partnership with OKX and no referral links. Features were checked on 2026-10-19 against okx/agent-trade-kit (default branch github-main), okx/agent-skills and OKX's product docs, which state that they may lag behind the repository. On that day the latest versions of @okx_ai/okx-trade-mcp and @okx_ai/okx-trade-cli on npm were 1.4.9. A Chinese version of this guide is here.

Three ways to connect

OKX Agent Trade Kit is OKX's open-source toolkit, MIT-licensed, running on your own machine. The README installs two packages, the MCP server @okx_ai/okx-trade-mcp and the CLI @okx_ai/okx-trade-cli, and requires Node.js 18 or later. The separate Agent Skills repository holds instruction files that tell an agent when to call the okx command.

OptionWhat it isWho it suitsNeeds an AI client
MCP serverA local MCP service; the AI calls its tools in natural languagePeople already using Claude, Cursor, VS Code or another MCP clientYes
CLIThe okx terminal command, pipeable into scripts and scheduled jobsPeople who want their own scripts, or no model touching the accountNo
Agent SkillsInstruction files for skill-aware clients; underneath they still run okx commandsClients that load skill files rather than MCP serversYes

One trap: the npm badges at the top of the README point to the unscoped packages okx-trade-mcp and okx-trade-cli, which were still at 1.2.8 on 2026-10-19. Install the scoped @okx_ai/... packages that the README's install command uses.

npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli
okx config init                              # interactive credential setup
okx-trade-mcp setup --client claude-desktop  # or cursor, claude-code, vscode

Commands as written in the repository README on 2026-10-19.

What it can reach on OKX

Market data, spot, perpetuals, futures, options, algo orders, the account and trading bots appear in both the product docs and the README. The README also lists earn products, event contracts, news and smart-money signals. Treat the repository as the complete list.

ModuleWhat it covers
marketTickers, order books, candles, funding rates, open interest and technical indicators. Public data, no API key needed
spot / swap / futures / optionPlacing, amending and cancelling orders across spot, perpetuals, delivery futures and options, plus leverage and positions on the derivatives side
algo ordersConditional orders, OCO take-profit and stop-loss, trailing stops. Built into the spot and derivatives modules rather than a separate module
accountBalances, positions, bills, fee rates and position mode
botGrid and DCA bots: create, inspect and stop
earn / event / news / smartmoneyEarn products, event contracts, news and coin sentiment, smart-money signals

Do not memorise a tool count. The README headline says 167 tools across 11 modules, but its own per-module table adds up to fewer; docs/module-registry.md also says 167; and docs/configuration.md still says 128 tools across 13 modules. This guide describes capabilities by module instead.

Your configuration must point to the OKX site where your account is registered. The configuration guide lists global (the default), eea, us and tr, and it now also describes signing in with okx auth login, which issues a token for one specific site. The kit cannot do anything your account is not allowed to do on OKX, such as derivatives where they are restricted.

Skills are instructions, not another API

The okx/agent-skills README defines a skill as a Markdown file with a YAML header: it tells the client when to activate and how to call the already-installed okx command. Skills do not connect to the exchange on their own. The product docs name four, the skills folder inside the trade kit repo lists six, and the skills repository README lists the nine below; go by the README you actually clone.

SkillCoversCredentials
okx-cex-marketPublic market data and indicatorsNo
okx-cex-tradeSpot, derivatives, options and algo ordersYes
okx-cex-portfolioBalances, positions, P&L, transfersYes
okx-cex-botGrid and DCA botsYes
okx-cex-earnEarn productsYes
okx-cex-smartmoneyTrader leaderboard and signalsYes
okx-cex-authSign in and write or update local credentialsFor setup
okx-sentiment-trackerNews and coin sentimentYes
okx-cex-skill-mpSearch, install and update skill packagesYes

The skills README also notes a client limit: Codex CLI accepts skill descriptions of at most 1024 characters.

Not a trading bot, not a research agent

Freqtrade, OctoBot and Jesse are trading bots: you write or configure rules first, and they keep placing orders by those rules. That choice is how to choose a trading bot. Agent Trade Kit is closer to a remote control: one instruction from you or the model, one call to the OKX API. Close the conversation and nothing keeps running.

Projects such as TradingAgents are research tools: several models discuss a stock and write a report, without connecting to your OKX account. See the LLM trading agents comparison for those. If you want to test a strategy before trading it, start with data and a backtesting framework, not here.

Keys, demo trading and read-only mode

Keys live only in ~/.okx/config.toml on your machine, and both the MCP server and the CLI read that file. Never paste an API key, secret or passphrase into a chat with an AI. OKX's product docs strongly recommend a sub-account API key rather than your main account, with only the permissions you need.

To look at prices without placing anything (public market data needs no key):

okx-trade-mcp --modules market
okx market ticker BTC-USDT

Cursor's tool limit

The repository's docs/configuration.md warns that Cursor enforces a limit of roughly 40 tools per MCP server and roughly 80 in total, as of early 2026. Starting the server with --modules all can make every MCP server in Cursor show Error.

The same note gives a total of 128 tools, which no longer matches the README, so ignore its numbers and keep the advice: load only the modules you need with --modules. The docs suggest registering several server instances with different module sets when one server is not enough; that gets around the per-server limit, but every server still counts toward the overall total of roughly 80.

okx-trade-mcp setup --client cursor --modules market,account,spot,swap

This example comes from the repository's Cursor section. Check how many tools your installed version actually loads.

How to choose

Frequently asked questions

What is OKX Agent Trade Kit?

An open-source toolkit published by OKX, under the MIT licence, that lets an AI client or a terminal command read OKX market data and, if you allow it, place orders on your account. It runs on your own computer and keeps API keys in ~/.okx/config.toml. It only talks to OKX.

What is the difference between the MCP server, the CLI and Agent Skills?

The MCP server is a local service that MCP clients such as Claude or Cursor call in natural language. The CLI is the okx terminal command, suited to scripts and scheduled jobs without any language model. Agent Skills are instruction files that tell skill-aware clients when and how to run okx commands. All three share the same local configuration.

Can I use it without an API key?

For public market data, yes: the README says the market module needs no authentication. Account data and trading need your own OKX API key, with read and trade permissions only and no withdrawal permission.

Why do all my MCP servers show Error in Cursor after adding it?

The repository's configuration guide notes that Cursor limits each MCP server to roughly 40 tools and all servers together to roughly 80, as of early 2026. Loading every module at once exceeds that. Load only the modules you need with --modules, and do not rely on the tool counts quoted in that note, which disagree with the README.

Is it a trading bot like Freqtrade?

No. A trading bot keeps executing rules you defined. Agent Trade Kit acts once per instruction from you or the model, has no backtesting of its own, and does not keep running a strategy after the conversation ends.

Does it cost money, and can I lose money with it?

The software is MIT-licensed and free to use. Trading is another matter: a language model can misunderstand an instruction, and any order it places can lose money, which is your responsibility. Start with demo keys and --read-only. This is not investment advice.

Nothing on this page is investment advice. Crypto trading can lose your entire stake, and language models misread instructions. Features, licences and client limits follow OKX's repository and docs; check their latest versions before relying on them.