modelscope·@PJ-TST-238819/mcp
通过模型上下文协议接口提供来自OKX交易所的实时加密货币价格数据。
一个提供来自OKX交易所实时加密货币价格数据的模型上下文协议服务器。
此MCP服务器连接到OKX API,通过简单的工具接口提供加密货币价格信息。它包括全面的错误处理、请求日志记录以及通过OKX API进行的速率限制。
get_candlesticks检索OKX上任何工具的历史K线(OHLCV)数据。
instrument: 字符串(必填)- 工具ID(例如 "BTC-USDT")bar: 字符串(可选)- 时间间隔(例如 "1m", "5m", "1H", "1D"),默认为 "1m"limit: 数字(可选)- 返回的K线条数(最大100条),默认100timestamp: K线的时间戳open: 开盘价high: 最高价low: 最低价close: 收盘价volume: 成交量volumeCurrency: 成交量(以货币单位表示)示例用法:
json [ { "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")instrument: 请求的工具IDlastPrice: 最新成交价bid: 当前最佳买入价ask: 当前最佳卖出价high24h: 24小时最高价low24h: 24小时最低价volume24h: 24小时成交量timestamp: 数据的时间戳示例用法:
json { "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" }
安装依赖项:
bash npm install
构建服务器:
bash npm run build
开发时自动重建:
bash npm run watch
要与Claude Desktop或VSCode一起使用,请将服务器配置添加到您的MCP设置中:
macOS (VSCode):
bash ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
macOS (Claude Desktop):
bash ~/Library/Application Support/Claude/claude_desktop_config.json
Windows (VSCode):
bash %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows (Claude Desktop):
bash %APPDATA%/Claude/claude_desktop_config.json
配置:
json { "mcpServers": { "okx": { "command": "node", "args": ["/path/to/okx-mcp-server/build/index.js"], "disabled": false, "autoApprove": [] } } }
服务器实现了全面的错误处理:
暂无描述。
暂无描述。
暂无描述。
暂无描述。
暂无描述。
暂无描述。