CoinMarketCap API MCP Server for Market Data
Access CoinMarketCap cryptocurrency market data via the MCP server for real-time pricing, market caps, and historical insights.
npx -y @longmans/coin_api_mcpOverview
This MCP (Model Context Protocol) server wraps the CoinMarketCap REST API and exposes a small, MCP-compatible toolset for retrieving cryptocurrency market data. It translates typical CoinMarketCap operations — current prices, market capitalization, historical OHLC, and listings — into concise MCP tools that LLM agents or other model-driven systems can call directly at runtime.
The server is designed for developers building agentic applications, chatbots, or analytics workflows that need live or recent cryptocurrency data. By providing a predictable manifest and a simple execute endpoint, the MCP server lets language models request market facts and charts without embedding API keys or dealing with low-level HTTP logic.
Features
- MCP-compatible manifest that lists available market-data tools for LLMs
- Tool execution endpoint that proxies requests to CoinMarketCap
- Support for current price, market cap, coin lookup, and historical OHLC data
- API-key driven configuration via environment variables
- Docker and local Node.js run options for easy deployment
- Minimal JSON interface for easy integration with agent frameworks
Installation / Configuration
Requirements:
- Node.js 16+ (or use Docker)
- A CoinMarketCap API key (https://coinmarketcap.com/api/)
Clone and install:
Environment configuration (example .env):
COINMARKETCAP_API_KEY=your-coinmarketcap-key
PORT=3000
LOG_LEVEL=info
Start locally:
# start in foreground
# or run with Node directly
Docker:
# build
# run
Server will listen on the configured PORT (default 3000). The MCP manifest is available at /mcp/manifest and tool execution at /mcp/execute.
Available Tools
The server exposes a compact set of tools; each tool appears in the MCP manifest so LLM agents can discover usage and parameters.
| Tool name | Description | Parameters |
|---|---|---|
| get_price | Current price and 24h change for a symbol or slug | symbol (e.g., BTC), convert (USD, EUR) |
| get_market_cap | Market capitalization and ranking for a coin | symbol or slug |
| get_listings | Top N coins by market cap | limit (default 10), convert |
| get_ohlc | Historical OHLC candles for a coin | symbol/slug, start (ISO), end (ISO), interval (1m/1h/1d) |
| find_coin | Search coin metadata by query | query (name or symbol) |
Example manifest excerpt (available at /mcp/manifest):
Execution endpoint:
- POST /mcp/execute
- Body:
- Responds with JSON payload containing the requested data or an error object.
Use Cases
LLM-based financial assistant
- An assistant answering “What is the current price of ETH in USD and 24h change?” can call the get_price tool and render the structured reply to users, keeping the API key on the server.
Trading signal enrichment
- A signal-processing pipeline can request historical OHLC via get_ohlc to compute indicators (SMA, RSI) without directly handling CoinMarketCap API variants.
Portfolio dashboard
- A dashboard microservice periodically calls get_listings and get_market_cap to populate leaderboards and market-cap weighted indexes.
Educational chatbot
- A chatbot that explains cryptocurrency concepts can use find_coin to fetch canonical metadata (symbol, slug, launch date) and present consistent facts.
Concrete example — fetch BTC price with curl:
Example response:
Notes and Best Practices
- Rate limits: CoinMarketCap imposes rate limits on API keys. Cache frequent queries or aggregate requests where possible.
- Error handling: The execute endpoint returns structured errors (code, message). Agents should handle transient HTTP 5xx and retry with exponential backoff.
- Security: Never expose your COINMARKETCAP_API_KEY to clients. The MCP server is the only component that should hold the key.
- Timezones: Historical queries use ISO timestamps (UTC recommended) and the CoinMarketCap conversion parameter for fiat currencies.
For source, examples, and updates, see the project repository: https://github.com/longmans/coin_api_mcp