Skip to main content
Glama
aahl

OKX MCP Server

by aahl

🆗 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

Related MCP server: okx-trade-mcp

🛠️ Available Tools

  • 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

  • get_orders_history - Get Order History

  • close_positions - Liquidate all positions

  • market_tickers - Get cryptocurrency rankings

Install Server
A
license - permissive license
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
5Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    Enables cryptocurrency trading on Bybit exchange through comprehensive market data access, account management, and automated trading operations. Features smart position validation, trailing stop losses, and risk management tools with demo mode support for safe testing.
    Last updated
    21
  • A
    license
    -
    quality
    C
    maintenance
    Enables AI assistants to interact with OKX cryptocurrency exchange, providing tools for market data, trading, account management, and more through the Model Context Protocol.
    Last updated
    99
    MIT
  • A
    license
    D
    quality
    C
    maintenance
    Enables AI agents to access the full OKX exchange API for trading, market data, account management, and more through 300+ MCP tools.
    Last updated
    100
    125
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • No-KYC managed MCP for AI agents: sandboxed TypeScript trading SDK, isolated sub-accounts, futures.

  • AI agent access to Asian crypto markets. Korean exchange routing and x402 paid APIs.

  • Real-time crypto prices from Binance, Coinbase, Kraken, OKX, and Bybit

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aahl/mcp-okx'

If you have feedback or need assistance with the MCP directory API, please join our Discord server