# Mcp Okx

> 🆗 OKX MCP Server for trading

- **Type:** MCP server
- **Install:** `agentstack add mcp-aahl-mcp-okx`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [aahl](https://agentstack.voostack.com/s/aahl)
- **Installs:** 0
- **Category:** [Finance & Payments](https://agentstack.voostack.com/c/finance-and-payments)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [aahl](https://github.com/aahl)
- **Source:** https://github.com/aahl/mcp-okx

## Install

```sh
agentstack add mcp-aahl-mcp-okx
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 🆗 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-okx
cd /opt/mcp-okx
wget https://raw.githubusercontent.com/aahl/mcp-okx/refs/heads/main/docker-compose.yml
docker-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](https://www.okx.com/account/my-api) 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 & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [aahl](https://github.com/aahl)
- **Source:** [aahl/mcp-okx](https://github.com/aahl/mcp-okx)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-aahl-mcp-okx
- Seller: https://agentstack.voostack.com/s/aahl
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
