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
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:
- Clone the repository: git clone https://github.com/yourusername/crypto-mcp-server
- Navigate to the project directory: cd crypto-mcp-server
- Create and activate a virtual environment (optional but recommended):
python -m venv venv
On Windows:
venv\Scripts\activateOn macOS/Linux:
source venv/bin/activate - Install dependencies: pip install -r requirements.txt
- (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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP