mcp-crypto-price 3.0.3 → 3.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.
Binary file
@@ -80,7 +80,7 @@ describe('CoinCap Service', () => {
80
80
  quoteSymbol: 'USDT',
81
81
  priceUsd: '50000.00',
82
82
  volumeUsd24Hr: '5000000000',
83
- percentExchangeVolume: '25.00',
83
+ volumePercent: '25.00',
84
84
  }
85
85
  ]
86
86
  };
@@ -64,7 +64,7 @@ describe('Formatters', () => {
64
64
  quoteSymbol: 'USD',
65
65
  priceUsd: '50100.00',
66
66
  volumeUsd24Hr: '10000000000',
67
- percentExchangeVolume: '33.33'
67
+ volumePercent: '33.33'
68
68
  },
69
69
  {
70
70
  exchangeId: 'coinbase',
@@ -72,7 +72,7 @@ describe('Formatters', () => {
72
72
  quoteSymbol: 'USD',
73
73
  priceUsd: '50000.00',
74
74
  volumeUsd24Hr: '8000000000',
75
- percentExchangeVolume: '26.67'
75
+ volumePercent: '26.67'
76
76
  }
77
77
  ];
78
78
  const formatted = formatMarketAnalysis(asset, markets);
@@ -18,7 +18,7 @@ export function formatPriceInfo(asset) {
18
18
  `24h Change: ${change}%`,
19
19
  `24h Volume: $${volume}M`,
20
20
  `Market Cap: $${marketCap}B`,
21
- `Rank: #${asset.rank}`,
21
+ `Rank: ${asset.rank != null ? `#${asset.rank}` : 'N/A'}`,
22
22
  ].join('\n');
23
23
  }
24
24
  export function formatMarketAnalysis(asset, markets) {
@@ -45,7 +45,8 @@ export function formatTopAssets(assets) {
45
45
  const price = formatPrice(parseFloat(asset.priceUsd));
46
46
  const change = parseFloat(asset.changePercent24Hr || '0').toFixed(2);
47
47
  const marketCap = (parseFloat(asset.marketCapUsd || '0') / 1000000000).toFixed(2);
48
- return `#${asset.rank} ${asset.name} (${asset.symbol}): $${price} (24h: ${change}%, MCap: $${marketCap}B)`;
48
+ const rankStr = asset.rank != null ? `#${asset.rank} ` : '';
49
+ return `${rankStr}${asset.name} (${asset.symbol}): $${price} (24h: ${change}%, MCap: $${marketCap}B)`;
49
50
  });
50
51
  return ['Top Cryptocurrencies by Market Cap', '', ...lines].join('\n');
51
52
  }
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export const CryptoAssetSchema = z.object({
3
3
  id: z.string(),
4
- rank: z.string(),
4
+ rank: z.string().nullable(),
5
5
  symbol: z.string(),
6
6
  name: z.string(),
7
7
  priceUsd: z.string(),
@@ -18,7 +18,6 @@ export const AssetsResponseSchema = z.object({
18
18
  export const HistoryPointSchema = z.object({
19
19
  time: z.number(),
20
20
  priceUsd: z.string(),
21
- circulatingSupply: z.string().optional(),
22
21
  date: z.string(),
23
22
  });
24
23
  export const HistoricalDataSchema = z.object({
@@ -30,7 +29,7 @@ export const MarketSchema = z.object({
30
29
  quoteSymbol: z.string(),
31
30
  priceUsd: z.string(),
32
31
  volumeUsd24Hr: z.string(),
33
- percentExchangeVolume: z.string().nullable().optional(),
32
+ volumePercent: z.string().optional(),
34
33
  });
35
34
  export const MarketsResponseSchema = z.object({
36
35
  data: z.array(MarketSchema),
@@ -24,8 +24,8 @@ describe('handleGetHistoricalAnalysis', () => {
24
24
  mockSearchAsset.mockResolvedValueOnce(mockAsset);
25
25
  mockGetHistoricalData.mockResolvedValueOnce({
26
26
  data: [
27
- { time: 1609459200000, priceUsd: '45000.00', circulatingSupply: '18900000', date: '2021-01-01' },
28
- { time: 1609545600000, priceUsd: '47000.00', circulatingSupply: '18900000', date: '2021-01-02' },
27
+ { time: 1609459200000, priceUsd: '45000.00', date: '2021-01-01' },
28
+ { time: 1609545600000, priceUsd: '47000.00', date: '2021-01-02' },
29
29
  ],
30
30
  });
31
31
  const result = await handleGetHistoricalAnalysis({ symbol: 'BTC' });
@@ -26,7 +26,7 @@ describe('handleGetMarketAnalysis', () => {
26
26
  data: [{
27
27
  exchangeId: 'binance', baseSymbol: 'BTC', quoteSymbol: 'USDT',
28
28
  priceUsd: '50000.00', volumeUsd24Hr: '5000000000',
29
- percentExchangeVolume: '25.00',
29
+ volumePercent: '25.00',
30
30
  }],
31
31
  });
32
32
  const result = await handleGetMarketAnalysis({ symbol: 'BTC' });
@@ -3,7 +3,7 @@ import { searchAsset, getHistoricalData } from '../services/coincap.js';
3
3
  import { formatHistoricalAnalysis } from '../services/formatters.js';
4
4
  export const GetHistoricalAnalysisSchema = z.object({
5
5
  symbol: z.string().min(1).describe("Cryptocurrency symbol or name (e.g. BTC or Bitcoin)"),
6
- interval: z.enum(['m5', 'm15', 'm30', 'h1', 'h2', 'h6', 'h12', 'd1']).default('h1').describe("Data interval: m5=5min, m15=15min, m30=30min, h1=1hr, h2=2hr, h6=6hr, h12=12hr, d1=daily"),
6
+ interval: z.enum(['m1', 'm5', 'm15', 'm30', 'h1', 'h2', 'h6', 'h12', 'd1']).default('h1').describe("Data interval: m1=1min, m5=5min, m15=15min, m30=30min, h1=1hr, h2=2hr, h6=6hr, h12=12hr, d1=daily"),
7
7
  days: z.number().min(1).max(30).default(7).describe("Number of days of historical data to retrieve (1-30)"),
8
8
  });
9
9
  export async function handleGetHistoricalAnalysis(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-crypto-price",
3
- "version": "3.0.3",
3
+ "version": "3.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