mcp-crypto-price 5.0.3 → 5.0.4

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 CHANGED
@@ -234,9 +234,9 @@ Returns the latest technical indicators for any cryptocurrency:
234
234
 
235
235
  #### analysis-candlestick
236
236
 
237
- Retrieves OHLCV candlestick data from a specific exchange:
237
+ Retrieves OHLCV candlestick data for a cryptocurrency:
238
238
  - Open, high, low, close, and volume for each candle
239
- - Configurable exchange (e.g. `binance`), quote currency (e.g. `usd`), and interval (`5m`, `15m`, `1h`, `6h`, `1d`)
239
+ - Configurable interval (`5m`, `15m`, `30m`, `1h`, `2h`, `6h`, `12h`, `1d`)
240
240
  - Supports 1–30 days of historical candles
241
241
 
242
242
  ## Resources
@@ -273,7 +273,7 @@ The server exposes the following MCP prompts that clients can invoke:
273
273
  - "Search for cryptocurrencies matching 'sol'"
274
274
  - "Give me a global overview of the crypto market"
275
275
  - "Compare BTC, ETH, and SOL side by side"
276
- - "Show me 1-hour candlestick data for BTC on Binance over the last 3 days"
276
+ - "Show me 1-hour candlestick data for BTC over the last 3 days"
277
277
  - "Convert 2.5 BTC to EUR"
278
278
  - "Get detailed info about the Ethereum asset"
279
279
  - "Generate a comprehensive analysis of a cryptocurrency covering price, market, and historical trends"
@@ -284,7 +284,7 @@ The server exposes the following MCP prompts that clients can invoke:
284
284
  - "Convert 100 SOL to GBP and show the exchange rate"
285
285
  - "Give me a full market snapshot: global metrics, top gainers, and BTC dominance"
286
286
  - "What are the best and worst performing cryptos in the last 24 hours?"
287
- - "Show me 15-minute candlestick data for ETH on Coinbase over the last 2 days"
287
+ - "Show me 15-minute candlestick data for ETH over the last 2 days"
288
288
  - "Compare DeFi tokens: UNI, AAVE, COMP, and MKR"
289
289
  - "What's the VWAP and max supply of Bitcoin?"
290
290
  - "Search for layer-2 tokens and compare the top results"
package/dist/http.js CHANGED
@@ -590,14 +590,13 @@ const serverCard = {
590
590
  items: {
591
591
  type: 'object',
592
592
  properties: {
593
- open: { type: 'string' },
594
- high: { type: 'string' },
595
- low: { type: 'string' },
596
- close: { type: 'string' },
597
- volume: { type: 'string' },
598
- period: { type: 'number' },
593
+ open: { type: 'number' },
594
+ high: { type: 'number' },
595
+ low: { type: 'number' },
596
+ close: { type: 'number' },
597
+ time: { type: 'number' },
599
598
  },
600
- required: ['open', 'high', 'low', 'close', 'volume', 'period'],
599
+ required: ['open', 'high', 'low', 'close', 'time'],
601
600
  },
602
601
  },
603
602
  },
Binary file
@@ -256,13 +256,12 @@ export function formatCandlestickData(asset, candles) {
256
256
  return `No candlestick data available for ${asset.name} (${asset.symbol}).`;
257
257
  }
258
258
  const lines = candles.map((c) => {
259
- const date = new Date(c.period).toISOString().split('T')[0];
260
- const open = formatPrice(parseFloat(c.open));
261
- const high = formatPrice(parseFloat(c.high));
262
- const low = formatPrice(parseFloat(c.low));
263
- const close = formatPrice(parseFloat(c.close));
264
- const volume = (parseFloat(c.volume) / 1_000_000).toFixed(2);
265
- return `${date} | O: $${open} | H: $${high} | L: $${low} | C: $${close} | Vol: ${volume}M`;
259
+ const date = new Date(c.time).toISOString().split('T')[0];
260
+ const open = formatPrice(c.open);
261
+ const high = formatPrice(c.high);
262
+ const low = formatPrice(c.low);
263
+ const close = formatPrice(c.close);
264
+ return `${date} | O: $${open} | H: $${high} | L: $${low} | C: $${close}`;
266
265
  });
267
266
  return [
268
267
  `Candlestick Data for ${asset.name} (${asset.symbol})`,
@@ -101,13 +101,13 @@ export const ExchangeResponseSchema = z.object({
101
101
  data: ExchangeSchema,
102
102
  });
103
103
  export const CandleSchema = z.object({
104
- open: z.string(),
105
- high: z.string(),
106
- low: z.string(),
107
- close: z.string(),
108
- volume: z.string(),
109
- period: z.number(),
104
+ open: z.number(),
105
+ high: z.number(),
106
+ low: z.number(),
107
+ close: z.number(),
108
+ time: z.number(),
110
109
  });
111
110
  export const CandlesResponseSchema = z.object({
112
- data: z.array(CandleSchema),
111
+ candles: z.array(CandleSchema),
112
+ timestamp: z.number(),
113
113
  });
@@ -21,12 +21,11 @@ export const CandlestickOutputSchema = z.object({
21
21
  name: z.string(),
22
22
  symbol: z.string(),
23
23
  candles: z.array(z.object({
24
- open: z.string(),
25
- high: z.string(),
26
- low: z.string(),
27
- close: z.string(),
28
- volume: z.string(),
29
- period: z.number(),
24
+ open: z.number(),
25
+ high: z.number(),
26
+ low: z.number(),
27
+ close: z.number(),
28
+ time: z.number(),
30
29
  })),
31
30
  });
32
31
  export async function handleGetCandlestickData(args) {
@@ -68,7 +67,7 @@ export async function handleGetCandlestickData(args) {
68
67
  },
69
68
  };
70
69
  }
71
- if (!candlesData.data.length) {
70
+ if (!candlesData.candles.length) {
72
71
  return {
73
72
  content: [
74
73
  {
@@ -87,19 +86,18 @@ export async function handleGetCandlestickData(args) {
87
86
  content: [
88
87
  {
89
88
  type: 'text',
90
- text: formatCandlestickData(asset, candlesData.data),
89
+ text: formatCandlestickData(asset, candlesData.candles),
91
90
  },
92
91
  ],
93
92
  structuredContent: {
94
93
  name: asset.name,
95
94
  symbol: asset.symbol,
96
- candles: candlesData.data.map((c) => ({
95
+ candles: candlesData.candles.map((c) => ({
97
96
  open: c.open,
98
97
  high: c.high,
99
98
  low: c.low,
100
99
  close: c.close,
101
- volume: c.volume,
102
- period: c.period,
100
+ time: c.time,
103
101
  })),
104
102
  },
105
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-crypto-price",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "A Model Context Protocol (MCP) server that provides real-time cryptocurrency data and analysis through CoinCap's API. Features include price tracking, market analysis, and historical trends.",
5
5
  "license": "MIT",
6
6
  "author": {
Binary file