Crypto Trader MCP Tool

by SaintDoresh
Verified

Integrations

  • Enables retrieval of real-time price information, historical data, and market details for Bitcoin cryptocurrency.

  • Provides search capability and market information for Bitcoin Cash cryptocurrency.

  • Allows retrieval of price history and market data for Dogecoin cryptocurrency.

适用于 Claude 桌面的 Crypto Trader MCP 工具

一种使用 CoinGecko API 提供加密货币市场数据的 MCP(模型上下文协议)工具,专为 Claude Desktop 设计。

教程

有关设置和使用此工具的详细指南,请查看我们的 Medium 教程: 教程:使用 Claude Desktop 和 Crypto Trader MCP 工具获取实时加密货币数据

特征

  • 实时加密货币价格数据
  • 加密货币的详细市场信息
  • 历史价格图表
  • 加密货币搜索功能
  • 加密货币趋势追踪
  • 全球市场统计数据

设置

  1. 确保安装了 Python 3.10 或更高版本
  2. 安装依赖项:
pip install -r requirements.txt

与 Claude Desktop 集成

  1. 通过将以下内容添加到您的 MCP 配置中,在 Claude Desktop 中配置您的 MCP 设置:
{ "mcpServers": { "crypto-trader": { "command": "py", "args": ["-3.13", "C:\\Path\\To\\Your\\Crypto-Trader-MCP-ClaudeDesktop\\main.py"] } } }
  1. 将路径替换为 main.py 文件的完整路径
  2. 使用以下命令运行服务器:
py -3.13 main.py
  1. 使用 Claude Desktop 时保持服务器运行

可用工具

1. 获取加密货币价格

获取实时加密货币价格信息:

{ "symbol": "BTC", "name": "bitcoin", "price": 65423.12, "change_24h": 2.5, "volume_24h": 28345678901, "market_cap": 1234567890123, "timestamp": "2025-03-15T10:30:00" }

2. 获取加密货币市场数据

获取加密货币的详细市场信息:

{ "symbol": "ETH", "name": "Ethereum", "market_cap_rank": 2, "current_price": 3521.48, "market_cap": 423456789012, "total_volume": 15834567890, "high_24h": 3580.25, "low_24h": 3475.62, "price_change_24h": 45.86, "price_change_percentage_24h": 1.32, "circulating_supply": 120283456, "total_supply": 120283456, "max_supply": null, "ath": 4878.26, "ath_date": "2021-11-10T14:24:11.849Z", "atl": 0.432979, "atl_date": "2015-10-20T00:00:00.000Z" }

3. 获取加密历史数据

获取加密货币的历史价格数据:

{ "symbol": "BTC", "name": "bitcoin", "days": 30, "prices": [ { "date": "2025-02-15T00:00:00", "price": 62150.23 }, { "date": "2025-02-16T00:00:00", "price": 63421.15 } // ... more data points ] }

4. 搜索加密

搜索加密货币:

{ "results": [ { "id": "bitcoin", "symbol": "BTC", "name": "Bitcoin" }, { "id": "bitcoin-cash", "symbol": "BCH", "name": "Bitcoin Cash" } // ... more results ] }

5. 获取趋势加密

获取流行的加密货币:

{ "trending_coins": [ { "id": "pendle", "name": "Pendle", "symbol": "PENDLE", "market_cap_rank": 85, "price_btc": 0.00002356 } // ... more trending coins ] }

6. 获取全局加密数据

获取全球加密货币市场数据:

{ "active_cryptocurrencies": 12875, "markets": 892, "total_market_cap_usd": 2347890123456, "total_volume_usd": 89723456789, "market_cap_percentage": { "BTC": 52.4, "ETH": 18.2 // ... more cryptocurrencies }, "updated_at": "2025-03-15T10:30:00" }

示例查询

您可以向 Claude Desktop 询问以下问题:

  • “比特币现在的价格是多少?”
  • “向我展示以太坊的详细市场数据”
  • “过去 30 天狗狗币的价格历史是多少?”
  • “搜索与‘sol’相关的加密货币”
  • “目前哪些加密货币流行?”
  • “目前加密货币的总市值是多少?”

错误处理

所有工具都包含适当的错误处理,如果出现问题,将返回错误消息:

{ "error": "Failed to fetch price for INVALID_SYMBOL" }

故障排除

如果 MCP 服务器在 Claude Desktop 中无法运行:

  1. 确保服务器正在运行 - 启动脚本时您应该看到输出
  2. 验证设置中的路径是否正确且绝对
  3. 确保 Python 3.10+ 位于你的系统 PATH 中
  4. 检查所有依赖项是否已安装
  5. 尝试重启 Claude Desktop
  6. 检查日志中是否有任何错误消息

速率限制

此工具使用免费的 CoinGecko API,该 API 具有速率限制。请注意,非常频繁的请求可能会受到 API 的限制。

执照

MIT 许可证

ID: 9b20muulne