cmc-market-mcp
Provides tools that query CoinMarketCap's Pro API for live crypto market data: latest quotes, new listings, trending coins, top gainers/losers, global market metrics with BTC-dominance trend, and Fear & Greed index/history.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cmc-market-mcp What's BTC trading at, and is its dominance rising?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cmc-market-mcp
Live CoinMarketCap data for LLM agents, over the Model Context Protocol.
An MCP server that gives any MCP-compatible agent (Claude Desktop, Cursor, a custom LangChain/CrewAI loop, …) six focused tools for live crypto market awareness: latest quotes, brand-new listings, trending coins, top gainers/losers, global market metrics with BTC-dominance trend, and the Fear & Greed index with sentiment history.
Built for the CoinMarketCap API Hackathon — Round 2, track AI Agents and Automation.
Zero dependencies. Pure Python 3.10+ standard library — the MCP protocol, the HTTP client, retries, caching and the demo agent are all implemented in-repo. Clone it and it runs.
Credit-aware. CoinMarketCap bills per API call; the client caches aggressively per endpoint, retries politely, and reports exactly how many credits each answer cost in the tool result metadata.
Runs offline. A
--fixturesmode replays recorded-shaped API responses, so the full demo and the whole test-suite work with no key and no network.
Try it in 2 minutes (no API key needed)
git clone https://github.com/hungndp/cmc-market-mcp.git
cd cmc-market-mcp
python3 demo/demo_agent.py --fixturesThe demo spawns the real server, performs the MCP handshake, lists the tools, then asks three market questions and prints the complete question → plan → tool-calls → answer trace:
Q2: Is BTC dominance rising, and how big is the whole market?
[plan] 2 tool call(s): get_global_metrics, get_latest_quotes
-> tools/call get_global_metrics({})
summary: Total crypto market cap is $3.36T; BTC dominance is 57.40% and rising (+0.88% vs yesterday).
ANSWER: Yes — BTC dominance is rising: it is 57.40% of the market now versus
56.90% yesterday (+0.88%). The total crypto market cap is $3.36T ...Full captured output: docs/evidence/demo-fixtures-output.txt
(sample data, clearly labelled as such by every tool result).
Related MCP server: mcp-coinmarketcap
Run it live
Get a free API key at https://coinmarketcap.com/api/.
Put it where the server can read it — environment or a
.envfile (copy.env.example); it is sent only as theX-CMC_PRO_API_KEYheader and is never logged or committed.Start the server:
export CMC_API_KEY=your_key_here
./cmc-mcp # or: pip install . && cmc-market-mcpConnect an MCP host
{
"mcpServers": {
"cmc-market": {
"command": "/path/to/cmc-market-mcp/cmc-mcp",
"env": { "CMC_API_KEY": "your_key_here" }
}
}
}Tools
Tool | What it answers | Key arguments |
| Price, 1h/24h/7d changes, market cap, 24h volume for any symbols |
|
| Most recently listed coins, with platform and add date |
|
| Coins trending on CMC right now |
|
| Biggest gainers/losers over 1h / 24h / 7d / 30d |
|
| Total market cap & volume, BTC/ETH dominance — including whether dominance is rising vs yesterday |
|
| Fear & Greed index; with |
|
Every result returns a one-line summary, a trimmed structured payload
(raw CMC responses are projected down to the fields an agent reasons
over), and meta with the serving endpoint, cumulative credits spent,
and data source (live vs fixture).
CoinMarketCap endpoints used — and what they made possible
Endpoint | Tool(s) | What the API helped with |
|
| Grounding answers in real prices instead of model memory — the difference between an agent that knows BTC's price and one that guesses it. |
|
| Surfacing projects hours after they list — data an LLM cannot have in its weights at all. |
|
| A real-time attention signal (search/watchlist heat) that complements price data. |
|
| Pre-ranked movers across four time windows, so "what's moving?" costs one call, not a full listings scan. |
|
| Market-wide context in a single call — crucially it ships |
|
| CMC's own sentiment index; pairing latest + history turns a number into a trend ("sentiment is getting more fearful"). |
The envelope's credit_count field also drives the client's credit
accounting, so agents can budget their own API spend.
Architecture
┌──────────────────── MCP host / agent ────────────────────┐
│ Claude Desktop · Cursor · demo/demo_agent.py · your bot │
└──────────────────────────┬─────────────────────────────────┘
MCP over stdio │ JSON-RPC 2.0 (newline-delimited)
┌──────────────────────────▼─────────────────────────────────┐
│ server.py — protocol layer │
│ initialize · tools/list · tools/call · ping │
├────────────────────────────────────────────────────────┤
│ tools.py — 6 tools: validation, projection of raw │
│ payloads into compact results, summaries, metadata │
├────────────────────────────────────────────────────────┤
│ client.py — CMC Pro API client │
│ TTL cache · retry + backoff (honours Retry-After) · │
│ typed errors · credit accounting │
└───────────────┬───────────────────────────┬────────────┘
live transport fixture transport
(urllib, stdlib) (recorded-shaped JSON)
│ │
pro-api.coinmarketcap.com fixtures/*.jsonModule | Responsibility |
| MCP stdio server, |
| Tool schemas, handlers, formatting |
| API client: transport, retries, errors, credits |
| Thread-safe per-entry TTL cache |
| Offline fixture transport |
| Typed error hierarchy |
| Scripted agent: planner → tool calls → grounded answers |
| 32 unit/protocol/end-to-end tests (stdlib |
Design decisions worth noting
Per-endpoint cache TTLs — quotes 60 s, listings/trending/metrics 5 min, Fear & Greed 30 min (CMC updates it daily). An agent asking the same question twice in one reasoning loop pays once.
Retries only where safe — 429/5xx/network failures retry with exponential backoff + jitter (max 3 attempts); 4xx client errors fail fast as typed exceptions and surface to the agent as clean tool errors, never tracebacks.
Deterministic demo — the demo agent's planner/composer are rule-based so judges get a byte-identical, reproducible trace; swap in an LLM where
plan()andcompose()sit and the same server serves a fully autonomous agent.
Tests
python3 -m unittest discover -s tests -t .32 tests covering: envelope parsing, error mapping (401/400/429/5xx), retry-then-succeed, cache hit/miss behaviour, credit accounting, every tool handler against fixtures, argument validation, the MCP protocol in-process, and a full stdio round-trip against the spawned server.
Project layout
cmc-market-mcp/
├── cmc-mcp # one-command launcher (no install needed)
├── demo/demo_agent.py # scripted demo agent with full trace
├── docs/
│ ├── SUBMISSION.md # hackathon submission checklist
│ └── evidence/ # captured demo output (fixtures mode)
├── fixtures/ # recorded-shaped sample API responses
├── src/cmc_market_mcp/ # the server package
└── tests/ # unittest suiteLicense
MIT — see LICENSE.
Available Tools
6 toolsget_fear_and_greedA
Get the CoinMarketCap Fear & Greed index (0 = extreme fear, 100 = extreme greed). Pass days > 1 to also get the recent daily history and the sentiment trend.
Inputs: days.
get_global_metricsB
Get aggregate crypto market metrics: total market cap, total 24h volume, BTC and ETH dominance — including whether BTC dominance is rising or falling versus yesterday.
Inputs: currency.
get_latest_quotesB
Get the latest price, 1h/24h/7d percent changes, market cap and 24h volume for one or more cryptocurrencies by symbol (e.g. BTC, ETH, SOL) from CoinMarketCap.
Inputs: symbols (required), currency.
get_new_listingsB
List the most recently added cryptocurrencies on CoinMarketCap, with price, market cap and the platform they were issued on. Useful for spotting brand-new projects.
Inputs: limit, currency.
get_top_moversB
Get the top gaining and losing cryptocurrencies over a time period (1h, 24h, 7d or 30d), ranked by percent change.
Inputs: limit, currency, direction, time_period.
get_trendingB
Get the coins trending on CoinMarketCap right now (most searched and most watched), with live prices and 24h changes.
Inputs: limit, currency.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a clearly distinct data view: latest quotes, new listings, trending coins, top movers, global metrics, and fear/greed sentiment. Overlap is minimal, and descriptions make boundaries explicit.
All six tools use a consistent get_ + descriptive noun phrase pattern. The convention is predictable and readable throughout.
Six focused tools are well-scoped for a CoinMarketCap market-data server. Each tool earns its place without bloat.
The surface covers common market snapshot needs: quotes, listings, trending, movers, global metrics, and sentiment. Minor gaps remain, such as historical OHLC price data or coin metadata lookup, but core workflows are covered.
Maintenance
Related MCP Connectors
Your agent needs crypto prices it can rely on — spot, ranked market tables, history, OHLC, per-venue tickers, and what is trending right now. **What you can ask for** • "What is the price of these 20 tokens in USD and EUR right now?" • "Give me the top 100 by market cap with 24h and 7d change." • "Chart this coin's price over the last year, hourly." • "Where does this token trade, and at what spread per venue?" • "What is trending on CoinGecko today?" **How to use it** Point any MCP client at https://mcp.aisa.one/crypto-market-data/mcp and sign in with OAuth — there is no key to create or paste. 21 CoinGecko tools: simple price and token price by contract, supported currencies, coin list and detail, ranked markets, history, market charts and ranges, OHLC, per-coin tickers, categories, exchanges and their tickers, token data and charts, and trending. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Price the token here, then ask the same agent what X is posting about it — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/finance/mcp for equities, crypto and prediction markets in one place.
Real-time crypto prices, OHLCV candles, tickers, market cap & exchange quotes MCP via AgentAPIGate.
Crypto market & research MCP for AI agents: prices, derivatives, options, on-chain, sentiment, news.
Official CoinMarketCap MCP server: real-time crypto prices, market cap, rankings and exchange data.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive access to CoinMarketCap's cryptocurrency data including listings, quotes, market metrics, and the Fear & Greed Index directly within the Cursor environment.2MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to query cryptocurrency data including prices, market cap, rankings, categories, and global metrics from CoinMarketCap via MCP tools.71 npmMIT
- AlicenseCqualityDmaintenanceEnables access to CoinMarketCap API data, including latest cryptocurrency listings and token quotes, through natural language.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to access Coinmarketcap data through real API endpoints with no authentication required, supporting crypto and DeFi queries.-