mcp-crypto-price 3.5.12 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -18
- package/dist/homepage.js +1 -1
- package/dist/http.js +192 -0
- package/dist/index.js +264 -1
- package/dist/mcp-crypto-price-3.7.0.tgz +0 -0
- package/dist/services/coincap.js +27 -1
- package/dist/services/formatters.js +138 -0
- package/dist/services/schemas.js +11 -0
- package/dist/tools/asset-info.js +52 -0
- package/dist/tools/candlestick.js +96 -0
- package/dist/tools/compare.js +79 -0
- package/dist/tools/global-metrics.js +48 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/price-conversion.js +88 -0
- package/dist/tools/search-assets.js +63 -0
- package/package.json +22 -26
- package/dist/mcp-crypto-price-3.5.12.tgz +0 -0
- package/dist/services/__tests__/coincap.test.js +0 -212
- package/dist/services/__tests__/formatters.test.js +0 -131
- package/dist/tools/__tests__/exchanges.test.js +0 -92
- package/dist/tools/__tests__/historical.test.js +0 -68
- package/dist/tools/__tests__/market.test.js +0 -62
- package/dist/tools/__tests__/price.test.js +0 -47
- package/dist/tools/__tests__/rates.test.js +0 -100
- package/dist/tools/__tests__/technical-analysis.test.js +0 -81
- package/dist/tools/__tests__/top-assets.test.js +0 -68
package/README.md
CHANGED
|
@@ -17,6 +17,8 @@ A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency
|
|
|
17
17
|
- **BREAKING**: CoinCap v2 API removed. Now uses v3 API exclusively. A `COINCAP_API_KEY` is required (free tier available at [pro.coincap.io/dashboard](https://pro.coincap.io/dashboard))
|
|
18
18
|
- Streamable HTTP transport added (while keeping STDIO compatibility)
|
|
19
19
|
- Smithery CLI scripts to build and run the HTTP server
|
|
20
|
+
- **6 new tools**: `search-assets`, `get-global-metrics`, `compare-crypto`, `get-candlestick-data`, `get-price-conversion`, `get-asset-info`
|
|
21
|
+
- **MCP best practices**: `isError` flag on validation errors, server description, and `asset://{symbol}` resource template
|
|
20
22
|
|
|
21
23
|
## Usage
|
|
22
24
|
|
|
@@ -58,14 +60,15 @@ If your MCP client requires launching via `cmd.exe` on Windows:
|
|
|
58
60
|
### Development scripts
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
pnpm dev # Development (HTTP server with hot reload via Smithery CLI)
|
|
64
|
+
pnpm build # Compile TypeScript → dist/
|
|
65
|
+
pnpm format # Format source files with Prettier
|
|
66
|
+
pnpm lint # Check for lint errors (ESLint + typescript-eslint)
|
|
67
|
+
pnpm lint:fix # Auto-fix lint errors
|
|
68
|
+
pnpm types:check # TypeScript type-check without emitting files
|
|
69
|
+
pnpm test # Run all tests with Vitest
|
|
70
|
+
pnpm test:coverage # Run tests with coverage report (Vitest)
|
|
71
|
+
pnpm inspector # Open MCP inspector for interactive debugging
|
|
69
72
|
```
|
|
70
73
|
|
|
71
74
|
### Run as Streamable HTTP server
|
|
@@ -75,27 +78,27 @@ You can run the server over HTTP for environments that support MCP over HTTP str
|
|
|
75
78
|
- Dev server (recommended during development):
|
|
76
79
|
|
|
77
80
|
```bash
|
|
78
|
-
|
|
81
|
+
pnpm dev
|
|
79
82
|
```
|
|
80
83
|
|
|
81
84
|
- Build and run the HTTP server:
|
|
82
85
|
|
|
83
86
|
```bash
|
|
84
87
|
# Build (outputs to dist/)
|
|
85
|
-
|
|
88
|
+
pnpm build
|
|
86
89
|
|
|
87
90
|
# Start the HTTP server
|
|
88
|
-
|
|
91
|
+
pnpm start:http
|
|
89
92
|
```
|
|
90
93
|
|
|
91
94
|
- Build and run the STDIO server:
|
|
92
95
|
|
|
93
96
|
```bash
|
|
94
97
|
# Build (outputs to dist/)
|
|
95
|
-
|
|
98
|
+
pnpm build
|
|
96
99
|
|
|
97
100
|
# Start the STDIO server
|
|
98
|
-
|
|
101
|
+
pnpm start:stdio
|
|
99
102
|
```
|
|
100
103
|
|
|
101
104
|
The server listens on port 3000 by default (override with `PORT`). For clients that connect over HTTP (e.g. Smithery, Claude.ai), pass your API key as a query parameter:
|
|
@@ -123,7 +126,7 @@ Without a valid API key, all tools will return an error with instructions on how
|
|
|
123
126
|
|
|
124
127
|
## Note for Smithery CLI users
|
|
125
128
|
|
|
126
|
-
This MCP server works directly via `
|
|
129
|
+
This MCP server works directly via `pnpm dlx` (configs above) and does not require Smithery.
|
|
127
130
|
|
|
128
131
|
If you do use the Smithery CLI, authenticate with `smithery auth login` or by setting `SMITHERY_API_KEY` in your environment. Recent versions of the Smithery CLI do not support passing API keys via `--key` (or older `--profile` patterns).
|
|
129
132
|
|
|
@@ -189,6 +192,72 @@ Lists top cryptocurrency exchanges ranked by 24h volume:
|
|
|
189
192
|
- Optional `exchangeId` parameter (e.g. `binance`) for single exchange details
|
|
190
193
|
- Optional `limit` parameter (1–50, default 10)
|
|
191
194
|
|
|
195
|
+
#### search-assets
|
|
196
|
+
|
|
197
|
+
Searches for cryptocurrencies by name or symbol with fuzzy matching:
|
|
198
|
+
- Returns matching assets with symbol, name, price, and rank
|
|
199
|
+
- Configurable result count (1–50, default 10)
|
|
200
|
+
- Example: search "bit" returns Bitcoin, Bitcoin Cash, BitTorrent, etc.
|
|
201
|
+
|
|
202
|
+
#### get-global-metrics
|
|
203
|
+
|
|
204
|
+
Provides an overview of the entire cryptocurrency market:
|
|
205
|
+
- Total market capitalization across all assets
|
|
206
|
+
- 24-hour trading volume
|
|
207
|
+
- Number of active cryptocurrencies
|
|
208
|
+
- Bitcoin dominance percentage
|
|
209
|
+
- Top gainers and losers
|
|
210
|
+
|
|
211
|
+
#### compare-crypto
|
|
212
|
+
|
|
213
|
+
Compares 2–5 cryptocurrencies side by side:
|
|
214
|
+
- Price, 24h change, market cap, volume, and rank for each asset
|
|
215
|
+
- Comma-separated symbols (e.g. `BTC,ETH,SOL`)
|
|
216
|
+
- Highlights best performer by 24h change
|
|
217
|
+
|
|
218
|
+
#### get-candlestick-data
|
|
219
|
+
|
|
220
|
+
Retrieves OHLCV candlestick data from a specific exchange:
|
|
221
|
+
- Open, high, low, close, and volume for each candle
|
|
222
|
+
- Configurable exchange (e.g. `binance`), quote currency (e.g. `usd`), and interval (`5m`, `15m`, `1h`, `6h`, `1d`)
|
|
223
|
+
- Supports 1–30 days of historical candles
|
|
224
|
+
|
|
225
|
+
#### get-price-conversion
|
|
226
|
+
|
|
227
|
+
Converts a cryptocurrency amount into any fiat currency:
|
|
228
|
+
- Uses real-time price data and USD-based exchange rates
|
|
229
|
+
- Parameters: `symbol` (e.g. `BTC`), `amount` (default 1), `currency` (default `usd`)
|
|
230
|
+
- Example: 2.5 BTC in EUR
|
|
231
|
+
|
|
232
|
+
#### get-asset-info
|
|
233
|
+
|
|
234
|
+
Returns detailed metadata for a single cryptocurrency:
|
|
235
|
+
- ID, rank, symbol, and name
|
|
236
|
+
- Price, 24h change, market cap, and volume
|
|
237
|
+
- Circulating supply and max supply
|
|
238
|
+
- VWAP (24h)
|
|
239
|
+
|
|
240
|
+
## Resources
|
|
241
|
+
|
|
242
|
+
The server exposes the following MCP resources:
|
|
243
|
+
|
|
244
|
+
- **`info://server`** — Server name and version metadata
|
|
245
|
+
- **`asset://{symbol}`** — Cryptocurrency asset information by symbol (e.g. `asset://BTC`), returned as JSON
|
|
246
|
+
|
|
247
|
+
## Prompts
|
|
248
|
+
|
|
249
|
+
The server exposes the following MCP prompts that clients can invoke:
|
|
250
|
+
|
|
251
|
+
| Prompt | Args | Description |
|
|
252
|
+
|--------|------|-------------|
|
|
253
|
+
| `analyze-crypto` | `symbol` | Comprehensive analysis: price, market, historical trends |
|
|
254
|
+
| `compare-cryptocurrencies` | `symbols` | Compare 2-5 cryptos side-by-side |
|
|
255
|
+
| `market-overview` | — | Global market snapshot: metrics, top assets, top exchanges |
|
|
256
|
+
| `crypto-conversion` | `symbol`, `amount?`, `currency?` | Convert crypto amount to fiat |
|
|
257
|
+
| `exchange-analysis` | `symbol` | Exchange landscape analysis for a crypto |
|
|
258
|
+
| `technical-analysis` | `symbol` | Full technical analysis: indicators, candles, trends |
|
|
259
|
+
| `crypto-screener` | `query` | Search and screen cryptos for opportunities |
|
|
260
|
+
|
|
192
261
|
## Sample Prompts
|
|
193
262
|
|
|
194
263
|
- "What's the current price of Bitcoin?"
|
|
@@ -199,10 +268,24 @@ Lists top cryptocurrency exchanges ranked by 24h volume:
|
|
|
199
268
|
- "What are the technical indicators for ETH right now?"
|
|
200
269
|
- "What's the current EUR to USD exchange rate?"
|
|
201
270
|
- "Which crypto exchanges have the highest 24h volume?"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
271
|
+
- "Search for cryptocurrencies matching 'sol'"
|
|
272
|
+
- "Give me a global overview of the crypto market"
|
|
273
|
+
- "Compare BTC, ETH, and SOL side by side"
|
|
274
|
+
- "Show me 1-hour candlestick data for BTC on Binance over the last 3 days"
|
|
275
|
+
- "Convert 2.5 BTC to EUR"
|
|
276
|
+
- "Get detailed info about the Ethereum asset"
|
|
277
|
+
- "Generate a comprehensive analysis of a cryptocurrency covering price, market, and historical trends"
|
|
278
|
+
- "Find all cryptocurrencies with 'bit' in their name and show me their current prices"
|
|
279
|
+
- "What's the market cap ranking and circulating supply of Cardano?"
|
|
280
|
+
- "Compare the top 3 stablecoins and show which has the highest volume"
|
|
281
|
+
- "Show me how Bitcoin has performed over the past 30 days with daily candles"
|
|
282
|
+
- "Convert 100 SOL to GBP and show the exchange rate"
|
|
283
|
+
- "Give me a full market snapshot: global metrics, top gainers, and BTC dominance"
|
|
284
|
+
- "What are the best and worst performing cryptos in the last 24 hours?"
|
|
285
|
+
- "Show me 15-minute candlestick data for ETH on Coinbase over the last 2 days"
|
|
286
|
+
- "Compare DeFi tokens: UNI, AAVE, COMP, and MKR"
|
|
287
|
+
- "What's the VWAP and max supply of Bitcoin?"
|
|
288
|
+
- "Search for layer-2 tokens and compare the top results"
|
|
206
289
|
|
|
207
290
|
## License
|
|
208
291
|
|
package/dist/homepage.js
CHANGED
|
@@ -290,7 +290,7 @@ export function renderHomepage() {
|
|
|
290
290
|
</div>
|
|
291
291
|
<div class="metric">
|
|
292
292
|
<strong>CLI example</strong>
|
|
293
|
-
<code>
|
|
293
|
+
<code>pnpm dlx @smithery/cli install mcp-crypto-price --client claude</code>
|
|
294
294
|
</div>
|
|
295
295
|
<div class="metric">
|
|
296
296
|
<strong>Remote endpoint</strong>
|
package/dist/http.js
CHANGED
|
@@ -35,6 +35,7 @@ const serverCard = {
|
|
|
35
35
|
serverInfo: {
|
|
36
36
|
name: SERVER_CONFIG.name,
|
|
37
37
|
version: SERVER_CONFIG.version,
|
|
38
|
+
description: 'A Model Context Protocol server providing cryptocurrency price, market, and on-chain data from CoinCap.',
|
|
38
39
|
},
|
|
39
40
|
tools: [
|
|
40
41
|
{
|
|
@@ -204,6 +205,167 @@ const serverCard = {
|
|
|
204
205
|
openWorldHint: true,
|
|
205
206
|
},
|
|
206
207
|
},
|
|
208
|
+
{
|
|
209
|
+
name: 'search-assets',
|
|
210
|
+
description: 'Search for cryptocurrencies by name, symbol, or partial match. Returns multiple matching assets with their ID, name, symbol, rank, and current price.',
|
|
211
|
+
inputSchema: {
|
|
212
|
+
type: 'object',
|
|
213
|
+
properties: {
|
|
214
|
+
query: {
|
|
215
|
+
type: 'string',
|
|
216
|
+
description: 'Search query — cryptocurrency name, symbol, or partial match (e.g. "bit", "eth", "doge")',
|
|
217
|
+
},
|
|
218
|
+
limit: {
|
|
219
|
+
type: 'number',
|
|
220
|
+
minimum: 1,
|
|
221
|
+
maximum: 50,
|
|
222
|
+
default: 10,
|
|
223
|
+
description: 'Maximum number of results to return (1-50, default 10)',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
required: ['query'],
|
|
227
|
+
},
|
|
228
|
+
annotations: {
|
|
229
|
+
title: 'Search Crypto Assets',
|
|
230
|
+
readOnlyHint: true,
|
|
231
|
+
destructiveHint: false,
|
|
232
|
+
idempotentHint: true,
|
|
233
|
+
openWorldHint: true,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'get-global-metrics',
|
|
238
|
+
description: 'Get a global overview of the cryptocurrency market including total market capitalization, 24-hour trading volume, Bitcoin dominance percentage, and the number of active cryptocurrencies.',
|
|
239
|
+
inputSchema: {
|
|
240
|
+
type: 'object',
|
|
241
|
+
},
|
|
242
|
+
annotations: {
|
|
243
|
+
title: 'Get Global Metrics',
|
|
244
|
+
readOnlyHint: true,
|
|
245
|
+
destructiveHint: false,
|
|
246
|
+
idempotentHint: true,
|
|
247
|
+
openWorldHint: true,
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: 'compare-crypto',
|
|
252
|
+
description: 'Compare 2-5 cryptocurrencies side-by-side including price, 24h change, volume, market cap, and rank. Pass symbols as a comma-separated list (e.g. "BTC,ETH,SOL").',
|
|
253
|
+
inputSchema: {
|
|
254
|
+
type: 'object',
|
|
255
|
+
properties: {
|
|
256
|
+
symbols: {
|
|
257
|
+
type: 'string',
|
|
258
|
+
description: 'Comma-separated list of 2-5 cryptocurrency symbols or names to compare (e.g. "BTC,ETH,SOL")',
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
required: ['symbols'],
|
|
262
|
+
},
|
|
263
|
+
annotations: {
|
|
264
|
+
title: 'Compare Cryptocurrencies',
|
|
265
|
+
readOnlyHint: true,
|
|
266
|
+
destructiveHint: false,
|
|
267
|
+
idempotentHint: true,
|
|
268
|
+
openWorldHint: true,
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'get-candlestick-data',
|
|
273
|
+
description: 'Get OHLCV candlestick data for a cryptocurrency from a specific exchange. Useful for charting and technical analysis.',
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
properties: {
|
|
277
|
+
symbol: {
|
|
278
|
+
type: 'string',
|
|
279
|
+
description: 'Cryptocurrency symbol or name (e.g. BTC or Bitcoin)',
|
|
280
|
+
},
|
|
281
|
+
exchange: {
|
|
282
|
+
type: 'string',
|
|
283
|
+
default: 'poloniex',
|
|
284
|
+
description: 'Exchange ID (e.g. "poloniex", "bittrex", "kraken", "binance")',
|
|
285
|
+
},
|
|
286
|
+
quote: {
|
|
287
|
+
type: 'string',
|
|
288
|
+
default: 'usd',
|
|
289
|
+
description: 'Quote currency ID (e.g. "usd", "usdt", "btc")',
|
|
290
|
+
},
|
|
291
|
+
interval: {
|
|
292
|
+
type: 'string',
|
|
293
|
+
enum: ['m5', 'm15', 'm30', 'h1', 'h2', 'h6', 'h12', 'd1'],
|
|
294
|
+
default: 'h1',
|
|
295
|
+
description: 'Candle interval: m5=5min, m15=15min, m30=30min, h1=1hr, h2=2hr, h6=6hr, h12=12hr, d1=daily',
|
|
296
|
+
},
|
|
297
|
+
days: {
|
|
298
|
+
type: 'number',
|
|
299
|
+
minimum: 1,
|
|
300
|
+
maximum: 30,
|
|
301
|
+
default: 1,
|
|
302
|
+
description: 'Number of days of candlestick data to retrieve (1-30)',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
required: ['symbol'],
|
|
306
|
+
},
|
|
307
|
+
annotations: {
|
|
308
|
+
title: 'Get Candlestick Data',
|
|
309
|
+
readOnlyHint: true,
|
|
310
|
+
destructiveHint: false,
|
|
311
|
+
idempotentHint: true,
|
|
312
|
+
openWorldHint: true,
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: 'get-price-conversion',
|
|
317
|
+
description: 'Convert a cryptocurrency amount to any fiat currency (e.g. USD, EUR, JPY). Uses real-time exchange rates for accurate conversions.',
|
|
318
|
+
inputSchema: {
|
|
319
|
+
type: 'object',
|
|
320
|
+
properties: {
|
|
321
|
+
symbol: {
|
|
322
|
+
type: 'string',
|
|
323
|
+
description: 'Cryptocurrency symbol to convert from (e.g. BTC, ETH)',
|
|
324
|
+
},
|
|
325
|
+
amount: {
|
|
326
|
+
type: 'number',
|
|
327
|
+
minimum: 0,
|
|
328
|
+
exclusiveMinimum: 0,
|
|
329
|
+
default: 1,
|
|
330
|
+
description: 'Amount of the cryptocurrency to convert (default 1)',
|
|
331
|
+
},
|
|
332
|
+
currency: {
|
|
333
|
+
type: 'string',
|
|
334
|
+
default: 'usd',
|
|
335
|
+
description: 'Target currency code (e.g. "usd", "eur", "gbp", "jpy")',
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
required: ['symbol'],
|
|
339
|
+
},
|
|
340
|
+
annotations: {
|
|
341
|
+
title: 'Get Price Conversion',
|
|
342
|
+
readOnlyHint: true,
|
|
343
|
+
destructiveHint: false,
|
|
344
|
+
idempotentHint: true,
|
|
345
|
+
openWorldHint: true,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'get-asset-info',
|
|
350
|
+
description: 'Get detailed metadata for a cryptocurrency including ID, rank, supply, max supply, VWAP, market cap, and 24h volume.',
|
|
351
|
+
inputSchema: {
|
|
352
|
+
type: 'object',
|
|
353
|
+
properties: {
|
|
354
|
+
symbol: {
|
|
355
|
+
type: 'string',
|
|
356
|
+
description: 'Cryptocurrency symbol or name (e.g. BTC or Bitcoin)',
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
required: ['symbol'],
|
|
360
|
+
},
|
|
361
|
+
annotations: {
|
|
362
|
+
title: 'Get Asset Info',
|
|
363
|
+
readOnlyHint: true,
|
|
364
|
+
destructiveHint: false,
|
|
365
|
+
idempotentHint: true,
|
|
366
|
+
openWorldHint: true,
|
|
367
|
+
},
|
|
368
|
+
},
|
|
207
369
|
],
|
|
208
370
|
resources: [
|
|
209
371
|
{
|
|
@@ -212,12 +374,42 @@ const serverCard = {
|
|
|
212
374
|
description: 'Basic server information',
|
|
213
375
|
mimeType: 'application/json',
|
|
214
376
|
},
|
|
377
|
+
{
|
|
378
|
+
name: 'asset-info',
|
|
379
|
+
uri: 'asset://{symbol}',
|
|
380
|
+
description: 'Cryptocurrency asset information by symbol (e.g. asset://BTC)',
|
|
381
|
+
mimeType: 'application/json',
|
|
382
|
+
},
|
|
215
383
|
],
|
|
216
384
|
prompts: [
|
|
217
385
|
{
|
|
218
386
|
name: 'analyze-crypto',
|
|
219
387
|
description: 'Generate a comprehensive analysis of a cryptocurrency covering price, market, and historical trends',
|
|
220
388
|
},
|
|
389
|
+
{
|
|
390
|
+
name: 'compare-cryptocurrencies',
|
|
391
|
+
description: 'Compare 2-5 cryptocurrencies side-by-side covering price, market cap, volume, and 24h performance',
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: 'market-overview',
|
|
395
|
+
description: 'Get a comprehensive overview of the cryptocurrency market including global metrics, top assets, and top exchanges',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: 'crypto-conversion',
|
|
399
|
+
description: 'Convert a cryptocurrency amount to a fiat currency with real-time rates',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: 'exchange-analysis',
|
|
403
|
+
description: 'Analyze trading activity for a cryptocurrency across exchanges, including volume distribution and top markets',
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: 'technical-analysis',
|
|
407
|
+
description: 'Get a full technical analysis of a cryptocurrency including indicators, candlestick patterns, and historical trends',
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: 'crypto-screener',
|
|
411
|
+
description: 'Search for cryptocurrencies matching a query and screen the results for the best opportunities',
|
|
412
|
+
},
|
|
221
413
|
],
|
|
222
414
|
};
|
|
223
415
|
const httpServer = http.createServer(async (req, res) => {
|