mcp-crypto-server

ts-31/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.

The MCP Crypto Server is a Python-based server that facilitates cryptocurrency data retrieval and interaction through a JSON-RPC protocol.

Tools
3
Resources
0
Prompts
0

MCP Crypto Server

Requirements

  • Python 3.10+
  • Install dependencies: pip install -r requirements.txt

Project Structure

  • src/server.py: Stdio JSON-RPC loop.
  • src/endpoints/: Tool logic (async functions).
  • src/utils/: CCXT wrapper, cache, errors.
  • src/mcp/protocol.py: MCP dispatcher and tool registry.
  • tests/: Pytest cases with CCXT mocks.

How to Run the MCP Server

  1. Navigate to project root.
  2. Run: python -m src.server
    • Server runs as subprocess via stdio. It reads JSON-RPC requests from stdin and writes responses to stdout.
    • Use with an MCP-compatible host (e.g., Claude Desktop, Cursor) that launches it as a tool server.

The server closes CCXT connections on exit.

Test It

List tools:

echo '{"jsonrpc":"2.0","method":"mcp/listTools","params":{},"id":1}' | python -m src.server

Get BTC price:

echo '{"jsonrpc":"2.0","method":"mcp/callTool","params":{"name":"get_current_price","args":{"symbol":"BTC/USDT"}},"id":2}' | python -m src.server

Tools

  • get_current_price(symbol): Current ticker.
  • get_historical_ohlcv(symbol, timeframe='1h', limit=100): OHLCV candles.
  • subscribe_realtime(symbol): Poll for updates (call every 10s).

Tests

pytest tests/

Structure

  • src/server.py: Stdio loop.
  • src/endpoints/: Tool functions.
  • src/utils/: CCXT, cache, errors.
  • src/mcp/protocol.py: JSON-RPC handler.