
badger3000/okx-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
このプロジェクトは、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を使用しない場合)
インストール
-
リポジトリのクローン化
-
依存関係のインストール
3。 WebSocketの依存性を追加します。
-
プロジェクトのビルド
-
コンパイルされたスクリプトを実行可能にする
使用法
サーバーを直接実行する
このページは 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 formattingget_candlesticks: Retrieves historical candlestick data with visualization options including ASCII chartssubscribe_ticker: Subscribes to real-time WebSocket updates for a trading pairget_live_ticker: Retrieves the latest live data from WebSocket connectionunsubscribe_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
-
Clone the repository
git clone https://github.com/yourusername/okx-mcp-server.git cd okx-mcp-server -
Install dependencies
npm install -
Add the WebSocket dependency
npm install ws npm install --save-dev @types/ws -
Build the project
npm run build -
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_pricewith input:{ "instrument": "BTC-USDT", "format": "markdown" }get_candlestickswith input:{ "instrument": "BTC-USDT", "bar": "1m", "limit": 10, "format": "markdown" }subscribe_tickerwith input:{ "instrument": "BTC-USDT" }get_live_tickerwith input:{ "instrument": "BTC-USDT", "format": "markdown" }unsubscribe_tickerwith input:{ "instrument": "BTC-USDT" }
Each tool supports different visualization formats:
format: Choose betweenmarkdown,json, ortable(for candlesticks)
Integration with VSCode
-
Install the Claude extension for VSCode
-
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": []
- Create or edit the following file:
インストール
npx @modelcontextprotocol/inspector node build/index.js設定
{
"mcpServers": {
"okx": {
"command": "node",
"args": ["/absolute/path/to/okx-mcp-server/build/index.js"],
"disabled": false,
"autoApprove": []
}
}
}