OKX MCP Server

io.github.aahlPublished by GitHub account aahlv0.1.0Updated Oct 24, 2026

MCP Server for okx.com

VerifiedSTDIODesktop onlyFinanceData & Analytics

Overview

AI-generated overview

A local MCP server for the OKX crypto exchange that lets an assistant read account, position and market data and place, cancel or close trades.

What you can do
Read account configuration, balances, positions and position risk from an OKX account. Place new orders, cancel open orders, and liquidate all positions. Look up order details, open orders and order history. Retrieve cryptocurrency market tickers and rankings.
When to use it
Useful when you want an assistant to check OKX account balances, positions and risk, review order history, or place and manage trades on the exchange, including in demo trading mode.
Requirements
Runs locally via uvx (Python package mcp-okx) or Docker. Needs OKX API credentials set as OKX_API_KEY, OKX_API_SECRET and OKX_PASSPHRASE, plus OKX_TRADE_FLAG to choose production or demo trading. Optional OKX_BASE_URL and MCP_AUTH_TOKEN. The Docker setup exposes a Streamable HTTP endpoint protected by a Bearer token.
Before you install
The server can place orders, cancel orders and liquidate all positions, which moves real funds when OKX_TRADE_FLAG is set to production. It requires the account API key, secret and passphrase; keep them out of shared configs. MCP_AUTH_TOKEN defaults to the API key, so set a separate token for the HTTP endpoint.

Installation

In SourceWeft

  1. Open OKX MCP Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

🆗 OKX MCP Server

📲 Install

Method 1: uvx

yaml
{  "mcpServers": {    "mcp-okx": {      "command": "uvx",      "args": ["mcp-okx"],      "env": {        "OKX_API_KEY": "your-okx-api-key",        "OKX_API_SECRET": "api-secret-key",        "OKX_PASSPHRASE": "api-passphrase",        "OKX_TRADE_FLAG": "1", # 0: Production trading, 1: Demo trading        "OKX_BASE_URL": "https://www.okx.com", # Optional        "MCP_AUTH_TOKEN": "your-custom-token"  # Default same as OKX_API_KEY      }    }  }}

Method 2: Docker

bash
mkdir /opt/mcp-okxcd /opt/mcp-okxwget https://raw.githubusercontent.com/aahl/mcp-okx/refs/heads/main/docker-compose.ymldocker-compose up -d
yaml
{  "mcpServers": {    "mcp-okx": {      "url": "http://0.0.0.0:8811/mcp", # Streamable HTTP      "headers": {        "Authorization": "Bearer your-okx-api-key-or-custom-token"      }    }  }}

⚙️ Environment variables

  • OKX_API_KEY: API key of your OKX account. Please refer to my api page regarding API Key creation.
  • OKX_API_SECRET: API secret key of your OKX account.
  • OKX_PASSPHRASE: API passphrase of your OKX account.
  • OKX_TRADE_FLAG: 0: Production trading, 1: Demo trading
  • OKX_BASE_URL: Base URL of OKX. Default: https://www.okx.com
  • MCP_AUTH_TOKEN: Custom token for authentication. Default same as OKX_API_KEY

🛠️ Available Tools

Account Tools
  • account_config - Get account configuration
  • account_balance - Get account balance
  • account_positions - Get account positions
  • account_position_risk - Get account position risk
Trading Tools
  • place_order - Place a new order
  • cancel_order - Cancel an incomplete order
  • get_trade_order - Get order details
  • get_order_list - Get incomplete order list
  • get_orders_history - Get Order History
  • close_positions - Liquidate all positions
Market Data
  • market_tickers - Get cryptocurrency rankings

Source: README.md at commit 063cb50

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts