mcpField
O
OKX MCP Server

OKX MCP Server

Local
github.com/aahlFinance2Updated 50w ago

About OKX MCP Server

OKX MCP Server exposes OKX account and market-data capabilities to MCP clients for users who need account queries, market information, or trading actions. It includes account, order, and market-data tools, and can be deployed with uvx or Docker.

Key features

  1. 01Get account configuration and balance
  2. 02View positions and position risk
  3. 03Place, cancel, and inspect orders
  4. 04Retrieve cryptocurrency market data

Use cases

  1. 01Check OKX account balance and configuration
  2. 02Review positions and associated risk
  3. 03Place orders or cancel pending orders
  4. 04Query market rankings and order history

MCP support

The server exposes OKX account, trading, and market-data tools to MCP clients. It can run locally via uvx or provide a Streamable HTTP connection through Docker, and requires OKX API credentials.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"aahl-mcp-okx": {
"command": "uvx",
"args": [
"mcp-okx"
]
}
}
}
Run commanduvx mcp-okx

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypimcp-okx0.1.0
ocighcr.io/aahl/mcp-okx:latest

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

🆗 OKX MCP Server

📲 Install

Method 1: uvx
{
  "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
mkdir /opt/mcp-okx
cd /opt/mcp-okx
wget https://raw.githubusercontent.com/aahl/mcp-okx/refs/heads/main/docker-compose.yml
docker-compose up -d
{
  "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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.