BO

badger3000/okx-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

3 stars 3 forks 品質 60 トレンド 4

このプロジェクトは、OKX 交換からリアルタイムの暗号化データをフェッチするモデルコンテキストプロトコル(MCP)サーバーを作成します.

概要

このプロジェクトは、OKX 交換からリアルタイムの暗号化データをフェッチするモデルコンテキストプロトコル(MCP)サーバーを作成します。 ClaudeのようなAIアシスタントは、高度な視覚化機能とWebSocketライブアップデートを備えた定義されたツールを使用して、最新の暗号通貨価格情報と履歴データにアクセスすることができます。 - get price: 仮想通貨取引ペアの最新の価格データを視覚的なフォーマットで修正 - get candlesticks: ASCII チャートを含む視覚化オプションで歴史的な燭台データを取得する -subscribe ticker: 取引ペアのリアルタイム WebSocket の更新を購読します - get live ticker: WebSocket接続から最新のライブデータを取得する - unsubscribe ticker: 特定の取引ペアのアップデートを受信停止 - ノード.

概要(AI 翻訳)

このプロジェクトは、OKX 交換からリアルタイムの暗号化データをフェッチするモデルコンテキストプロトコル(MCP)サーバーを作成します。 ClaudeのようなAIアシスタントは、高度な視覚化機能とWebSocketライブアップデートを備えた定義されたツールを使用して、最新の暗号通貨価格情報と履歴データにアクセスすることができます。

##特徴

  • [get_candlesticks]: 過去のキャンドルスティックデータを ASCII チャートを含む可視化オプションで取得
  • [subscribe_ticker: 取引ペアのリアルタイムWebSocket更新を購読

前提条件

  • Node.js(v16以上推奨)
  • npmかヤーン
  • Claude拡張機能付きVSCode(VSCode統合を使用する場合)
  • クロードデスクトップ(VSCodeを使用しない場合)

インストール

  1. リポジトリのクローン化

  2. 依存関係のインストール

3。 WebSocketの依存性を追加します。

  1. プロジェクトのビルド

  2. コンパイルされたスクリプトを実行可能にする

使用法

サーバーを直接実行する

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

OKX MCP Server

This project creates a Model Context Protocol (MCP) server that fetches real-time cryptocurrency data from the OKX exchange. It allows AI assistants like Claude to access up-to-date cryptocurrency price information and historical data through defined tools with enhanced visualization capabilities and WebSocket live updates.

Features

  • get_price: Fetches the latest price data for a cryptocurrency trading pair with visual formatting
  • get_candlesticks: Retrieves historical candlestick data with visualization options including ASCII charts
  • subscribe_ticker: Subscribes to real-time WebSocket updates for a trading pair
  • get_live_ticker: Retrieves the latest live data from WebSocket connection
  • unsubscribe_ticker: Stops receiving updates for a specific trading pair

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm or yarn
  • VSCode with Claude extension (if using VSCode integration)
  • Claude Desktop (if not using VSCode)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/okx-mcp-server.git
    cd okx-mcp-server
    
  2. Install dependencies

    npm install
    
  3. Add the WebSocket dependency

    npm install ws
    npm install --save-dev @types/ws
    
  4. Build the project

    npm run build
    
  5. Make the compiled script executable

    chmod +x build/index.js
    

Usage

Running the Server Directly

You can run the server directly with:

npm start

Or:

node build/index.js

Testing with MCP Inspector

To test your MCP server before integration:

npx @modelcontextprotocol/inspector node build/index.js

In the inspector, you can test:

  • get_price with input: { "instrument": "BTC-USDT", "format": "markdown" }
  • get_candlesticks with input: { "instrument": "BTC-USDT", "bar": "1m", "limit": 10, "format": "markdown" }
  • subscribe_ticker with input: { "instrument": "BTC-USDT" }
  • get_live_ticker with input: { "instrument": "BTC-USDT", "format": "markdown" }
  • unsubscribe_ticker with input: { "instrument": "BTC-USDT" }

Each tool supports different visualization formats:

  • format: Choose between markdown, json, or table (for candlesticks)

Integration with VSCode

  1. Install the Claude extension for VSCode

  2. Configure the MCP server in VSCode settings:

    • Create or edit the following file:
      ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
      
    • Add the following configuration:
      {
        "mcpServers": {
          "okx": {
            "command": "node",
            "args": ["/absolute/path/to/okx-mcp-server/build/index.js"],
            "disabled": false,
            "autoApprove": []
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector node build/index.js
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

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