OKX MCP Server
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Provides real-time cryptocurrency price data from the OKX exchange, offering tools to retrieve latest prices and historical candlestick (OHLCV) data for any instrument traded on OKX.
OKX MCP Server
A Model Context Protocol server that provides real-time cryptocurrency price data from OKX exchange.
Features
This MCP server connects to the OKX API to provide cryptocurrency price information through a simple tool interface. It includes comprehensive error handling, request logging, and rate limiting via OKX's API.
Tools
get_candlesticks
Retrieves historical candlestick (OHLCV) data for any instrument on OKX.
- Input:
instrument
: String (required) - Instrument ID (e.g. "BTC-USDT")bar
: String (optional) - Time interval (e.g. "1m", "5m", "1H", "1D"), default "1m"limit
: Number (optional) - Number of candlesticks to return (max 100), default 100
- Output: Array of JSON objects, each containing:
timestamp
: ISO timestamp of the candlestickopen
: Opening pricehigh
: Highest pricelow
: Lowest priceclose
: Closing pricevolume
: Trading volumevolumeCurrency
: Volume in currency terms
Example usage:
get_price
Fetches the latest price and 24-hour market data for any instrument on OKX.
- Input:
instrument
: String (required) - Instrument ID (e.g. "BTC-USDT")
- Output: JSON object containing:
instrument
: The requested instrument IDlastPrice
: Latest trade pricebid
: Current best bid priceask
: Current best ask pricehigh24h
: 24-hour high pricelow24h
: 24-hour low pricevolume24h
: 24-hour trading volumetimestamp
: ISO timestamp of the data
Example usage:
Development
Install dependencies:
Build the server:
For development with auto-rebuild:
Installation
To use with Claude Desktop or VSCode, add the server config to your MCP settings:
macOS (VSCode):
macOS (Claude Desktop):
Windows (VSCode):
Windows (Claude Desktop):
Configuration:
Error Handling
The server implements comprehensive error handling:
- Network errors are captured and returned with context
- Invalid instrument IDs return appropriate error messages
- API rate limits are respected through axios timeout configuration
- All errors are logged for debugging purposes
You must be authenticated.
Provides real-time cryptocurrency price data from OKX exchange through a Model Context Protocol interface, allowing access to historical candlestick data and current market prices for any trading instrument.