Skip to main content
Glama
Cryptocurrency Market Data MCP Server

Cryptocurrency Market Data MCP Server

by Nayshins

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

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

微胶囊钙 Python CCXT 铁匠徽章

特征

  • 实时市场数据

    • 当前加密货币价格

    • 包含买卖价差的市场摘要

    • 按交易量排名的前几大交易对

    • 多种交易所支持

  • 历史分析

    • OHLCV(烛台)数据

    • 价格变动统计

    • 卷历史跟踪

    • 可定制的时间范围

  • Exchange 支持

    • 币安

    • Coinbase

    • 海妖

    • 库币

    • 超液体

    • 火币

    • Bitfinex

    • 比特

    • OKX

    • 墨西哥

Related MCP server: Crypto MCP Server

安装

通过 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 许可证 - 详情请参阅许可证文件

致谢

Available Tools

7 tools
get-historical-ohlcvB

Get historical OHLCV (candlestick) data for a trading pair

Inputs: symbol (required), timeframe, days_back, exchange.

get-market-summaryC

Get detailed market summary for a cryptocurrency pair from a specific exchange

Inputs: symbol (required), exchange.

get-priceB

Get current price of a cryptocurrency pair from a specific exchange

Inputs: symbol (required), exchange.

get-price-changeC

Get price change statistics over different time periods

Inputs: symbol (required), exchange.

get-top-volumesB

Get top cryptocurrencies by trading volume from a specific exchange

Inputs: limit, exchange.

get-volume-historyC

Get trading volume history over time

Inputs: symbol (required), days, exchange.

list-exchangesB

List all supported cryptocurrency exchanges

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity: get-historical-ohlcv for candlestick data, get-market-summary for detailed pair info, get-price for current price, get-price-change for statistics, get-top-volumes for volume rankings, get-volume-history for volume trends, and list-exchanges for exchange listing. The descriptions precisely differentiate their functions, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using kebab-case (e.g., get-historical-ohlcv, list-exchanges). The naming is predictable and readable throughout, with 'get-' or 'list-' prefixes clearly indicating the action, ensuring a uniform and professional appearance.

    Tool Count5/5

    With 7 tools, the server is well-scoped for cryptocurrency market data, covering key areas like pricing, volume, exchanges, and historical data. Each tool earns its place by addressing specific market analysis needs, avoiding bloat while providing comprehensive coverage for the domain.

    Completeness4/5

    The tool set offers strong coverage for cryptocurrency market data, including price, volume, historical data, and exchange info. Minor gaps exist, such as no tools for order book depth, trade history, or market sentiment, but agents can work around these with the provided tools for core market analysis tasks.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that exposes Binance cryptocurrency exchange data to LLMs, allowing agents to access real-time prices, order books, and historical market data without requiring API keys.
      21
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time and historical cryptocurrency market data using ccxt, enabling users to fetch live prices, historical candlestick data, and stream real-time ticker updates across multiple exchanges.
      14
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that provides cryptocurrency data tools and resources via an HTTP endpoint. It enables users to fetch real-time market data from Binance, track activity logs, and generate cryptocurrency executive summaries.
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      A comprehensive cryptocurrency market-data MCP server with 49 tools across six data sources, enabling LLMs to answer market questions via natural language.
      49
      MIT