Get the FREE Ultimate OpenClaw Setup Guide →

Crypto_MCP_Server

Crypto MCP Server is a Model Context Protocol (MCP) compatible server that provides real-time and historical cryptocurrency market data using ccxt

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nielsen642-crypto_mcp_server python -m server.main

How to use

Crypto MCP Server provides three tools for interacting with cryptocurrency market data via the MCP protocol. The server exposes get_ticker for live price and market summary data, get_ohclv for historical OHLCV candles, and stream_ticker as an asynchronous real-time price stream. You can query real-time data for supported symbols and exchanges, fetch historical candles with configurable timeframes, and subscribe to a live stream of price updates that yields new data at a regular interval. This setup includes in-memory caching, error handling, and a lightweight MCP server architecture to facilitate manual testing and integration with MCP clients.

To use the tools locally, run the server using the provided entry point (python -m server.main) from the repository root or the server directory. Once running, you can invoke the tools via the MCP client of your choice, or use the included client_test.py to exercise the tools manually. The tests cover symbol validity, exchange support, API errors, and streaming behavior, ensuring reliable operation across common scenarios.

How to install

Prerequisites:

  • Python 3.10+ (recommended 3.10 or newer)
  • Git
  • Internet access to install dependencies from requirements.txt

Step-by-step installation:

  1. Clone the repository: git clone https://github.com/yourusername/crypto-mcp-server
  2. Navigate to the project directory: cd crypto-mcp-server
  3. Create and activate a virtual environment (optional but recommended): python -m venv venv

    On Windows:

    venv\Scripts\activate

    On macOS/Linux:

    source venv/bin/activate
  4. Install dependencies: pip install -r requirements.txt
  5. (Optional) Run tests to verify setup: pytest -vv

Notes:

  • The server is Python-based and uses asyncio for streaming. Ensure network access to any required exchange APIs via ccxt.
  • You can adjust environment-specific settings by editing the server/configuration as needed.

Additional notes

Tips and common issues:

  • If you encounter import errors, make sure you are running from the project root or adjust PYTHONPATH to include the project directory.
  • The in-memory cache is TTL-based; cached results expire after the configured duration to balance freshness and API load.
  • For streaming, ensure the event loop is running and that your MCP client properly iterates the async generator from stream_ticker.
  • If tests fail due to API rate limits or network issues, consider running tests with mocks or local fixtures where applicable.
  • The project uses ccxt for exchange APIs; some exchanges may require API keys or rate-limiting considerations. Validate your target symbol and exchange are supported in tests.

Related MCP Servers

Sponsor this space

Reach thousands of developers