OKX MCP Server
MCP server giving AI clients access to OKX account data, market tickers and trading tools
- Pricing
- Open source
- Platforms
- CLI, API, self-hosted
- Runs
- Locally
- Version
- 0.1.0
- Listing updated
- today
Similar MCP servers
About OKX MCP Server
OKX MCP Server is an open-source MCP server for crypto and web3. It runs locally on your machine and is started by your AI client.
The README describes this as a bridge between AI clients and an OKX exchange account. It exposes account queries such as configuration, balances, positions and position risk, along with order placement, cancellation, order lookup and history, and a tool to liquidate all open positions. A market tickers tool is also listed for retrieving cryptocurrency rankings.
Setup uses API credentials from an OKX account. A flag switches between production trading and demo trading, so users can test against demo mode before touching live funds. The server runs either over stdio via uvx or as a Docker container using Streamable HTTP with a bearer token for authentication.
It suits developers and traders who want an AI assistant to inspect their OKX account or place orders through MCP. Because it can trade with real credentials, the README's demo-mode setting is worth using first.
Install
Run in a terminal
claude mcp add mcp-okx -- uvx mcp-okxAdd to claude_desktop_config.json
{
"mcpServers": {
"mcp-okx": {
"command": "uvx",
"args": [
"mcp-okx"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-okx": {
"command": "uvx",
"args": [
"mcp-okx"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp-okx": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-okx"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-okx": {
"command": "uvx",
"args": [
"mcp-okx"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-okx": {
"command": "uvx",
"args": [
"mcp-okx"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Tools this server provides (11)
Taken from the project documentation; the running server may differ.
- 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
What it does
- Account information queries
- Retrieves account configuration, balances, positions and position risk from OKX.
- Order placement and management
- Places new orders, cancels incomplete ones and looks up open or past order details.
- Position liquidation
- Provides a tool to close all open positions at once.
- Demo and production modes
- A single setting switches between OKX demo trading and live trading.
- Stdio and HTTP transports
- Runs locally via uvx or as a Docker container serving Streamable HTTP.
- Market ticker rankings
- Includes a tool that returns cryptocurrency rankings from market data.
Good for
- Checking OKX account balances and open positions from an AI assistant
- Placing or cancelling orders on OKX through natural-language requests
- Testing trading logic against OKX demo mode before going live
- Reviewing order history and position risk on an OKX account
Pricing
Open source
Open source; the OKX exchange itself is a separate service.
OKX MCP Server FAQ
Does it support demo trading?
Yes. The OKX_TRADE_FLAG variable set to 1 uses demo trading, while 0 uses production trading.
How is the server run?
The README gives two methods: launching it with uvx using the mcp-okx package, or running it in Docker and connecting over Streamable HTTP.
What credentials are needed?
An OKX API key, API secret and passphrase are set as environment variables, following the README's API key instructions.
Is OKX MCP Server free?
Yes. OKX MCP Server is open source, so you can use and self-host it for free.
How do I add OKX MCP Server to Claude Code?
Run this command in your terminal: claude mcp add mcp-okx -- uvx mcp-okx
What are the best alternatives to OKX MCP Server?
The closest alternatives to OKX MCP Server are Cryptokly and PolyTest.
Where this comes from
- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.