market-insight Intermediate

OKX Agent Trade Kit: 82 AI Trading Tools via MCP — What Every Trader Needs to Know

Sentinel Team · 2026-03-10

On March 3, 2026, OKX open-sourced Agent Trade Kit on GitHub -- a Model Context Protocol (MCP) based trading toolkit that lets AI agents directly execute trades, manage positions, and run grid bots on OKX.

This is not just another API wrapper. OKX is the first major exchange to ship native AI infrastructure, signaling a fundamental shift in how crypto trading bots will be built. If you are new to the protocol that makes this possible, read our MCP Protocol Explained for Traders guide first.

Alongside the main toolkit, OKX also released Agent Skills -- four pre-built Markdown skill files that let LLM agents drive the trading CLI via natural language -- and OnchainOS Skills for on-chain wallet, DEX, and token analysis. Together, these three open-source projects form OKX's complete AI developer ecosystem, bridging centralized and decentralized trading under a single agent interface.

What is OKX Agent Trade Kit?

Two NPM packages form the core (full source code under MIT license):

The MCP server exposes structured tool schemas that any compatible AI model can understand natively. When you ask your AI assistant to "buy 0.1 BTC at market price," the model maps that instruction to the correct tool call, and the local MCP server handles authentication, request signing, and order submission -- all without the model ever touching your credentials.

The CLI counterpart provides the same capabilities in a scriptable format, making it ideal for cron jobs, CI/CD pipelines, and automated monitoring workflows where you do not need a conversational AI interface.

7 Modules, 82 Tools

| Module | Tools | Coverage |

|--------|-------|----------|

| market | 12 | Tickers, orderbooks, candles, funding rates, open interest |

| spot | 13 | Order placement, batch operations, conditional orders, OCO |

| swap | 17 | Perpetuals, positions, leverage, trailing stops |

| futures | 6 | Delivery contracts, fills, order history |

| option | 10 | Options trading, Greeks (Delta/Gamma/Theta/Vega), IV data |

| account | 14 | Balance, bills, fee rates, audit logs |

| bot | 10 | Grid trading (5 tools) + DCA bots (5 tools) |

!OKX Agent Trade Kit Module Hierarchy: 7 modules with 82 tools across market data, spot, swap, futures, options, account, and bot management

The options module is particularly notable -- this is the first time any exchange has provided AI-native access to Greeks data. No other exchange MCP toolkit currently supports options trading, giving OKX a significant head start in derivatives AI tooling.

Module Deep-Dive: What Each Module Actually Does

Understanding each module in depth is essential for designing effective agent workflows. Here is what you can do with each one and when to use it.

Market Module (12 Tools)

The market module requires no authentication, making it the safest starting point. It covers real-time ticker data for any trading pair, full orderbook depth snapshots, historical candlestick data across multiple timeframes (1m to 1M), funding rate queries for perpetual contracts, and open interest tracking.

Use case: Build a market monitoring agent that tracks funding rate divergences across BTC, ETH, and SOL perpetuals. When funding rates exceed a threshold, the agent alerts you or triggers a trade via the swap module.

Spot Module (13 Tools)

Covers the complete spot trading lifecycle: market orders, limit orders, batch order placement (up to 20 orders in a single call), order amendment and cancellation, conditional orders with trigger prices, and OCO (one-cancels-other) paired orders.

Use case: A DCA agent that places a batch of limit buy orders at 1%, 2%, 3%, 5%, and 8% below current price whenever BTC drops more than 3% in 24 hours.

Swap Module (17 Tools)

The most tool-rich module, covering perpetual contract operations: opening and closing positions, adjusting leverage from 1x to 125x, setting take-profit and stop-loss levels, trailing stop orders, position queries and P&L tracking, and margin mode switching between cross and isolated.

Use case: A hedging agent that automatically opens a short perpetual position when your spot portfolio exceeds a value threshold, dynamically adjusting leverage based on market volatility.

Futures Module (6 Tools)

Focused on delivery (expiring) contracts rather than perpetuals. Includes order placement and management, fill history queries, and contract specification lookups.

Use case: Calendar spread strategies where an agent simultaneously trades near-month and far-month contracts to capture basis convergence.

Options Module (10 Tools)

The most differentiated module in the entire MCP trading ecosystem. Provides option chain data with strikes and expirations, Greeks calculations (Delta, Gamma, Theta, Vega) for individual positions, implied volatility surfaces, and position management for options portfolios.

Use case: A volatility trading agent that monitors IV percentile ranks and automatically sells strangles when IV is elevated, buying protective wings to define maximum risk.

Account Module (14 Tools)

Essential for portfolio oversight: balance queries across all currencies, trading bill history with detailed breakdowns, fee rate lookups by instrument type, position risk summaries, and audit log access for compliance.

Use case: A daily reporting agent that generates portfolio snapshots, calculates realized P&L, and tracks fee expenditure over time.

Bot Module (10 Tools)

Split evenly between grid trading (5 tools) and DCA bots (5 tools). Grid tools cover creation with configurable price ranges and grid counts, status monitoring, profit tracking, and termination. DCA tools handle recurring purchase scheduling, amount configuration, and execution history.

Use case: A range-detection agent that identifies consolidation periods using Bollinger Band width, then deploys grid bots during low-volatility phases and terminates them when breakout signals appear.

Step-by-Step Setup Tutorial

Getting started with OKX Agent Trade Kit takes about 10 minutes. Here is the complete process from installation to your first AI-powered trade.

Prerequisites

Step 1: Install the Packages

npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli

This installs both the MCP server and the CLI tool globally.

Step 2: Configure Your API Credentials

okx config init

This launches an interactive wizard that prompts you for your OKX API key, secret key, and passphrase. Credentials are stored locally in ~/.okx/config.toml and never leave your machine. For a deeper understanding of API key security practices, see our guide on crypto bot security and API keys.

You can create multiple profiles for different purposes:

[default]
api_key = "your-live-key"
secret_key = "your-live-secret"
passphrase = "your-passphrase"

[demo]
api_key = "your-demo-key"
secret_key = "your-demo-secret"
passphrase = "your-demo-passphrase"
flag = "1"

Setting flag = "1" activates OKX Demo Trading mode -- essential for risk-free testing.

Step 3: Register with Your AI Client

okx-trade-mcp setup --client claude-desktop

Replace claude-desktop with cursor, vscode, or claude-code depending on your environment. This command automatically adds the MCP server configuration to your client.

Step 4: Start with Read-Only Mode

For your first session, restrict the agent to queries only:

okx-trade-mcp --read-only

Now open your AI client and try: "What is the current BTC-USDT price and 24h volume?" The agent will call the market ticker tool and return live data.

Step 5: Enable Selective Modules

Once comfortable, enable specific trading modules:

okx-trade-mcp --modules market,spot,account

This exposes market data, spot trading, and account queries while keeping derivatives locked down.

Step 6: Execute Your First Trade

With spot module enabled, try: "Place a limit buy order for 50 USDT worth of ETH at 5% below the current price." The agent calculates the target price, determines the correct quantity, and submits the order -- all while signing the request locally.

Step 7: Verify and Monitor

Use the CLI to verify independently:

okx spot orders BTC-USDT
okx account balance

Always cross-check AI-placed orders through the CLI or the OKX web interface.

Security: Local-First Architecture

!MCP Security Architecture: Traditional API vs MCP approach showing how credentials stay local and never reach the AI model

The biggest concern with AI-powered trading: can the AI leak my API keys?

Agent Trade Kit uses a local-first design that fundamentally separates credential access from AI model access:

  1. Local key storage -- API credentials live in ~/.okx/config.toml on your machine, never uploaded anywhere
  2. Local HMAC-SHA256 signing -- The MCP server reads your config locally and signs all API requests. The AI model never sees your private key or passphrase
  3. Permission-aware startup -- The server reads your API key permissions at launch and excludes unauthorized tools from the agent's available actions
  4. Read-only mode -- Add --read-only flag to restrict AI to queries only
  5. Selective module loading -- Only expose market data (no auth needed) if you prefer
  6. Demo profile -- Configure a simulated trading profile for zero-risk testing
  7. Open-source audit -- MIT license means anyone can inspect the code for security vulnerabilities

This aligns perfectly with Sentinel Bot's zero-knowledge architecture -- your API keys never leave your device.

2026 Updates: OnchainOS Integration and Ecosystem Growth

Since the initial March 3 launch, OKX has rapidly expanded the Agent Trade Kit ecosystem. Here are the key developments.

OnchainOS: The DeFi Counterpart

Agent Trade Kit handles centralized exchange operations. OnchainOS is its decentralized counterpart -- an AI layer that unifies wallet infrastructure, liquidity routing, and on-chain data feeds across more than 60 blockchains and 500+ decentralized exchanges.

Together, they create a continuous operating environment where an AI agent can:

OnchainOS already processes 1.2 billion daily API calls with sub-100ms response times and 99.9% uptime, making it production-ready infrastructure.

Agent Skills: Natural Language Trading

The Agent Skills repository provides four modular skill packages:

These Markdown skill files can be loaded into any LLM context, lowering the barrier further for non-developers who want AI-assisted trading.

Gas-Free Agent Payments

A notable addition is the x402 protocol integration on OKX's X Layer, enabling AI agents to make on-chain payments with no gas fees -- removing a significant friction point for autonomous agent operations.

Growing Tool Count

The latest GitHub release shows the toolkit has expanded beyond the initial 82 tools. The earn module alone adds 21 tools covering savings products, on-chain staking, and dual-currency deposits, bringing the total toolkit to over 100 tools.

OKX Agent Trade Kit vs Other MCP Trading Tools

How does OKX Agent Trade Kit compare to other MCP-based trading solutions? Here is a detailed comparison. For an even deeper analysis, see our full MCP crypto trading tools comparison.

| Feature | OKX Agent Trade Kit | Sentinel MCP | CCXT MCP | Crypto.com MCP |

|---------|-------------------|--------------|----------|----------------|

| Exchange coverage | OKX only | 12 exchanges | 100+ exchanges | Crypto.com only |

| Total tools | 82+ (expanding) | 36 tools | 15-30 (varies) | ~20 tools |

| Options trading | Yes (with Greeks) | No | No | No |

| Grid/DCA bots | Yes (10 tools) | No | No | No |

| Backtesting | Demo mode only | Full historical | No | No |

| Local key storage | Yes | Yes | Varies | Yes |

| Strategy engines | No | 44 engines | No | No |

| On-chain/DeFi | Via OnchainOS | No | No | Limited |

| Open source | MIT license | MIT license | MIT license | Partial |

| Language | TypeScript/Node.js | Node.js | Python or Node.js | TypeScript |

| Setup complexity | Low (CLI wizard) | Medium | Medium-High | Low |

Key takeaway: OKX Agent Trade Kit excels at deep, single-exchange integration with unmatched derivatives coverage. CCXT MCP servers provide breadth across 100+ exchanges but with shallower integration. Sentinel MCP uniquely combines backtesting and strategy validation with execution. The ideal architecture often combines multiple MCP servers -- using Sentinel for strategy R&D and OKX Agent Trade Kit for optimized execution.

Integration with Other Tools

With Sentinel Bot

Sentinel Bot and OKX Agent Trade Kit occupy complementary layers of the trading stack. Sentinel handles strategy research, backtesting, and signal generation across 12 exchanges. Agent Trade Kit provides optimized order execution on OKX. A practical integration workflow looks like this:

  1. Design and backtest a strategy using Sentinel's 44 signal engines
  2. Validate with historical data spanning multiple market regimes
  3. Deploy the strategy as a Sentinel bot with OKX as the target exchange
  4. Use Agent Trade Kit for enhanced execution capabilities (trailing stops, OCO orders, grid bots)

For traders building their own systems, our complete guide to building an AI trading bot covers the full architecture.

With CCXT

CCXT provides a unified interface across 100+ exchanges. Agent Trade Kit provides deeper OKX-specific functionality. They are not mutually exclusive. A multi-exchange agent might use CCXT MCP for monitoring prices across Binance, Bybit, and Gate.io while using Agent Trade Kit for executing on OKX -- taking advantage of OKX-specific features like grid bots and options that CCXT does not cover.

With Other MCP Servers

The MCP protocol is designed for composability. A single AI agent can connect to multiple MCP servers simultaneously. A realistic production setup might include OKX Agent Trade Kit for execution, a market data MCP for cross-exchange analytics, a news/sentiment MCP for signal generation, and Sentinel MCP for backtesting validation. This multi-server architecture is the future of AI trading agents.

Real-World Use Cases

Use Case 1: Automated DCA Bot with Volatility Adjustment

Scenario: You want to accumulate BTC over time, but you want to buy more aggressively during dips and less during rallies.

Implementation with Agent Trade Kit:

  1. Market module fetches BTC-USDT 30-day historical volatility daily
  2. Account module checks available USDT balance
  3. If 24h price change exceeds -5%, bot module creates a DCA bot with 2x the base amount
  4. If 24h price change is between -2% and +2%, bot module creates a standard DCA bot
  5. If 24h price change exceeds +5%, skip the purchase cycle

The AI agent manages the entire decision tree through natural language rules, adjusting parameters based on market conditions without manual intervention.

Use Case 2: Grid Trading During Consolidation

Scenario: ETH has been ranging between $2,800 and $3,200 for two weeks. You want to capture range profits.

Implementation with Agent Trade Kit:

  1. Market module retrieves 14-day candlestick data to confirm the range
  2. Bot module creates a grid bot: lower bound $2,800, upper bound $3,200, 20 grids, total investment $5,000
  3. Market module monitors for breakout signals (volume spike above 2x average)
  4. If breakout detected, bot module terminates the grid and swap module opens a directional position

This combines the bot module for passive income during consolidation with the swap module for directional plays during breakouts -- all managed by a single agent conversation.

Use Case 3: Portfolio Rebalancing with Risk Controls

Scenario: You maintain a portfolio of BTC (50%), ETH (30%), SOL (20%) and want to rebalance weekly.

Implementation with Agent Trade Kit:

  1. Account module queries current balances and calculates actual allocation percentages
  2. Market module fetches current prices for all three assets
  3. Agent calculates required trades to restore target allocation
  4. Spot module executes rebalancing trades using limit orders at 0.1% above/below mid-price
  5. Account module verifies final allocations and generates a summary report

The agent handles the math, order sizing, and execution automatically. By using limit orders instead of market orders, it minimizes slippage on each rebalancing cycle.

The Four-Layer AI Trading Stack

Layer 4: Strategy R&D -- Signal engines, backtesting, parameter optimization
Layer 3: Decision Management -- Bot deployment, composite signals, risk rules
Layer 2: Multi-Exchange Routing -- Unified interface across venues
Layer 1: Order Execution -- API signing, order placement, position management

!Four-Layer AI Trading Stack: From order execution to strategy R&D, showing where OKX operates vs where Sentinel covers all layers

OKX Agent Trade Kit solves Layer 1 excellently and reaches into Layer 3 with its bot module. Layers 2 and 4 require specialized platforms.

Sentinel Bot covers the full stack:

The ideal future stack:

AI Agent -> Strategy Platform (backtest + bot management) -> Exchange MCP (execution)

The strategy platform handles the "what" and "why." The exchange MCP handles the "how."

What Agent Trade Kit Changes (and What It Does Not)

Changed: Execution barrier drops to near-zero

!Backtest to Live Trading Workflow: 5-step process from strategy idea to live deployment in under 10 minutes

Previously, building a trading bot required hand-coding API signatures, managing WebSocket reconnection, and parsing complex JSON responses. Now an AI agent can understand 82+ tool schemas natively and execute trades via natural language.

The development barrier dropped from "can write code" to "can describe intent."

Unchanged: Strategy validation remains critical

More execution tools do not solve the fundamental question: where does the strategy come from?

Before committing real capital, you need:

  1. Historical backtesting -- Validate across 3+ years of data covering bull runs and consolidation
  2. Parameter optimization -- Grid-sweep hundreds of parameter combinations for optimal Sharpe ratio
  3. Risk management -- Quantitative screening by max drawdown, win rate, and profit factor
  4. Multi-exchange deployment -- Diversify execution across multiple venues

OKX Demo Mode is a live simulator (real-time data), not a historical backtester. You cannot use it to verify how a strategy would have performed during the 2024 bull run versus the 2025 consolidation.

Frequently Asked Questions

Is OKX Agent Trade Kit free to use?

Yes. Agent Trade Kit is fully open-source under the MIT license. There are no subscription fees, usage limits, or premium tiers. You only pay standard OKX trading fees on executed trades. The source code is publicly available on GitHub for anyone to audit, fork, or contribute to.

Can the AI model see or steal my API keys?

No. This is the core security guarantee of the local-first architecture. Your API credentials are stored in a local configuration file (~/.okx/config.toml) that only the MCP server process reads. The AI model receives tool schemas and results, never raw credentials. All request signing happens locally via HMAC-SHA256 before data reaches OKX servers.

Does Agent Trade Kit support backtesting?

Not in the traditional sense. OKX offers a Demo Trading mode that simulates live trading with real-time market data, but it does not support historical backtesting -- you cannot replay past market conditions. For proper strategy validation, you need a dedicated backtesting platform like Sentinel Bot that can run simulations across years of historical data.

Which AI clients are compatible?

Agent Trade Kit works with any MCP-compatible client. Officially supported clients include Claude Desktop, Cursor, VS Code (with MCP extension), and Claude Code. The setup command automates configuration for each client. Any future client that implements the MCP specification will also work.

Can I use Agent Trade Kit with exchanges other than OKX?

No. Agent Trade Kit is built specifically for OKX. For multi-exchange coverage, you would need to combine it with other MCP servers -- such as CCXT MCP for broad exchange access or Sentinel MCP for integrated backtesting and multi-exchange execution.

How does it compare to writing my own trading bot?

Agent Trade Kit eliminates weeks of boilerplate development -- API authentication, request signing, error handling, rate limiting, and response parsing are all handled. However, it does not replace the need for strategy logic. Think of it as the execution layer that you or your AI agent builds strategies on top of. For a complete guide to the full development process, see how to build an AI trading bot.

What happens if my internet connection drops during a trade?

Orders already submitted to OKX remain active on the exchange regardless of your local connection. The MCP server is stateless -- it sends requests and receives responses. If the connection drops mid-request, the order may or may not have reached OKX. Always use the CLI or OKX web interface to verify open orders after a connection interruption.

Can I run multiple MCP servers simultaneously?

Yes. The MCP protocol is designed for composability. Your AI client can connect to OKX Agent Trade Kit, Sentinel MCP, a news analysis server, and other MCP tools all at once. The AI model decides which server to call based on the task context.

!AI Trading Decision Tree: Developer vs non-developer paths for getting started with AI-powered crypto trading

Action Items for Traders

For Developers

  1. Try it now -- npm install -g @okx_ai/okx-trade-mcp and connect to your AI environment
  2. Start with Demo -- Configure a simulated profile in config.toml first
  3. Pair with backtesting -- Use Sentinel's backtest engine to validate strategies before deploying via MCP
  4. Explore composability -- Connect multiple MCP servers to build a comprehensive trading agent

For General Traders

  1. Do not rush -- Better tools do not eliminate risk. Strategy validation still matters
  2. Learn backtesting first -- Every strategy should be historically validated before going live
  3. Start small -- Even after strong backtest results, begin with small position sizes
  4. Understand your strategy -- AI can execute for you, but you should understand every entry and exit
  5. Use read-only mode -- Explore the toolkit's capabilities without any trading risk

Conclusion

OKX Agent Trade Kit is an infrastructure milestone. It elevates AI agent execution capability with 82+ tools covering virtually every trading scenario -- from spot orders to options Greeks to automated grid bots.

The OnchainOS integration extends this capability into DeFi, creating the first unified CEX+DEX agent infrastructure from a major exchange. Combined with Agent Skills for natural language trading and the expanding tool count, OKX is building a comprehensive AI developer ecosystem.

But the execution layer will inevitably be commoditized -- Binance, Bybit, and others will follow. What remains irreplaceable is the upstream strategy R&D and risk management layer. Understanding how AI trading agents work and how to validate strategies with historical data separates profitable automation from expensive experimentation.

A backtested strategy is the only strategy worth automating.


Ready to try AI-powered quantitative backtesting? Start free with Sentinel Bot -- 7-day trial, no credit card required. 44 signal engines, fast grid backtesting, 12 exchanges.


Explore More AI Trading Topics