coingecko-mcp
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., "@coingecko-mcpget the current price of bitcoin and ethereum in usd"
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.
coingecko-mcp
CoinGecko market data and price feeds with a file-first store, a derived SQLite cache, a deterministic market synthesizer, a CLI, and an MCP stdio server. The CLI and MCP server share the same assets and snapshots.
Frequently asked questions
How do I get live crypto prices in Claude Desktop?
Install coingecko-mcp and add it to your MCP client configuration:
{
"mcpServers": {
"coingecko": {
"command": "coingecko-mcp",
"args": ["mcp-start"]
}
}
}Works with Claude Desktop, Cursor, Windsurf and any MCP client. Ask your
assistant "what is the price of bitcoin?" and the coingecko_get_price tool
answers from the CoinGecko API — no API key required.
How to track Bitcoin and Ethereum prices with MCP?
Use the coingecko_get_price tool for one-off quotes and coingecko_refresh
to write timestamped snapshots into a local store. Add portfolio amounts with
coingecko_add_asset and read valuation with coingecko_portfolio.
What is the best free crypto price API for AI agents?
CoinGecko offers a free tier with no API key, which makes it a good default for agents and scripts. This package wraps it as an MCP server plus a CLI, so the same price data is available to an AI assistant and to shell automation.
How do I build a crypto portfolio tracker in Node.js?
Run coingecko-mcp init, add assets with amounts, and call portfolio:
coingecko-mcp add asset bitcoin --amount 0.5
coingecko-mcp portfolio --currency usdThe programmatic API exposes the same engine for embedding in your own tools.
Can I get price alerts for Bitcoin and Ethereum?
Yes. Store or refresh prices and evaluate thresholds with alert:
coingecko-mcp alert --above 70000 --below 60000Does coingecko-mcp need an API key?
No. CoinGecko's public API is used directly. API keys never appear in URLs, logs, stored snapshots, or synthesized documents.
Related MCP server: CoinCap MCP Server
Properties
Node.js 22.5 or newer; uses built-in
node:sqliteandfetchZero runtime dependencies and zero install scripts
JSON and JSONL source files with a transactional SQLite index
Current prices, market cap, volume, 24-hour change, and timestamp
Portfolio valuation, market charts, price alerts, and CSV/JSONL import/export
TTL price caching, refresh-on-demand, and bounded deterministic synthesis
Fourteen MCP tools with JSON Schema validation and JSON-RPC 2.0 notifications
No API key in URLs, logs, stored snapshots, or synthesized documents
Docker
A Dockerfile is included for containerized runs:
docker build -t coingecko-mcp .
docker run -i --rm coingecko-mcpThe container runs the MCP stdio server, so point your MCP client's command
at docker with the arguments above.
Install and verify
npm install coingecko-mcp
npm testnpm test runs the complete offline suite: file/store and SQLite tests,
engine and synthesis tests, feature tests, and an end-to-end MCP stdio
session. No network is required by the test suite.
CLI quick start
coingecko-mcp init --root /path/to/project
coingecko-mcp add asset bitcoin --symbol btc --name Bitcoin --root /path/to/project
coingecko-mcp refresh --root /path/to/project
coingecko-mcp list assets --json --root /path/to/project
coingecko-mcp list snapshots --coin bitcoin --json --root /path/to/project
coingecko-mcp synthesize portfolio --stdout --root /path/to/projectAll commands accept --root DIR; it defaults to the current directory. The
store is initialized automatically on first use, while an explicit init
reports which paths were created.
Add data manually
coingecko-mcp add asset ethereum --symbol eth --name Ethereum --amount 2.5
coingecko-mcp add snapshot ethereum --price 3500.75 --currency usd \
--market-cap 420000000000 --volume 15000000000 --change-24h -1.2 \
--last-updated-at 2026-10-27T00:00:00Z --source manualSnapshot writes also track the asset. Existing symbol/name metadata is
preserved unless explicitly replaced. Duplicate (coin_id, currency, last_updated_at) values remain append-only in JSONL but are upserted in
SQLite. Each add snapshot call returns exactly the snapshot that was
inserted, including backfilled timestamps.
Get and refresh prices
coingecko-mcp get-price bitcoin,ethereum --currencies usd,eur
coingecko-mcp get-price bitcoin --persist
coingecko-mcp get-price bitcoin --force-refresh
coingecko-mcp refresh # all tracked assets
coingecko-mcp refresh bitcoin # one tracked assetget-price uses a 30-second TTL by default. --cache-ttl N changes it and
--force-refresh bypasses it. Cached data can also be persisted with
--persist; it does not require a second network request. Cached results
carry no snapshot row ids (id: null) because they describe a previous
execution; fresh results carry the SQLite row id. refresh always fetches
fresh data and writes snapshots.
Portfolio, charts, alerts, and bulk tracking
coingecko-mcp add asset bitcoin --amount 0.5
coingecko-mcp portfolio --currency usd
coingecko-mcp market-chart bitcoin --days 7
coingecko-mcp markets --per-page 10
coingecko-mcp alert --above 70000 --below 60000portfolio multiplies each stored amount by its latest stored price and
reports per-position value plus portfolio totals. market-chart fetches
price and volume time series. markets tracks top market-cap coins and
optionally persists their current prices. alert evaluates stored latest
prices against --above/--below thresholds and reports matches; it is
fully offline and never polls.
Import and export history
coingecko-mcp export snapshots --format csv --out history.csv
coingecko-mcp export snapshots --format jsonl
coingecko-mcp import snapshots history.csv --format csvExports write the full stored history as JSONL or CSV. Imports validate each
row and report { imported, skipped, errors }; invalid rows are skipped with
line numbers rather than failing the whole batch.
List and synthesize
coingecko-mcp list assets --query bit
coingecko-mcp list snapshots --coin bitcoin --currency usd --limit 100
coingecko-mcp list snapshots --since 2026-10-01 --until 2026-10-27 --order oldest
coingecko-mcp synthesize portfolio
coingecko-mcp synthesize bitcoin --words 600 --stdout
coingecko-mcp stats --jsonOmitting --limit returns all matching snapshots. --order selects
recent (default) or oldest; --since/--until bound the time range.
Synthesis is deterministic, contains latest prices, absolute 24-hour movers,
coverage and data-quality notes, and never invents prices. Its output is
hard-capped at the requested word count. The default is 900 words; cached
briefs are invalidated by data writes. Without --stdout, the brief is
written under .coingecko/synthesis/.
File layout
.coingecko/
├── assets.json # tracked asset source of truth
├── snapshots.jsonl # append-only market history source of truth
├── synthesis/ # generated markdown briefs
└── cache/
└── market.db # derived, rebuildable SQLite index and cachesThe JSON/JSONL files are authoritative. SQLite is rebuilt from them on startup and after writes, and is updated incrementally on every snapshot write so history never has to be re-read. Corrupt JSON or JSONL is reported with its path and is never silently overwritten. JSONL corruption includes the exact line number.
MCP server
coingecko-mcp mcp-start --root /path/to/projectThe server speaks newline-delimited JSON-RPC 2.0 over stdio, supports MCP 2025-06-18 plus older negotiated versions, and reserves stdout for protocol messages. Notifications receive no response. Message handling is serialized so store writes stay in arrival order. The 2025-06-18 version rejects batch requests; older negotiated versions receive JSON-RPC batch arrays.
Tools
Tool | Purpose |
| Check CoinGecko API reachability |
| Add or update a tracked asset (with optional amount) |
| Validate and persist a market snapshot |
| Get current prices with TTL caching and optional persistence |
| Fetch and persist prices for one or all tracked assets |
| List tracked assets with optional text and limit filters |
| Query history by coin, currency, time, order, and limit |
| Generate a bounded market brief from stored data |
| Value tracked holdings against latest prices |
| Fetch price and volume time series for one coin |
| Track top market-cap coins and persist prices |
| Evaluate stored prices against above/below thresholds |
| Export history as JSONL or CSV text |
| Import snapshots from JSONL or CSV text |
All tools have closed JSON Schemas. Unknown properties, invalid enums,
out-of-range numbers, empty required arrays, and malformed initialize requests
are rejected with -32602. Domain failures such as an unknown asset or an API
error are returned as tool results with isError: true.
Error codes
Code | Meaning |
| Caller-supplied input failed validation |
| CoinGecko API transport or response failure |
| Request exceeded the configured timeout |
| A tracked asset or resource does not exist |
| The local store has not been initialized yet |
| A local data file failed to parse or validate |
| A request succeeded but returned no usable rows |
| The offline fixture is missing a required response |
| No fetch implementation is available |
| Local file read/write failure |
Configuration
Variable | Meaning |
| Project root containing |
| API base URL; default |
| Optional CoinGecko API key, sent only in the appropriate header |
| When true, use |
| Request timeout in milliseconds; default 10000 |
| JSON fixture for deterministic offline API responses |
The fixture format is:
{
"ping": { "status": "ok" },
"simplePrice": {
"bitcoin": {
"usd": 67000.25,
"usd_market_cap": 1320000000000,
"usd_24h_vol": 28000000000,
"usd_24h_change": 2.45,
"last_updated_at": 1793088000
}
},
"marketChart": {
"prices": [[1793088000000, 67000.25]],
"total_volumes": [[1793088000000, 28000000000]]
},
"markets": [
{ "id": "bitcoin", "symbol": "btc", "name": "Bitcoin", "current_price": 67000.25 }
]
}The included test/fixture.json covers three assets and USD/EUR prices. Live
API calls use a timeout, bounded retries for 429/5xx/network failures and
invalid JSON responses, Retry-After header respect (seconds or HTTP-date),
and no retry for permanent HTTP errors.
Programmatic API
const { CoinGeckoEngine } = require('coingecko-mcp/lib/engine');
const engine = new CoinGeckoEngine({ rootDir: process.cwd() });
engine.init();
engine.addAsset({ coin_id: 'bitcoin', symbol: 'btc', name: 'Bitcoin', amount: 0.5 });
await engine.refresh({ coinId: 'bitcoin' });
const latest = engine.latestSnapshot('bitcoin', 'usd');
const holdings = engine.portfolio({ currency: 'usd' });
const brief = engine.synthesize({ feature: 'portfolio', write: false });
engine.close();Market data belongs to CoinGecko and is subject to its API terms and rate limits. This package provides data retrieval and storage, not financial advice or trading execution.
Links
This server cannot be deployed
Maintenance
Related MCP Connectors
Market Data App MCP — wraps the Market Data App API (marketdata.app)
Crypto MCP with 21 tools for market data, DeFi, analytics, and sentiment. Post-paid USDC billing.
Historical tick, order book and settlement data for Polymarket and Predict.fun crypto up/down markets, plus smart-money lists and backtest quotes, over a read-only MCP server.
Read-only educational MCP for CryptoDecentral Sovereign. No auth, trading, custody, or advice.
Related MCP Servers
- AlicenseAqualityDmaintenanceReal-time crypto market intelligence MCP. Get prices, trending coins, market overview, top coins by market cap, and portfolio value — all through natural language in Claude, Cursor, or any MCP client6MIT
- FlicenseCqualityDmaintenanceProvides access to CoinCap's cryptocurrency market data and technical analysis tools via MCP, supporting assets, exchanges, markets, and more.3835 npm7-
- FlicenseCqualityDmaintenanceProvides cryptocurrency market data (prices, symbols) and a gated demo trading flow via MCP tools, with safety defaults like dry-run and confirmation gates.6-
- FlicenseNot gradedqualityDmaintenanceEnables querying cryptocurrency market data, refreshing data from CoinGecko, and performing market analysis through a FastMCP agent backed by a dlt pipeline and FastAPI.-