OKX × Claude Desktop — AI-powered Crypto Trading

OKX × Claude Desktop — AI-powered Crypto Trading, no coding required

Connect Claude AI directly to your OKX account · Spot · Futures · Options · Grid Bot · Natural language commands

5 roadblocks between you and AI Crypto Trading

OKX MCP already exists — but getting it installed correctly so Claude can "see" it is a journey of its own:

📦 #1 — Install Node.js

npm uses Node, not Python. LTS or Current? Is PATH set correctly?

🔑 #2 — Create an OKX API key

DEMO or LIVE? Sub-account or main? Where's the passphrase? IP whitelist?

📝 #3 — Edit config.toml

File lives at %USERPROFILE%\.okx\ — one wrong line and auth fails.

⚙️ #4 — Register MCP with Claude

Edit claude_desktop_config.json with exact JSON syntax.

🔌 #5 — Signature / 50113 errors

Picked the wrong DEMO/LIVE → bad signature → no clue where to fix it.

Code2trade wraps everything into 1_SETUP_chay_mot_lan.bat

A single .bat file does it all: installs Node.js, installs okx-trade-mcp, opens a wizard popup where you paste your API key — no hand-editing of any config file. The wizard verifies against OKX in real time as you type, with clear error messages before anything is saved.

😩 Manual way
  • Visit nodejs.org, download Node.js LTS
  • npm install -g @okx_ai/okx-trade-mcp
  • Create the %USERPROFILE%\.okx\ folder
  • Hand-write config.toml with api_key / secret / passphrase
  • Open claude_desktop_config.json, add the MCP entry
  • Restart Claude Desktop, hope there's no JSON error
  • Error 50113 → figure out how DEMO and LIVE differ
🚀 With Code2trade — 3 steps
  • Step 1: Double-click 1_SETUP_chay_mot_lan.bat
  • Step 2: Wait for Node.js + OKX package auto-install (~3 minutes)
  • Step 3: Wizard pops up → choose DEMO/LIVE → paste 3 keys → Test → Save
✓ Auto-installs Node.js (via winget)
✓ Auto-installs okx-trade-mcp from npm
✓ Wizard verifies the API key with OKX as you type
✓ Auto-writes config.toml in the correct format
✓ Auto-registers the MCP with Claude Desktop
✓ Creates an "OKX + Claude AI" shortcut on your Desktop
🔒 Security — API keys stay local Everything runs locally on your machine. The API key is stored at %USERPROFILE%\.okx\config.toml — never sent anywhere, Code2trade never sees it. Start with a DEMO account, switch to LIVE only when you're ready. We recommend a sub-account key with Read + Trade only and NO Withdraw permission.

4 steps from download to your first crypto command

Follow in order. Total time: ~5 minutes (first run).

1

Prepare your OKX account & API key

Sign in to okx.com → go to My Account → API → create a new API key.

For safety, start with Demo Trading (toggle in the top corner of the OKX page). Tick Read + Trade permissions. Save your API Key, Secret Key, and Passphrase — the Passphrase is set by you at creation and cannot be recovered later.

2

Extract & run 1_SETUP_chay_mot_lan.bat

Download OKX-MCP-Setup.rar from the button below, extract it to any folder.

Double-click 1_SETUP_chay_mot_lan.bat. If Windows SmartScreen warns you → "More info" → "Run anyway". The script runs through 4 stages automatically:

[1/4] Checking Claude Desktop... OK [2/4] Checking Node.js... OK (v20.x) [3/4] Installing okx-trade-mcp... OK [4/4] Launching API key wizard...
3

Enter the API key in the wizard popup

The wizard window appears — no need to open Notepad or hand-edit any file:

  • Select DEMO or LIVE
  • API Key — ~32-character string from OKX
  • Secret Key — ~32-character string
  • Passphrase — the password you set when creating the key

Click "Test Connection" → the wizard calls the OKX API to verify immediately. If you see "✓ Connected" → click "Save & Continue". Setup writes the config and registers the MCP with Claude Desktop. When you see "SETUP COMPLETE!" → you're done.

4

Open Claude Desktop & start trading

Click the "OKX + Claude AI" shortcut on your Desktop (created during setup) to open Claude Desktop with the MCP already connected.

Verify with your first command:

› Show me my OKX account balance
→ AI returns Balance and Equity per coin (USDT, BTC, ETH...).

If AI returns the balance → you're connected. If there's an error → re-run 0_WIZARD_doi_API_KEY.bat to recheck your keys.

Sample commands — speak naturally, Claude understands

Chat in Claude Desktop like any normal conversation. Try these right away:

💼

Account

Balance, open positions, history, trading fees

📊

Market

Realtime prices, orderbook, candles, funding rate

⚡

Spot & Futures

Market/limit orders, SL/TP, close positions

🤖

Grid / DCA Bot

Create, list, stop bots automatically

› What's the current BTC price on OKX?
→ AI returns realtime Bid / Ask / Last price for BTC-USDT.
› Do I have any open positions?
→ AI lists all open positions with current P&L for each.
› Buy 100 USDT worth of BTC at market price
→ AI places a spot market order on BTC-USDT, confirms order ID and fill price.
› Buy 100 USDT of BTC with stop loss at 84000 and take profit at 95000
→ AI places a market order with an OCO algo: SL 84000, TP 95000.
› Open a long on BTC-USDT-SWAP, 5x leverage, 0.01 BTC, cross margin
→ AI sets leverage then places the futures market long.
› Create a grid bot on BTC-USDT from 80000 to 100000, 10 grids, 100 USDT
→ AI creates a grid bot with those parameters and returns the bot ID.
› Show filled orders from the last 7 days
→ AI pulls 7-day filled orders, lists symbol, side, size, price, P&L.

The full feature set once setup is done

The OKX Agent Trade Kit unlocks 30+ operations — from market data to automated bots:

💼 Account & balance

Check balance, equity, margin, trading history, fees, daily/weekly P&L.

📊 Market data

Realtime prices, orderbook depth, OHLCV candles on any timeframe, funding rate, open interest.

🛒 Spot Trading

Market, limit, IOC orders. OCO-style Stop Loss / Take Profit. Cancel single or all orders.

⚡ Futures / Swap

Long/short with leverage, cross/isolated margin. Close positions, adjust leverage, trailing stop.

🎲 Options

View option chains and Greeks (Delta, Gamma, Theta, Vega) by expiry and strike price.

🤖 Grid & DCA Bot

Create grid bots with range/grids/capital. Create DCA bots. List and stop running bots.

"I used to give up the moment I saw 'API key' or 'config.toml'. Now the wizard verifies as I type — if it's wrong I know instantly, if it's right one Save click and it's done. The first time I bought BTC by simply typing the command in Claude felt surreal."
— Feedback from a trader using Code2trade OKX MCP
📌 System requirements
  • Windows 10 / 11 64-bit
  • Claude Desktop installed with a Claude Pro / Team account — download at claude.ai/download
  • OKX account with KYC completed + an API key (DEMO or LIVE)
  • Node.js — not required, the script auto-installs via winget

Download OKX MCP Setup — Code2trade

Includes 1_SETUP_chay_mot_lan.bat, 0_WIZARD_doi_API_KEY.bat, GUI installer · Supports Windows 10/11

⬇ Download — OKX-MCP-Setup.rar

.rar file · Free · Updated June 2026