Model or dataset
okx/agent-trade-kit avatar
okx/agent-trade-kit

OKX Agent Trade Kit: the exchange, exposed to an agent over local stdio

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

511 stars83 forksTypeScriptMIT

At a glance

What is it?
Two packages, an MCP server and a CLI, that give an AI client the OKX API and nothing else: it runs as a local process, with a read-only flag, per-module filtering and a rate limiter. Authenticated calls still transmit the API key, passphrase and signature to OKX.
Who is it for?
OKX Agent Trade Kit fits someone who already trusts an agent with a brokerage session and wants the exchange's own API surface rather than a wrapper with opinions, since the tool names map onto OKX modules and the CLI and MCP views are kept deliberately in sync. It does not fit someone exploring the API, because installing it means handing a local process live credentials and, without --read-only, order placement across spot, swap, futures, options and bots.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • okx/agent-trade-kit511 ★ · +86
Star history
Repository2026-09-122026-11-15
okx/agent-trade-kit425511

86 Stars in the last 64 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

A local process, not a service you sign in to

The architecture choice is the first thing to understand. This is not a hosted bridge with your keys pasted into a web form. The MCP server runs as a local process connected by stdio, but its purpose is to call the remote OKX API. Private requests transmit an API key, passphrase and signature to OKX; the secret key is used to generate the signature. Local stdio does not by itself guarantee that credentials or account data stay on the device, including when an AI client processes tool outputs. Zero infrastructure is listed as a feature in its own right: no server, no database, nothing to deploy. What ships is two standalone npm packages, okx-trade-mcp for Claude, Cursor and any MCP-compatible client, and okx-trade-cli for driving the same API from a terminal. The intended workflow is that you describe what you want and the assistant calls the tool that does it, instead of you switching between a chat window and the exchange interface.

The tool count does not add up

The features table claims 167 tools across 11 modules and 17 sub-modules. The module table below it gives a per-module count for each of the eleven: market 19, spot 13, swap 17, futures 18, option 10, account 14, event 9, earn 24, bot 14, news 7 and smartmoney 10. Those add up to 155, not 167. Either the headline counts something the table does not, plausibly tools exposed by sub-modules that get counted twice, or one of the two numbers has drifted from the other. It is a small thing, but it is the kind of detail worth resolving before you rely on the figure, because the same table is where you decide which modules to enable.

Modules follow the exchange's own product names

The eleven modules are named after what OKX sells, which makes the surface predictable. market covers ticker, orderbook, candles and their history, index ticker and candles, price limit, funding rate, mark price, open interest, stock tokens, plus more than seventy technical indicators from moving averages to KDJ and BTCRAINBOW, and all of that needs no authentication. spot covers placing, cancelling and amending orders, batch orders, fills and order history with archives, conditional orders and OCO. swap and futures add positions, leverage and algo orders, with futures carrying TP/SL, OCO and trailing stop. option adds positions with Greeks, an option chain and implied volatility. account holds balances, bills, positions history, fee rates, config, position mode and audit log. earn is the largest at 24, split into savings, on-chain, dual-currency deposit and flash sub-modules. bot is grid and DCA for spot and contract. event trades prediction-style contracts with outcome values UP, YES, DOWN and NO. news and smartmoney are read-only, the latter split by entry mode so an agent can tell them apart.

Three dials that decide how much the agent can do

The safety controls are the part to configure before anything else. The first is --read-only, which leaves query tools in place and removes writes. The second is module selection: with no flag the server starts with spot, swap and account, --modules market gives you market data with no authentication needed at all, --modules spot,account narrows it further, and --profile live --modules all opens everything including earn. The third control is built into the server rather than the flag set: a rate limiter. Between them, read-only plus a single data module gives you a way to evaluate whether an agent is competent with your exchange data before it can place an order, which is the only sensible order to do this in.

Spaces in the CLI, underscores in MCP

One naming rule is called out because agents break it. CLI subcommands are separated by spaces, so an algo order is okx swap algo place, while the same capability appears to an MCP client as swap_place_algo_order. The README warns specifically against converting MCP identifiers into hyphen-joined commands: okx swap place-algo is not valid. The CLI itself is unsurprising:

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

Setup follows the same split, with okx config init running an interactive credential wizard and okx-trade-mcp setup --client taking claude-desktop, cursor, claude-code or vscode, where the vscode choice writes .mcp.json into the current directory. The server side has the matching set of flags:

bash
okx-trade-mcp                                        # default: spot, swap, account
okx-trade-mcp --modules market                       # market data only (no auth needed)
okx-trade-mcp --read-only                            # query tools only, no writes

That last line is the difference between an assistant that can look at your positions and one that can change them.

Skills that tell an agent when to use the CLI

A directory of skills/ folders ships with the repository, each holding a SKILL.md that tells an agent when to activate and how to use the okx CLI for one category of task. The four named are okx-cex-market for prices, candles, order books, funding rates and technical indicators, which needs no authentication; okx-cex-trade for order management across spot, swap, futures, options and algo orders, which does; okx-cex-portfolio for balances, positions, P&L and transfers, which does; and okx-cex-bot for the bot module. That last column is the useful part, because it tells you which skills are safe to expose to a client before you have decided anything about credentials. Skills sit alongside a docs/ tree with per-module pages and a separate CLI reference.

One credential in the example file is not an OKX key

.env.example lists the three exchange values you would expect, OKX_API_KEY, OKX_SECRET_KEY and OKX_PASSPHRASE, and then a fourth: GITLAB_PERSONAL_ACCESS_TOKEN, annotated as being used by the /fix-issues skill. That is a repository maintenance credential rather than a trading one, and it is worth separating in your own setup so an agent with market-data access is never holding a token that can push to your GitLab. Beside it sits config.toml.example. The manifest is the hub for the monorepo: named okx-hub, marked private, versioned 1.4.8, with packages/* as its only workspace, a build that goes core then the MCP server then the CLI, engines pinned to Node 18 or newer and pnpm 9 or newer, and tests run through tsx --test under c8 with the Model Context Protocol SDK held as a devDependency. Docs ship in English and Chinese, and there are no GitHub releases; the last push on the github-main branch is dated 23 September 2026.

Editorial conclusion

OKX Agent Trade Kit fits someone who already trusts an agent with a brokerage session and wants the exchange's own API surface rather than a wrapper with opinions, since the tool names map onto OKX modules and the CLI and MCP views are kept deliberately in sync. It does not fit someone exploring the API, because installing it means handing a local process live credentials and, without --read-only, order placement across spot, swap, futures, options and bots. Before you connect a client, decide the module list rather than taking the default, because the default already includes spot, swap and account, and check the count discrepancy first: the headline claims 167 tools while the module table adds up to 155. If you only want data, --modules market needs no authentication at all, which is the cheapest way to find out whether the agent is useful before it can spend anything.

Frequently asked questions

What is the OKX Agent Trade Kit?

It is a pair of packages: okx-trade-mcp, an MCP server for Claude, Cursor and any MCP-compatible client, and okx-trade-cli, a terminal client for the same API. It runs as a local process with your keys on your machine, so there is no cloud service and no data leaving the device.

How many tools does the OKX Agent Trade Kit expose?

The features table claims 167 tools across 11 modules and 17 sub-modules, while the per-module counts in the module table add up to 155: market 19, spot 13, swap 17, futures 18, option 10, account 14, event 9, earn 24, bot 14, news 7 and smartmoney 10.

Can I run the OKX MCP server without letting it place orders?

Yes. Passing --read-only leaves query tools in place and no writes, and --modules narrows the surface further, since the default is spot, swap and account while --modules market needs no authentication at all. A rate limiter is built into the server on top of those flags.

What does the OKX Agent Trade Kit need installed?

Node.js 18 or newer, then npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli, followed by okx config init for the credentials and okx-trade-mcp setup --client with claude-desktop, cursor, claude-code or vscode, where vscode writes .mcp.json in the current directory.

Which API keys does the OKX Agent Trade Kit read?

OKX_API_KEY, OKX_SECRET_KEY and OKX_PASSPHRASE from the environment. The example file also exports GITLAB_PERSONAL_ACCESS_TOKEN, which the /fix-issues skill uses, so that one is a repository maintenance credential rather than an exchange credential.

Official sources

  1. Issues
  2. License: MIT
  3. okx/agent-trade-kit on GitHub
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/okx-agent-trade-kit.svg)](https://hysenlabs.com/projects/okx-agent-trade-kit)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/okx-agent-trade-kit.svg)](https://hysenlabs.com/projects/okx-agent-trade-kit)

Was this useful?