OKX MCP Server

Official registry Other

MCP Server for okx.com

What can you do with OKX MCP Server?

  • account_config - Get account configuration
  • account_balance - Get account balance
  • account_positions - Get account positions
  • account_position_risk - Get account position risk
  • 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

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

PYPI package mcp-okx
Claude Code
claude mcp add okx-mcp-server -- uvx mcp-okx==0.1.0
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "okx-mcp-server": {
            "command": "uvx",
            "args": [
                "mcp-okx==0.1.0"
            ]
        }
    }
}
OCI package ghcr.io/aahl/mcp-okx:latest
Claude Code
claude mcp add okx-mcp-server -- docker run -i --rm ghcr.io/aahl/mcp-okx:latest
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "okx-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/aahl/mcp-okx:latest"
            ]
        }
    }
}

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

🆗 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

Frequently asked questions

What is OKX MCP Server?

MCP Server for okx.com

How do I install OKX MCP Server?

It runs on your machine. In Claude Code: claude mcp add okx-mcp-server -- uvx mcp-okx==0.1.0. For other clients, paste the JSON configuration from this page into their MCP settings.

Does OKX MCP Server need an API key?

Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.

Is OKX MCP Server open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains OKX MCP Server?

It is published by aahl. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.