mcp-crypto-server

chazpawar/mcp-crypto-server

3.2

If you are the rightful owner of mcp-crypto-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Python MCP server providing real-time and historical cryptocurrency market data from 100+ exchanges and CoinMarketCap.

Tools
10
Resources
0
Prompts
0

Cryptocurrency Market Data MCP Server

A Python MCP server providing real-time and historical cryptocurrency market data from 100+ exchanges (via CCXT) and CoinMarketCap.

Features

  • Real-time ticker data, order books, and trading volumes
  • Historical OHLCV (candlestick) data with multiple timeframes
  • Market statistics and global cryptocurrency metrics
  • Multi-exchange support (Binance, Coinbase, Kraken, etc.)
  • Intelligent caching for optimal performance

Installation

  1. Clone and navigate to the directory:
git clone <repository-url>
cd mcp-server
  1. Install dependencies:
pip install -e .
  1. Set up environment variables:
cp .env.example .env
  1. Get a free CoinMarketCap API key at https://pro.coinmarketcap.com/signup and add it to .env:
COINMARKETCAP_API_KEY=your_api_key_here

Claude Desktop Configuration

Add this to your Claude Desktop config file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "crypto-market-data": {
      "command": "python",
      "args": ["-m", "src.server"],
      "cwd": "C:\\Users\\YourUsername\\mcp-server",
      "env": {
        "COINMARKETCAP_API_KEY": "your_api_key_here"
      }
    }
  }
}

Replace C:\\Users\\YourUsername\\mcp-server with your actual project path.

After updating the config, restart Claude Desktop.

Available Tools

The server provides 10 tools for Claude:

  1. get_ticker - Real-time price data for any trading pair
  2. get_order_book - Current order book with bids/asks
  3. get_historical_ohlcv - Historical candlestick data (1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1M)
  4. get_market_stats - Market cap, volume, supply, and price changes
  5. get_global_metrics - Overall crypto market statistics
  6. list_exchanges - Available exchanges and their capabilities
  7. list_markets - All trading pairs on an exchange
  8. list_cryptocurrencies - Top cryptocurrencies by market cap
  9. search_cryptocurrency - Search coins by symbol or name
  10. get_cache_stats - Cache usage statistics

Usage Examples

Try asking Claude:

  1. get_ticker - "What's the current price of BTC/USDT on Binance?"
  2. get_order_book - "Show me the market depth for ETH/USDT"
  3. get_historical_ohlcv - "Get daily candles for BTC over the last month"
  4. get_market_stats - "What's Bitcoin's market cap and supply?"
  5. get_global_metrics - "Show me total crypto market statistics"
  6. list_exchanges - "What exchanges can I access data from?"
  7. list_markets - "What trading pairs are available on Coinbase?"
  8. list_cryptocurrencies - "Show me the top 50 cryptocurrencies"
  9. search_cryptocurrency - "Find information about Solana"
  10. get_cache_stats - "How is the server cache performing?"

Example in Action

Claude Desktop Example

Claude analyzing top 10 cryptocurrency performance using real-time market data from this MCP server

Configuration

Optional settings in .env:

CACHE_TTL_REALTIME=30       # Real-time data cache (seconds)
CACHE_TTL_HISTORICAL=300    # Historical data cache (seconds)
DEFAULT_EXCHANGE=binance    # Default exchange

Troubleshooting

Server not appearing in Claude: Verify the path in claude_desktop_config.json and restart Claude

API key errors: Ensure your CoinMarketCap API key is valid (free tier: 10,000 calls/month)

Exchange errors: Use list_exchanges to see available exchanges

Development

Run tests:

pip install -e ".[dev]"
pytest

License

MIT License

Copyright (c) 2024 Cryptocurrency Market Data MCP Server

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.