Skip to main content
Glama

OKX MCP Server

by esshka

OKX MCP 服务器

提供来自 OKX 交易所的实时加密货币价格数据的模型上下文协议服务器。

特征

该 MCP 服务器连接到 OKX API,通过简单的工具界面提供加密货币价格信息。它通过 OKX 的 API 提供全面的错误处理、请求日志记录和速率限制。

工具

get_candlesticks

检索 OKX 上任何工具的历史烛台(OHLCV)数据。

  • 输入
    • instrument :字符串(必需)- 工具 ID(例如“BTC-USDT”)
    • bar :字符串(可选) - 时间间隔(例如“1m”、“5m”、“1H”、“1D”),默认“1m”
    • limit :数字(可选) - 返回的烛台数量(最多 100 个),默认 100
  • 输出:JSON 对象数组,每个对象包含:
    • timestamp :烛台的 ISO 时间戳
    • open :开盘价
    • high :最高价格
    • low :最低价格
    • close :收盘价
    • volume :交易量
    • volumeCurrency :以货币计算的交易量

使用示例:

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

获取 OKX 上任何工具的最新价格和 24 小时市场数据。

  • 输入
    • instrument :字符串(必需)- 工具 ID(例如“BTC-USDT”)
  • 输出:JSON 对象包含:
    • instrument :请求的仪器 ID
    • lastPrice :最新成交价
    • bid :当前最佳出价
    • ask :当前最佳卖价
    • high24h :24小时最高价
    • low24h :24小时最低价
    • volume24h :24小时交易量
    • timestamp :数据的 ISO 时间戳

使用示例:

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

发展

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

安装

要与 Claude Desktop 或 VSCode 一起使用,请将服务器配置添加到您的 MCP 设置中:

macOS(VSCode):

~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

macOS(克劳德桌面):

~/Library/Application Support/Claude/claude_desktop_config.json

Windows(VSCode):

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

Windows(Claude 桌面):

%APPDATA%/Claude/claude_desktop_config.json

配置:

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

错误处理

服务器实现了全面的错误处理:

  • 捕获网络错误并返回上下文
  • 无效的仪器 ID 返回相应的错误消息
  • 通过 axios 超时配置来实现 API 速率限制
  • 所有错误均已记录,以用于调试目的

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

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.

通过模型上下文协议接口提供来自 OKX 交易所的实时加密货币价格数据,允许访问任何交易工具的历史烛台数据和当前市场价格。

  1. 特征
    1. 工具
  2. 发展
    1. 安装
      1. 错误处理

    Related MCP Servers

    • A
      security
      A
      license
      A
      quality
      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.
      Last updated -
      9
      14
      9
      TypeScript
      MIT License
    • A
      security
      F
      license
      A
      quality
      A Model Context Protocol server that provides access to CoinMarketCap's cryptocurrency data, enabling AI applications to retrieve cryptocurrency listings, quotes, and detailed information.
      Last updated -
      3
      10
      Python
      • Linux
      • Apple
    • -
      security
      F
      license
      -
      quality
      A 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 -
      2
      Python
    • -
      security
      -
      license
      -
      quality
      A server that provides real-time cryptocurrency data through the Model Context Protocol, allowing access to detailed exchange information and current cryptocurrency rates from the CoinCap API.
      Last updated -
      1
      TypeScript
      MIT License

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/esshka/okx-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server