Skip to main content

OKX MCP Server

Project description

🆗 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_okx-0.1.0a2.tar.gz (92.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_okx-0.1.0a2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_okx-0.1.0a2.tar.gz.

File metadata

  • Download URL: mcp_okx-0.1.0a2.tar.gz
  • Upload date:
  • Size: 92.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_okx-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 5cb194ed87c02924f2fbfa4a2e24adb356a4f2fa61fdd3d0092c42588590f134
MD5 6bfbf4775517756d501c13adfcb4843a
BLAKE2b-256 8f912c3387ab0bbba9a842a0790e6158bcc1a1e44a971fca842bd4553768685f

See more details on using hashes here.

File details

Details for the file mcp_okx-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: mcp_okx-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_okx-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c6d86404e50dcb62e58442b6c24206d71f3e8126e24086dca1f36536b35fc2
MD5 06de2adf59ed62f46c581d0c3cec0a73
BLAKE2b-256 202a6dbc7b9d1b5cbee2b9083daad430dacf98e712bea2efcdf94d9c16db985e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page