crypto-mcp

mylxsw/crypto-mcp

3.2

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

The Crypto MCP Server is a FastMCP-based implementation designed to provide cryptocurrency market data from CoinMarketCap, enabling AI assistants to interact with cryptocurrency information through the MCP protocol.

Tools
6
Resources
0
Prompts
0

Crypto MCP Server

A FastMCP-based MCP (Model Context Protocol) server implementation for retrieving cryptocurrency market data from CoinMarketCap, allowing AI assistants to interact with cryptocurrency information through the MCP protocol.

Features

  • πŸ“ˆ Cryptocurrency Listings - Get latest cryptocurrency listings with market data
  • πŸ’° Cryptocurrency Quotes - Get latest quotes for specific cryptocurrencies
  • πŸ—ΊοΈ Cryptocurrency Map - Get mapping of all cryptocurrencies to CoinMarketCap IDs
  • ℹ️ Cryptocurrency Info - Get metadata for cryptocurrencies
  • 🌐 Global Metrics - Get latest global cryptocurrency market metrics
  • 🏦 Exchange Listings - Get list of all exchanges with market data
  • πŸ” Authentication - Optional static token verification support
  • 🐳 Docker Support - Docker and Docker Compose configurations provided

Environment Variables

Before starting the service, you need to set the following environment variables:

Required Environment Variables

Variable NameDescriptionExample
COINMARKET_API_KEYCoinMarketCap API keyyour-api-key-here

Optional Environment Variables

Variable NameDescriptionDefaultExample
CRYPTO_MCP_AUTH_TOKENMCP server authentication tokenNoneabcdefghijklmnopqrstuvwxyz

Quick Start

Local Development

  1. Clone the repository

    git clone <repository-url>
    cd crpyto-mcp
    
  2. Install dependencies

    uv sync
    
  3. Set environment variables

    export COINMARKET_API_KEY="your-coinmarketcap-api-key"
    # Optional: Set authentication token
    export CRYPTO_MCP_AUTH_TOKEN="your-auth-token"
    
  4. Start the service

    uv run main.py
    

The service will start at http://localhost:8000 with the MCP endpoint at http://localhost:8000/mcp.

Using Docker

  1. Using Docker Compose (Recommended)

    # Set environment variables
    export COINMARKET_API_KEY="your-coinmarketcap-api-key"
    
    # Start the service
    docker-compose up -d
    
  2. Using Docker directly

    docker build -t crpyto-mcp .
    docker run -p 8000:8000 \
      -e COINMARKET_API_KEY="your-coinmarketcap-api-key" \
      crpyto-mcp
    

Connection

  • Protocol: HTTP
  • Endpoint: http://localhost:8000/mcp
  • Port: 8000

Available Tools

Tools

get_cryptocurrency_listings

Get latest cryptocurrency listings with market data

  • Parameters:
    • start (string, optional): Offset (starting with 1), defaults to "1"
    • limit (string, optional): Number of results (default: 100, max: 5000), defaults to "100"
    • sort (string, optional): What to sort by (e.g., 'market_cap', 'volume_24h')
    • sort_dir (string, optional): Direction: 'asc' or 'desc'
    • cryptocurrency_type (string, optional): Filter by type (e.g., 'coins', 'tokens')
    • convert (string, optional): Currency to convert prices to (e.g., 'USD', 'EUR'), defaults to "USD"
get_cryptocurrency_quotes

Get latest quotes for specific cryptocurrencies

  • Parameters:
    • symbol (string, optional): Comma-separated list of symbols (e.g., 'BTC,ETH')
    • slug (string, optional): Comma-separated list of slugs (e.g., 'bitcoin,ethereum')
    • id (string, optional): Comma-separated list of CoinMarketCap IDs
    • convert (string, optional): Currency to convert prices to (e.g., 'USD', 'EUR'), defaults to "USD"
get_cryptocurrency_map

Get mapping of all cryptocurrencies to CoinMarketCap IDs

  • Parameters:
    • listing_status (string, optional): Filter by status (e.g., 'active', 'inactive'), defaults to "active"
    • start (string, optional): Offset (starting with 1), defaults to "1"
    • limit (string, optional): Number of results (default: 100, max: 5000), defaults to "100"
    • symbol (string, optional): Filter by symbol(s) (comma-separated)
get_cryptocurrency_info

Get metadata for cryptocurrencies

  • Parameters:
    • symbol (string, optional): Comma-separated list of symbols (e.g., 'BTC,ETH')
    • slug (string, optional): Comma-separated list of slugs (e.g., 'bitcoin,ethereum')
    • id (string, optional): Comma-separated list of CoinMarketCap IDs
get_global_metrics

Get latest global cryptocurrency market metrics

  • Parameters:
    • convert (string, optional): Currency to convert prices to (e.g., 'USD', 'EUR'), defaults to "USD"
get_exchange_listings

Get list of all exchanges with market data

  • Parameters:
    • start (string, optional): Offset (starting with 1), defaults to "1"
    • limit (string, optional): Number of results (default: 100, max: 5000), defaults to "100"
    • sort (string, optional): What to sort by (e.g., 'volume_24h')
    • sort_dir (string, optional): Direction: 'asc' or 'desc'
    • market_type (string, optional): Filter by market type (e.g., 'spot', 'derivatives')
    • convert (string, optional): Currency to convert prices to (e.g., 'USD', 'EUR'), defaults to "USD"

Development

Project Structure

crpyto-mcp/
β”œβ”€β”€ main.py              # Main service file
β”œβ”€β”€ pyproject.toml       # Project configuration
β”œβ”€β”€ Dockerfile           # Docker configuration
β”œβ”€β”€ docker-compose.yaml  # Docker Compose configuration
└── README.md           # Project documentation

Dependencies

  • Python >= 3.13
  • fastmcp >= 2.12.2
  • requests >= 2.32.5

Development Environment Setup

  1. Ensure uv is installed
  2. Clone the repository and install dependencies:
    uv sync
    
  3. Set environment variables and run:
    uv run main.py
    

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Issues and Pull Requests are welcome!

Related Links