Cover image
Try Now
2024-12-26

镜像://github.com/nayshins/mcp-server-ccxt

3 years

Works with Finder

0

Github Watches

1

Github Forks

3

Github Stars

Cryptocurrency Market Data MCP Server

A Model Context Protocol (MCP) server that provides real-time and historical cryptocurrency market data through integration with major exchanges. This server enables LLMs like Claude to fetch current prices, analyze market trends, and access detailed trading information.

MCP Python CCXT

Cryptocurrency Market Data Server MCP server

Features

  • Real-time Market Data

    • Current cryptocurrency prices
    • Market summaries with bid/ask spreads
    • Top trading pairs by volume
    • Multiple exchange support
  • Historical Analysis

    • OHLCV (candlestick) data
    • Price change statistics
    • Volume history tracking
    • Customizable timeframes
  • Exchange Support

    • Binance
    • Coinbase
    • Kraken
    • KuCoin
    • HyperLiquid
    • Huobi
    • Bitfinex
    • Bybit
    • OKX
    • MEXC

Installation

# Using uv (recommended)
uv pip install mcp ccxt

# Using pip
pip install mcp ccxt

Usage

Running the Server

python crypto_server.py

Connecting with Claude Desktop

  1. Open your Claude Desktop configuration at:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the server configuration:

{
    "mcpServers": {
        "crypto": {
            "command": "python",
            "args": ["/path/to/crypto_server.py"]
        }
    }
}
  1. Restart Claude Desktop

Available Tools

  1. get-price

    • Get current price for any trading pair
    • Example: "What's the current price of BTC/USDT on Binance?"
  2. get-market-summary

    • Fetch detailed market information
    • Example: "Show me a market summary for ETH/USDT"
  3. get-top-volumes

    • List top trading pairs by volume
    • Example: "What are the top 5 trading pairs on Kraken?"
  4. list-exchanges

    • Show all supported exchanges
    • Example: "Which exchanges are supported?"
  5. get-historical-ohlcv

    • Get historical candlestick data
    • Example: "Show me the last 7 days of BTC/USDT price data in 1-hour intervals"
  6. get-price-change

    • Calculate price changes over different timeframes
    • Example: "What's the 24-hour price change for SOL/USDT?"
  7. get-volume-history

    • Track trading volume over time
    • Example: "Show me the trading volume history for ETH/USDT over the last week"

Example Queries

Here are some example questions you can ask Claude once the server is connected:

- 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?

Technical Details

Dependencies

  • mcp: Model Context Protocol SDK
  • ccxt: Cryptocurrency Exchange Trading Library
  • Python 3.9 or higher

Architecture

The server uses:

  • CCXT's async support for efficient exchange communication
  • MCP's tool system for LLM integration
  • Standardized data formatting for consistent outputs
  • Connection pooling for optimal performance

Error Handling

The server implements robust error handling for:

  • Invalid trading pairs
  • Exchange connectivity issues
  • Rate limiting
  • Malformed requests
  • Network timeouts

Development

Running Tests

# To be implemented
pytest tests/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Local Development

# Clone the repository
git clone [repository-url]
cd crypto-mcp-server

# Install dependencies
uv pip install -e .

Troubleshooting

Common Issues

  1. Exchange Connection Errors

    • Check your internet connection
    • Verify the exchange is operational
    • Ensure the trading pair exists on the selected exchange
  2. Rate Limiting

    • Implement delays between requests
    • Use different exchanges for high-frequency queries
    • Check exchange-specific rate limits
  3. Data Formatting Issues

    • Verify trading pair format (e.g., BTC/USDT, not BTCUSDT)
    • Check timeframe specifications
    • Ensure numerical parameters are within valid ranges

License

MIT License - See LICENSE file for details

Acknowledgments

  • CCXT for exchange integrations
  • Model Context Protocol for the MCP specification
  • The cryptocurrency exchanges for providing market data APIs

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    1 (1)
    Avatar
    user_vYjmYlX9
    2025-04-15

    Remote MCP Server on Cloudflare by k4han is a game-changer for managing MCP applications. The seamless integration and robust cloud infrastructure make it incredibly efficient and reliable. The performance and security features provided by Cloudflare ensure a smooth and secure experience. Highly recommend it for anyone needing a dependable remote MCP server solution!