Skip to main content
Glama
cmc-market-brief

cmc-market-brief

by xcaracalid

CMC Market Brief Agent

Build with CMC: API Hackathon, Round 2 — Track: AI Agents and Automation

An MCP server that puts live CoinMarketCap market data in front of any LLM, plus a CLI agent that composes a daily market brief from the same tools. Ask your AI assistant "how is the market doing, and what is 0.5 BTC worth in euros?" — it answers from real CMC data instead of its training memory.

What it does

  • MCP server (mcp_server.py) — exposes four tools over stdio to any MCP client (Claude Code, Claude Desktop, Cursor, …):

    • get_quotes(symbols) — latest price, 1h/24h/7d change, market cap, volume

    • get_top_listings(limit) — top coins by market capitalisation

    • get_global_metrics() — total market cap, 24h volume, BTC/ETH dominance

    • convert(amount, symbol, convert) — crypto/fiat price conversion

  • Brief agent (brief_agent.py) — a CLI that calls the same client and prints a formatted daily brief: market overview, top movers among the top N listings, and a watchlist table. Pure data composition, no LLM key needed.

Related MCP server: mcp-coinmarketcap

Architecture

                ┌──────────────────┐
  LLM / MCP ───▶│  mcp_server.py   │──┐
  client        └──────────────────┘  │
                                      ▼
                ┌──────────────────┐   ┌────────────────────────┐
  terminal ────▶│  brief_agent.py  │──▶│      cmc_client.py     │──▶ CMC Pro API
                └──────────────────┘   └────────────────────────┘    (HTTPS + key header)

Both entry points share one thin client, so the CLI brief and the MCP tools can never drift apart.

CoinMarketCap API endpoints used

Base URL: https://pro-api.coinmarketcap.com, key sent in the X-CMC_PRO_API_KEY header. (Paths verified against the official CMC API documentation.)

Endpoint

Used by

GET /v2/cryptocurrency/quotes/latest

get_quotes tool, watchlist section

GET /v1/cryptocurrency/listings/latest

get_top_listings tool, top-movers section

GET /v1/global-metrics/quotes/latest

get_global_metrics tool, overview section

GET /v2/tools/price-conversion

convert tool

Setup

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

cp .env.example .env     # then paste your CMC Pro API key into .env

Get a free key at https://pro.coinmarketcap.com/signup. During the hackathon, registering on DoraHacks with the same email upgrades the key to the free Startup tier for the event period. The key can also be supplied as the CMC_API_KEY environment variable. Never commit .env (it is in .gitignore), and the key is never logged or written to any output file.

Run

# Daily brief (live data)
.venv/bin/python brief_agent.py
.venv/bin/python brief_agent.py --watchlist BTC,ETH,SOL,BNB --limit 50

# Daily brief, offline demo on recorded sample fixtures (no key needed)
.venv/bin/python brief_agent.py --demo

# MCP server (stdio)
.venv/bin/python mcp_server.py

# Offline test suite (fixtures only, no key, no network)
.venv/bin/python -m pytest tests/ -q

MCP client configuration

Claude Code:

claude mcp add cmc-market-brief -- /ABS/PATH/TO/cmc-hackathon/.venv/bin/python /ABS/PATH/TO/cmc-hackathon/mcp_server.py

Generic MCP client JSON:

{
  "mcpServers": {
    "cmc-market-brief": {
      "command": "/ABS/PATH/TO/cmc-hackathon/.venv/bin/python",
      "args": ["/ABS/PATH/TO/cmc-hackathon/mcp_server.py"],
      "env": { "CMC_API_KEY": "your-key-here" }
    }
  }
}

(If CMC_API_KEY is not passed via env, the server reads the project .env file instead.)

Demo

  1. .venv/bin/python brief_agent.py --demo — prints a full brief from the recorded sample fixtures in tests/fixtures/ (clearly banner-labelled as demo data).

  2. With a real key: .venv/bin/python brief_agent.py prints the same brief with live numbers.

  3. Point any MCP client at mcp_server.py and ask: "Give me a market brief: global metrics, the top 10, and quotes for BTC, ETH and SOL."

Evidence of real API calls

.venv/bin/python scripts/capture_evidence.py

Runs one real call per endpoint and saves request parameters + full JSON responses to evidence/ (git-ignored). The script refuses to run without a key, and the key itself is never written to disk — the saved request record shows the auth header as <redacted — never stored>.

What the API made possible / where it got in the way

Made possible

  • One key and one base URL cover quotes, listings, global metrics and conversions — the whole brief is four GET calls.

  • The listings endpoint's 24h percent-change field makes a "top movers" section trivial: no OHLCV history needed.

  • Measured live on 2026-12-05: /v1/key/info costs 0 credits, and the global-metrics and listings calls cost 1 credit each at brief page sizes, and all four brief calls together measured 5 credits, so one full brief run is about 5 credits. The plan on this key reports 15,000 credits/month and a 50 requests/minute rate limit via /v1/key/info, so a daily brief is a negligible share of the quota. (Figures are the pre-upgrade values the API reported; the hackathon's Startup-tier upgrade lands on the same key after DoraHacks registration with the matching email.)

Got in the way

  • Field quirks seen live: listings payloads are heavy (full tag lists, self-reported supply fields, tvl: null on most assets), so parse defensively and pick fields explicitly. Global-metrics duplicates several values at the top level and again under quote.USD. Every response carries a status envelope with credit_count, which makes per-call cost accounting trivial. No sandbox was needed: the key was verified directly against production with read-only GETs, and error responses use the same structured status envelope (error_code / error_message).

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Official CoinMarketCap MCP server: real-time crypto prices, market cap, rankings and exchange data.

      https://mcp.coinmarketcap.com/mcp
    • 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.

    • Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.

      https://api.gloom.sh/mcp
    • Live cryptocurrency prices and FX rates as agent tools.

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI agents to query cryptocurrency data including prices, market cap, rankings, categories, and global metrics from CoinMarketCap via MCP tools.
      71 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP-compatible LLMs to answer crypto questions using live CoinMarketCap market data, including quotes, listings, trending coins, gainers/losers, OHLCV history, global metrics, Fear & Greed, and one-call market briefs.
      9
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to query live CoinMarketCap data: ticker-disambiguated quotes, screener-style sorted and filtered listings, market backdrop (global cap/volume, dominance, Fear & Greed, Altcoin Season Index), asset profiles, and amount conversion. Also composes a one-call market brief stitched from backdrop and top-of-tape context.
      MIT