使用说明
海怪Pro MCP
模型上下文协议(MCP)服务器,提供来自Kraken Pro交易所的实时加密货币市场数据。
概述
该MCP服务器将Kraken的公共API公开为MCP工具,允许AI助手获取实时加密货币价格、交易对和市场数据。
可用工具
| 工具 | 说明 |
|---|---|
get_system_status |
检查Kraken API是否在线并运行 |
get_ticker |
获取交易对(例如XBTUSD、ETHUSD)的实时行情数据 |
get_asset_info |
列出Kraken上所有可用的资产及其详细信息 |
安装
pnpm install
发展
在热重载的开发模式下运行:
pnpm run dev
构建
将TypeScript编译为JavaScript:
pnpm run build
用法
启动MCP服务器:
pnpm start
服务器在stdio上运行,并通过模型上下文协议进行通信。
克劳德桌面版
要将此服务器与Claude Desktop一起使用,请将以下内容添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
视窗: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"kraken-pro": {
"command": "node",
"args": [
"<PATH TO REPO>/kraken-pro-mcp/dist/index.js"
]
}
}
}
替换 <PATH TO REPO> 您系统上指向此存储库的绝对路径。
发展模式
对于使用热重载开发和测试新更改,请使用开发模式:
{
"mcpServers": {
"kraken-pro": {
"command": "pnpm",
"args": ["run", "dev"],
"cwd": "<PATH TO REPO>/kraken-pro-mcp"
}
}
}
当您更改源代码时,这将自动重新启动服务器。
测试
# Run all tests in watch mode
pnpm test
# Run unit tests only (with mocks)
pnpm run test:unit
# Run acceptance tests (hits real Kraken API - rate limited)
pnpm run test:acceptance
装订和格式化
# Check linting
pnpm run lint
# Format code
pnpm run format
# Run all checks (lint + format + organize imports)
pnpm run check
项目结构
src/
index.ts # MCP server entry point with tool registrations
kraken-client.ts # Kraken API client using native fetch
types.ts # Shared TypeScript interfaces
test/
unit/ # Fast unit tests with mocked fetch
acceptance/ # Slower integration tests hitting real API
技术
许可证
ISC
