OKX MCP Server
Provides real-time cryptocurrency price data from the OKX exchange.
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:
[
{
"timestamp": "2025-03-07T17:00:00.000Z",
"open": "87242.8",
"high": "87580.2",
"low": "86548.0",
"close": "87191.8",
"volume": "455.72150427",
"volumeCurrency": "39661166.242091111"
}
]
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:
{
"instrument": "BTC-USDT",
"lastPrice": "65432.1",
"bid": "65432.0",
"ask": "65432.2",
"high24h": "66000.0",
"low24h": "64000.0",
"volume24h": "1234.56",
"timestamp": "2024-03-07T17:22:28.000Z"
}
Development
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
Installation
To use with Claude Desktop or VSCode, add the server config to your MCP settings:
macOS (VSCode):
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
macOS (Claude Desktop):
~/Library/Application Support/Claude/claude_desktop_config.json
Windows (VSCode):
%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows (Claude Desktop):
%APPDATA%/Claude/claude_desktop_config.json
Configuration:
{
"mcpServers": {
"okx": {
"command": "node",
"args": ["/path/to/okx-mcp-server/build/index.js"],
"disabled": false,
"autoApprove": []
}
}
}
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
Related Servers
CData Paylocity MCP Server
A read-only MCP server by CData that enables LLMs to query live data from Paylocity.
Gelato
Gelato Print-on-Demand platform MCP server
Arc MCP Server
Simplifies framework deployments on various hosting environments, with a focus on shared hosting.
Red Bee MCP Server
An MCP server for the Red Bee Media OTT Platform, offering tools for authentication, content search, user management, purchases, and system operations.
Remote MCP Server (Authless)
An authentication-free, remote MCP server designed for deployment on Cloudflare Workers.
Dataloop MCP
Integrate with the Dataloop AI platform for data management and annotation using a Docker-based stdio interface.
Spotify MCP Server
Interact with the Spotify API to manage playlists and control music playback.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
CData SAP Ariba Source
An MCP server for SAP Ariba Source, powered by CData. Requires the external CData JDBC Driver for SAP Ariba Source.
Metoro
Query and interact with kubernetes environments monitored by Metoro