Cryptocurrency Market Data MCP Server

MIT License
26
  • Apple

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.

Integrations

  • Provides real-time cryptocurrency market data from Binance, including current prices, market summaries, and trading pairs

  • Fetches cryptocurrency market data from Coinbase, allowing access to prices, trading volumes, and market information

  • Offers integration with KuCoin exchange for cryptocurrency price data, market summaries, and trading information

加密货币市场数据 MCP 服务器

一个模型上下文协议 (MCP) 服务器,通过与主要交易所集成,提供实时和历史加密货币市场数据。该服务器使像 Claude 这样的法学硕士 (LLM) 能够获取当前价格、分析市场趋势并访问详细的交易信息。

特征

  • 实时市场数据
    • 当前加密货币价格
    • 包含买卖价差的市场摘要
    • 按交易量排名的前几大交易对
    • 多种交易所支持
  • 历史分析
    • OHLCV(烛台)数据
    • 价格变动统计
    • 卷历史跟踪
    • 可定制的时间范围
  • Exchange 支持
    • 币安
    • Coinbase
    • 海妖
    • 库币
    • 超液体
    • 火币
    • Bitfinex
    • 比特
    • OKX
    • 墨西哥

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装加密货币市场数据服务器:

npx -y @smithery/cli install mcp-server-ccxt --client claude

手动安装

# Using uv (recommended) uv pip install mcp ccxt # Using pip pip install mcp ccxt

用法

运行服务器

python crypto_server.py

与 Claude Desktop 连接

  1. 打开您的 Claude Desktop 配置:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 添加服务器配置:
{ "mcpServers": { "crypto": { "command": "python", "args": ["/path/to/crypto_server.py"] } } }
  1. 重启Claude桌面

可用工具

  1. 获取价格
    • 获取任何交易对的当前价格
    • 例如:“币安上 BTC/USDT 的当前价格是多少?”
  2. 获取市场摘要
    • 获取详细的市场信息
    • 例如:“显示 ETH/USDT 的市场摘要”
  3. 获取最高音量
    • 按交易量列出排名靠前的交易对
    • 例如:“Kraken 上排名前 5 的交易对是什么?”
  4. 列表交换
    • 显示所有支持的交易所
    • 例如:“支持哪些交易所?”
  5. 获取历史 ohlcv
    • 获取历史烛台数据
    • 示例:“以 1 小时为间隔显示过去 7 天的 BTC/USDT 价格数据”
  6. 获取价格变化
    • 计算不同时间段内的价格变化
    • 例如:“SOL/USDT 的 24 小时价格变化是多少?”
  7. 获取卷历史记录
    • 跟踪一段时间内的交易量
    • 例如:“显示过去一周 ETH/USDT 的交易量历史记录”

示例查询

以下是服务器连接后您可以向 Claude 询问的一些示例问题:

- What's the current Bitcoin price on Binance? - Show me the top 5 trading pairs by volume on Coinbase - How has ETH/USDT performed over the last 24 hours? - Give me a detailed market summary for SOL/USDT on Kraken - What's the trading volume history for BNB/USDT over the last week?

技术细节

依赖项

  • mcp :模型上下文协议 SDK
  • ccxt :加密货币交易所交易库
  • Python 3.9 或更高版本

建筑学

服务器使用:

  • CCXT 异步支持高效交易所通信
  • MCP 的 LLM 集成工具系统
  • 标准化数据格式以实现一致的输出
  • 连接池以实现最佳性能

错误处理

服务器实现了强大的错误处理:

  • 无效交易对
  • Exchange 连接问题
  • 速率限制
  • 格式错误的请求
  • 网络超时

发展

运行测试

# To be implemented pytest tests/

贡献

  1. 分叉存储库
  2. 创建功能分支
  3. 进行更改
  4. 提交拉取请求

本地开发

# Clone the repository git clone [repository-url] cd crypto-mcp-server # Install dependencies uv pip install -e .

故障排除

常见问题

  1. Exchange 连接错误
    • 检查您的互联网连接
    • 验证交易所是否正常运行
    • 确保所选交易所存在该交易对
  2. 速率限制
    • 在请求之间实现延迟
    • 使用不同的交易所进行高频查询
    • 检查交易所特定的汇率限制
  3. 数据格式问题
    • 验证交易对格式(例如 BTC/USDT,而不是 BTCUSDT)
    • 检查时间范围规范
    • 确保数值参数在有效范围内

执照

MIT 许可证 - 详情请参阅许可证文件

致谢

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

通过与主要交易所集成,提供加密货币的实时和历史市场数据。该服务器使像 Claude 这样的法学硕士 (LLM) 能够获取当前价格、分析市场趋势并访问详细的交易信息。

  1. Features
    1. Installation
      1. Installing via Smithery
      2. Installing Manually
    2. Usage
      1. Running the Server
      2. Connecting with Claude Desktop
      3. Available Tools
      4. Example Queries
    3. Technical Details
      1. Dependencies
      2. Architecture
      3. Error Handling
    4. Development
      1. Running Tests
      2. Contributing
      3. Local Development
    5. Troubleshooting
      1. Common Issues
    6. License
      1. Acknowledgments
        ID: 9kbbk1kmg2