OKX MCP Server

OKX MCP Server

Provides real-time cryptocurrency price data from OKX exchange through a Model Context Protocol interface.

Category
Visit Server

Tools

get_price

Get latest price for an OKX instrument

get_candlesticks

Get candlestick data for an OKX instrument

README

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 candlestick
    • open: Opening price
    • high: Highest price
    • low: Lowest price
    • close: Closing price
    • volume: Trading volume
    • volumeCurrency: 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 ID
    • lastPrice: Latest trade price
    • bid: Current best bid price
    • ask: Current best ask price
    • high24h: 24-hour high price
    • low24h: 24-hour low price
    • volume24h: 24-hour trading volume
    • timestamp: 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured