OKX
- javascript
0
GitHub Stars
javascript
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run an MCP server that connects to OKX to fetch market data, manage accounts, and execute trading actions through a unified, programmable interface. This server lets you use both local process execution and remote HTTP endpoints to interact with OKX, exposing a set of trading, market, and account tools you can drive from any MCP client.
How to use
You can access the OKX MCP server from an MCP client by using either a local, stdio-based process or a remote HTTP endpoint. The local option runs a background process that starts with a command and environment variables you provide. The HTTP option exposes a remote, streamable endpoint you can query with standard MCP requests.
How to install
Prerequisites: ensure you have a modern runtime and MCP client setup. You will configure either a local stdio server using uvx or a Docker-based HTTP server that exposes an MCP URL.
Additional configuration and usage notes
Environment variables you will typically set for the local stdio method include your OKX API credentials and trading mode. You can also specify a base URL and an optional authentication token. For the HTTP method, you will point to the MCP URL and provide an Authorization header that contains your API key or a custom token.
Available tools include Account Tools for querying your account state, Trading Tools for placing and managing orders, and Market Data tools for retrieving current market information. Use these tools to build high-level trading automations or dashboards that reflect your OKX trading activity.
Security and best practices
Treat API keys and secrets as sensitive credentials. Use environment isolation for each deployment, rotate credentials regularly, and limit trading permissions to the minimum required by your automation.
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