Integrations
Handles HTTP requests to the OKX API with timeout configuration for respecting rate limits.
Provides real-time cryptocurrency price data from OKX exchange, including historical candlestick data and latest price information for any instrument traded on the platform.
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.
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.
Provides real-time cryptocurrency price data from OKX exchange through a Model Context Protocol interface.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides read-only access to Bybit's cryptocurrency exchange API, allowing users to query real-time cryptocurrency data using natural language.Last updated -95TypeScriptMIT License
- AsecurityFlicenseAqualityProvides 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.Last updated -22JavaScript
- -securityFlicense-qualityA cryptocurrency price query service based on Model Context Protocol that provides tools for retrieving virtual currency prices, market trends, detailed information, and K-line data.Last updated -2Python
- -securityAlicense-qualityA cryptocurrency price service that provides real-time crypto pricing information through an MCP (Model Context Protocol) framework with CoinMarketCap API integration.Last updated -PythonGPL 3.0