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.
| Option | What it is | Who it suits | Needs an AI client |
|---|---|---|---|
| MCP server | A local MCP service; the AI calls its tools in natural language | People already using Claude, Cursor, VS Code or another MCP client | Yes |
| CLI | The okx terminal command, pipeable into scripts and scheduled jobs | People who want their own scripts, or no model touching the account | No |
| Agent Skills | Instruction files for skill-aware clients; underneath they still run okx commands | Clients that load skill files rather than MCP servers | Yes |
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, vscodeCommands 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.
| Module | What it covers |
|---|---|
market | Tickers, order books, candles, funding rates, open interest and technical indicators. Public data, no API key needed |
spot / swap / futures / option | Placing, amending and cancelling orders across spot, perpetuals, delivery futures and options, plus leverage and positions on the derivatives side |
algo orders | Conditional orders, OCO take-profit and stop-loss, trailing stops. Built into the spot and derivatives modules rather than a separate module |
account | Balances, positions, bills, fee rates and position mode |
bot | Grid and DCA bots: create, inspect and stop |
earn / event / news / smartmoney | Earn 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.
| Skill | Covers | Credentials |
|---|---|---|
okx-cex-market | Public market data and indicators | No |
okx-cex-trade | Spot, derivatives, options and algo orders | Yes |
okx-cex-portfolio | Balances, positions, P&L, transfers | Yes |
okx-cex-bot | Grid and DCA bots | Yes |
okx-cex-earn | Earn products | Yes |
okx-cex-smartmoney | Trader leaderboard and signals | Yes |
okx-cex-auth | Sign in and write or update local credentials | For setup |
okx-sentiment-tracker | News and coin sentiment | Yes |
okx-cex-skill-mp | Search, install and update skill packages | Yes |
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.
- Good fit: you already have an OKX account and want to ask about prices, funding rates and positions in plain language, or occasionally place an order you have reviewed.
- Poor fit: stock markets, strategy backtesting, or a bot that should trade automatically around the clock.
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.
- Permissions: the configuration guide asks for Read and Trade. Withdrawal is neither required nor recommended. Bind the key to your IP address if you can.
- Demo trading: create a separate key for OKX demo trading, mark that profile with
demo = trueand start with--profile demo. The product docs also list a--demoflag among the safety layers; check--helpin the version you install. - Read-only:
--read-onlydisables every write operation, including orders, position changes and bot creation, while balances and market data still work. - The default is not read-only. Without extra flags the MCP server loads the spot, swap and account modules, including the tools that place orders.
To look at prices without placing anything (public market data needs no key):
okx-trade-mcp --modules market
okx market ticker BTC-USDTCursor'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,swapThis example comes from the repository's Cursor section. Check how many tools your installed version actually loads.
How to choose
- Prices, candles and funding rates only: CLI or MCP with only the
marketmodule, and no key yet. - You use Claude or Cursor and want it to see positions: MCP with
--read-onlyand a key without withdrawal permission. - Scheduled jobs or JSON processing: the CLI, which can output
--jsonfor other programs. - Your client loads skills: install the CLI, add okx/agent-skills, and enable the order-placing skills only when you need them.
- You want rules to run on their own: start with how to choose a trading bot, and paper-trade first.
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.