Skip to main content
Glama
esshka

OKX MCP Server

by esshka

Servidor MCP OKX

Un servidor de protocolo de contexto modelo que proporciona datos de precios de criptomonedas en tiempo real del intercambio OKX.

Características

Este servidor MCP se conecta a la API de OKX para proporcionar información sobre el precio de las criptomonedas mediante una sencilla interfaz. Incluye gestión integral de errores, registro de solicitudes y limitación de velocidad mediante la API de OKX.

Herramientas

get_candlesticks

Recupera datos históricos de velas (OHLCV) para cualquier instrumento en OKX.

  • Aporte :

    • instrument : Cadena (obligatoria) - ID del instrumento (p. ej., "BTC-USDT")

    • bar : Cadena (opcional) - Intervalo de tiempo (por ejemplo, "1m", "5m", "1H", "1D"), predeterminado "1m"

    • limit : Número (opcional) - Número de velas a devolver (máximo 100), predeterminado 100

  • Salida : Matriz de objetos JSON, cada uno de los cuales contiene:

    • timestamp : marca de tiempo ISO de la vela

    • open : Precio de apertura

    • high : precio más alto

    • low : precio más bajo

    • close : Precio de cierre

    • volume : Volumen de negociación

    • volumeCurrency : Volumen en términos monetarios

Ejemplo de uso:

[
  {
    "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

Obtiene el último precio y datos del mercado de 24 horas para cualquier instrumento en OKX.

  • Aporte :

    • instrument : Cadena (obligatoria) - ID del instrumento (p. ej., "BTC-USDT")

  • Salida : objeto JSON que contiene:

    • instrument : El ID del instrumento solicitado

    • lastPrice : Último precio de transacción

    • bid : mejor precio de oferta actual

    • ask : Mejor precio de venta actual

    • high24h : precio máximo de 24 horas

    • low24h : precio bajo las 24 horas

    • volume24h : volumen de negociación de 24 horas

    • timestamp : marca de tiempo ISO de los datos

Ejemplo de uso:

{
  "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"
}

Related MCP server: OKX MCP Server

Desarrollo

Instalar dependencias:

npm install

Construir el servidor:

npm run build

Para desarrollo con reconstrucción automática:

npm run watch

Instalación

Para usar con Claude Desktop o VSCode, agregue la configuración del servidor a la configuración de MCP:

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

Ventanas (VSCode):

%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows (Escritorio Claude):

%APPDATA%/Claude/claude_desktop_config.json

Configuración:

{
  "mcpServers": {
    "okx": {
      "command": "node",
      "args": ["/path/to/okx-mcp-server/build/index.js"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Manejo de errores

El servidor implementa un manejo integral de errores:

  • Los errores de red se capturan y se devuelven con contexto.

  • Los ID de instrumentos no válidos devuelven mensajes de error apropiados

  • Los límites de velocidad de la API se respetan a través de la configuración del tiempo de espera de Axios

  • Todos los errores se registran con fines de depuración.

Available Tools

2 tools
get_candlesticksC

Get candlestick data for an OKX instrument

ParametersJSON Schema
NameRequiredDescriptionDefault
instrumentYesInstrument ID (e.g. BTC-USDT)
barNoTime interval (e.g. 1m, 5m, 1H, 1D)1m
limitNoNumber of candlesticks (max 100)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but only states what the tool does without mentioning rate limits, authentication needs, response format, or pagination behavior. It doesn't explain what 'candlestick data' includes (e.g., OHLC values) or any constraints beyond the implied data retrieval.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and appropriately sized for a simple data retrieval tool, with every word contributing to clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool with three parameters. It doesn't cover behavioral aspects like response format, error handling, or usage context, leaving significant gaps for an AI agent to understand how to effectively invoke and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional meaning beyond the schema, such as explaining the significance of candlestick intervals or instrument IDs in context. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('candlestick data for an OKX instrument'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'get_price', which likely provides different market data, leaving room for improvement in distinguishing between similar data retrieval functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling 'get_price' or any alternatives. It lacks context about when candlestick data is appropriate (e.g., for charting, technical analysis) versus price data, offering no usage boundaries or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_priceC

Get latest price for an OKX instrument

ParametersJSON Schema
NameRequiredDescriptionDefault
instrumentYesInstrument ID (e.g. BTC-USDT)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on traits like rate limits, authentication needs, error handling, or response format. This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It is appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain behavioral traits, return values, or usage context, which are essential for a tool that fetches financial data. This leaves clear gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'instrument' parameter. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'latest price for an OKX instrument', making the purpose specific and understandable. It doesn't explicitly distinguish from the sibling 'get_candlesticks', which provides historical price data, so it misses full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_candlesticks'. There is no mention of prerequisites, context, or exclusions, leaving usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.0
    • Addedget_candlesticks
    • Addedget_price

TDQS

B3.1/5.0

Scored across 2 tools

Disambiguation4/5

The two tools have distinct purposes: get_candlesticks retrieves historical price data in candlestick format, while get_price fetches the latest price. There is minimal overlap as they target different data types (historical vs. current), though both relate to instrument pricing which could cause slight confusion in some contexts.

Naming Consistency5/5

Both tools follow a consistent verb_noun naming pattern (get_candlesticks, get_price) with clear, descriptive names. The snake_case style is uniform throughout, making the tools easy to identify and predict.

Tool Count2/5

With only 2 tools, the server feels severely under-scoped for a financial trading platform like OKX. This minimal set lacks essential operations such as placing orders, managing accounts, or accessing market depth, which are core to trading workflows.

Completeness2/5

The tool surface is highly incomplete for an OKX server, covering only price data retrieval. There are significant gaps in trading functionality (e.g., no create_order, cancel_order), account management, or market data beyond basic prices, which will likely cause agent failures in typical trading scenarios.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    F
    maintenance
    A 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.
    12
    11
    16
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Provides real-time and historical cryptocurrency price data from the OKX exchange, including live WebSocket updates, candlestick charts, and visual price analysis for trading pairs.
    5
    7
    3
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    Provides access to Tastytrade historical price data via the Model Context Protocol. It enables users to retrieve historical candle data for specific financial symbols and time intervals.
    1
    -