mcp-crypto-price 3.2.0 → 3.3.1
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 +1 -1
- package/dist/homepage.js +351 -0
- package/dist/http.js +9 -2
- package/dist/mcp-crypto-price-3.3.1.tgz +0 -0
- package/package.json +1 -1
- package/dist/mcp-crypto-price-3.2.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ http://localhost:3000/mcp?COINCAP_API_KEY=YOUR_API_KEY_HERE
|
|
|
90
90
|
For remote deployments:
|
|
91
91
|
|
|
92
92
|
```
|
|
93
|
-
https://
|
|
93
|
+
https://mcp-crypto-price.codemonkeyinnovations.com/mcp?COINCAP_API_KEY=YOUR_API_KEY_HERE
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
## Required: CoinCap API Key
|
package/dist/homepage.js
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { SERVER_CONFIG } from './config/index.js';
|
|
5
|
+
function getLogoDataUrl() {
|
|
6
|
+
try {
|
|
7
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const logoPath = resolve(moduleDir, '../logo.png');
|
|
9
|
+
const logoBuffer = readFileSync(logoPath);
|
|
10
|
+
return `data:image/png;base64,${logoBuffer.toString('base64')}`;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return 'https://raw.githubusercontent.com/truss44/mcp-crypto-price/main/logo.png';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function renderHomepage() {
|
|
17
|
+
const logoUrl = getLogoDataUrl();
|
|
18
|
+
const githubUrl = 'https://github.com/truss44/mcp-crypto-price';
|
|
19
|
+
const smitheryUrl = 'https://smithery.ai/servers/truss44/mcp-crypto-price';
|
|
20
|
+
const coincapDocsUrl = 'https://pro.coincap.io/api-docs';
|
|
21
|
+
const coincapMethodologyUrl = 'https://www.coincap.io/methodology';
|
|
22
|
+
return `<!doctype html>
|
|
23
|
+
<html lang="en">
|
|
24
|
+
<head>
|
|
25
|
+
<meta charset="utf-8" />
|
|
26
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
27
|
+
<meta name="description" content="${SERVER_CONFIG.name} is an MCP server for real-time cryptocurrency prices, market analysis, and historical trends powered by CoinCap." />
|
|
28
|
+
<title>${SERVER_CONFIG.name} | Crypto Market MCP Tool</title>
|
|
29
|
+
<style>
|
|
30
|
+
:root {
|
|
31
|
+
color-scheme: dark;
|
|
32
|
+
--bg: #07111f;
|
|
33
|
+
--bg-2: #0b1730;
|
|
34
|
+
--card: rgba(13, 22, 42, 0.82);
|
|
35
|
+
--card-border: rgba(123, 234, 225, 0.16);
|
|
36
|
+
--text: #e5eefc;
|
|
37
|
+
--muted: #9fb0cf;
|
|
38
|
+
--accent: #63f3e5;
|
|
39
|
+
--accent-2: #70a8ff;
|
|
40
|
+
--shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
* { box-sizing: border-box; }
|
|
44
|
+
body {
|
|
45
|
+
margin: 0;
|
|
46
|
+
min-height: 100vh;
|
|
47
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
48
|
+
color: var(--text);
|
|
49
|
+
background:
|
|
50
|
+
radial-gradient(circle at top, rgba(99, 243, 229, 0.15), transparent 28%),
|
|
51
|
+
radial-gradient(circle at 85% 20%, rgba(112, 168, 255, 0.14), transparent 22%),
|
|
52
|
+
linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
a { color: inherit; }
|
|
56
|
+
.wrap {
|
|
57
|
+
width: min(1120px, calc(100% - 32px));
|
|
58
|
+
margin: 0 auto;
|
|
59
|
+
padding: 32px 0 56px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.hero {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
|
|
65
|
+
gap: 24px;
|
|
66
|
+
align-items: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.badge {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 10px;
|
|
73
|
+
padding: 10px 14px;
|
|
74
|
+
border: 1px solid var(--card-border);
|
|
75
|
+
border-radius: 999px;
|
|
76
|
+
background: rgba(255,255,255,0.03);
|
|
77
|
+
color: var(--muted);
|
|
78
|
+
letter-spacing: 0.02em;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.badge-dot {
|
|
82
|
+
width: 10px;
|
|
83
|
+
height: 10px;
|
|
84
|
+
border-radius: 999px;
|
|
85
|
+
background: linear-gradient(135deg, var(--accent), var(--accent-2));
|
|
86
|
+
box-shadow: 0 0 24px rgba(99, 243, 229, 0.7);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
h1 {
|
|
90
|
+
margin: 18px 0 12px;
|
|
91
|
+
font-size: clamp(2.4rem, 5vw, 4.8rem);
|
|
92
|
+
line-height: 0.96;
|
|
93
|
+
letter-spacing: -0.05em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.lede {
|
|
97
|
+
margin: 0;
|
|
98
|
+
max-width: 60ch;
|
|
99
|
+
color: var(--muted);
|
|
100
|
+
font-size: 1.05rem;
|
|
101
|
+
line-height: 1.7;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.actions {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
gap: 12px;
|
|
108
|
+
margin-top: 24px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.button {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
gap: 10px;
|
|
116
|
+
padding: 14px 18px;
|
|
117
|
+
border-radius: 16px;
|
|
118
|
+
text-decoration: none;
|
|
119
|
+
font-weight: 700;
|
|
120
|
+
border: 1px solid transparent;
|
|
121
|
+
transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.button:hover { transform: translateY(-1px); }
|
|
125
|
+
.button.primary {
|
|
126
|
+
background: linear-gradient(135deg, rgba(99,243,229,0.95), rgba(112,168,255,0.95));
|
|
127
|
+
color: #05111c;
|
|
128
|
+
}
|
|
129
|
+
.button.secondary {
|
|
130
|
+
background: rgba(255,255,255,0.03);
|
|
131
|
+
border-color: var(--card-border);
|
|
132
|
+
color: var(--text);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.hero-card,
|
|
136
|
+
.panel {
|
|
137
|
+
background: var(--card);
|
|
138
|
+
backdrop-filter: blur(18px);
|
|
139
|
+
border: 1px solid var(--card-border);
|
|
140
|
+
border-radius: 28px;
|
|
141
|
+
box-shadow: var(--shadow);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.hero-card {
|
|
145
|
+
padding: 22px;
|
|
146
|
+
text-align: center;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.logo {
|
|
150
|
+
width: min(100%, 280px);
|
|
151
|
+
aspect-ratio: 1;
|
|
152
|
+
object-fit: cover;
|
|
153
|
+
border-radius: 28px;
|
|
154
|
+
display: block;
|
|
155
|
+
margin: 0 auto;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.logo-caption {
|
|
159
|
+
margin-top: 16px;
|
|
160
|
+
color: var(--muted);
|
|
161
|
+
font-size: 0.94rem;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.grid {
|
|
165
|
+
margin-top: 26px;
|
|
166
|
+
display: grid;
|
|
167
|
+
grid-template-columns: repeat(12, 1fr);
|
|
168
|
+
gap: 18px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.panel {
|
|
172
|
+
padding: 22px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.span-7 { grid-column: span 7; }
|
|
176
|
+
.span-5 { grid-column: span 5; }
|
|
177
|
+
.span-4 { grid-column: span 4; }
|
|
178
|
+
.span-6 { grid-column: span 6; }
|
|
179
|
+
|
|
180
|
+
.section-title {
|
|
181
|
+
margin: 0 0 12px;
|
|
182
|
+
font-size: 1.1rem;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.list {
|
|
186
|
+
margin: 0;
|
|
187
|
+
padding-left: 18px;
|
|
188
|
+
color: var(--muted);
|
|
189
|
+
line-height: 1.7;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.metrics {
|
|
193
|
+
display: grid;
|
|
194
|
+
gap: 12px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.metric {
|
|
198
|
+
padding: 14px 16px;
|
|
199
|
+
border-radius: 18px;
|
|
200
|
+
background: rgba(255,255,255,0.03);
|
|
201
|
+
border: 1px solid rgba(255,255,255,0.05);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.metric strong {
|
|
205
|
+
display: block;
|
|
206
|
+
margin-bottom: 4px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.links {
|
|
210
|
+
display: grid;
|
|
211
|
+
gap: 10px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.link-card {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: space-between;
|
|
218
|
+
gap: 14px;
|
|
219
|
+
padding: 14px 16px;
|
|
220
|
+
border-radius: 18px;
|
|
221
|
+
text-decoration: none;
|
|
222
|
+
background: rgba(255,255,255,0.03);
|
|
223
|
+
border: 1px solid rgba(255,255,255,0.05);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.link-card span { color: var(--muted); }
|
|
227
|
+
|
|
228
|
+
.footer {
|
|
229
|
+
margin-top: 24px;
|
|
230
|
+
padding: 20px 4px 0;
|
|
231
|
+
color: var(--muted);
|
|
232
|
+
font-size: 0.93rem;
|
|
233
|
+
text-align: center;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
code {
|
|
237
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
238
|
+
background: rgba(255,255,255,0.08);
|
|
239
|
+
padding: 0.18rem 0.38rem;
|
|
240
|
+
border-radius: 8px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (max-width: 920px) {
|
|
244
|
+
.hero { grid-template-columns: 1fr; }
|
|
245
|
+
.span-7, .span-5, .span-4, .span-6 { grid-column: span 12; }
|
|
246
|
+
}
|
|
247
|
+
</style>
|
|
248
|
+
</head>
|
|
249
|
+
<body>
|
|
250
|
+
<main class="wrap">
|
|
251
|
+
<section class="hero">
|
|
252
|
+
<div>
|
|
253
|
+
<div class="badge"><span class="badge-dot"></span><span>MCP cryptocurrency intelligence</span></div>
|
|
254
|
+
<h1>Real-time crypto pricing, market analysis, and historical trend insights.</h1>
|
|
255
|
+
<p class="lede">
|
|
256
|
+
<strong>${SERVER_CONFIG.name}</strong> is a Model Context Protocol tool for exploring cryptocurrency data
|
|
257
|
+
through CoinCap. It delivers current price data, market depth analysis, historical trend summaries,
|
|
258
|
+
and top-asset rankings through a clean MCP interface.
|
|
259
|
+
</p>
|
|
260
|
+
<div class="actions">
|
|
261
|
+
<a class="button primary" href="${smitheryUrl}">Install on Smithery</a>
|
|
262
|
+
<a class="button secondary" href="${githubUrl}">View on GitHub</a>
|
|
263
|
+
<a class="button secondary" href="${coincapDocsUrl}">CoinCap API Docs</a>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
<aside class="hero-card">
|
|
267
|
+
<img class="logo" src="${logoUrl}" alt="${SERVER_CONFIG.name} logo" />
|
|
268
|
+
<div class="logo-caption">Real-time crypto intelligence, delivered through MCP.</div>
|
|
269
|
+
</aside>
|
|
270
|
+
</section>
|
|
271
|
+
|
|
272
|
+
<section class="grid" aria-label="Feature overview">
|
|
273
|
+
<article class="panel span-7">
|
|
274
|
+
<h2 class="section-title">What this MCP tool does</h2>
|
|
275
|
+
<ul class="list">
|
|
276
|
+
<li><strong>Get live crypto prices</strong> with 24-hour change, market cap, and trading volume.</li>
|
|
277
|
+
<li><strong>Analyze market structure</strong> across exchanges to understand liquidity and distribution.</li>
|
|
278
|
+
<li><strong>Review historical movement</strong> with configurable intervals and lookback windows.</li>
|
|
279
|
+
<li><strong>Inspect top assets</strong> ranked by market cap and activity.</li>
|
|
280
|
+
<li><strong>Use it from MCP clients</strong> like Claude, Cursor, or other compatible hosts.</li>
|
|
281
|
+
</ul>
|
|
282
|
+
</article>
|
|
283
|
+
|
|
284
|
+
<article class="panel span-5">
|
|
285
|
+
<h2 class="section-title">Install and connect</h2>
|
|
286
|
+
<div class="metrics">
|
|
287
|
+
<div class="metric">
|
|
288
|
+
<strong>Smithery</strong>
|
|
289
|
+
Install or connect via the server listing: <code>smithery.ai/servers/truss44/mcp-crypto-price</code>
|
|
290
|
+
</div>
|
|
291
|
+
<div class="metric">
|
|
292
|
+
<strong>CLI example</strong>
|
|
293
|
+
<code>npx @smithery/cli install mcp-crypto-price --client claude</code>
|
|
294
|
+
</div>
|
|
295
|
+
<div class="metric">
|
|
296
|
+
<strong>Remote endpoint</strong>
|
|
297
|
+
<code>https://mcp-crypto-price.codemonkeyinnovations.com/mcp</code>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
</article>
|
|
301
|
+
|
|
302
|
+
<article class="panel span-6">
|
|
303
|
+
<h2 class="section-title">Why CoinCap</h2>
|
|
304
|
+
<ul class="list">
|
|
305
|
+
<li>CoinCap provides real-time cryptocurrency market data and exchange information.</li>
|
|
306
|
+
<li>The methodology emphasizes a global view of trading across exchanges.</li>
|
|
307
|
+
<li>Pricing uses exchange volume weighting and outlier detection to reduce noisy data.</li>
|
|
308
|
+
<li>CoinCap rank considers daily trading volume, availability, and market cap.</li>
|
|
309
|
+
</ul>
|
|
310
|
+
<p class="lede" style="margin-top: 14px; font-size: 0.98rem;">
|
|
311
|
+
Learn more at the <a href="${coincapMethodologyUrl}">CoinCap methodology page</a> and the
|
|
312
|
+
<a href="${coincapDocsUrl}">CoinCap API documentation</a>.
|
|
313
|
+
</p>
|
|
314
|
+
</article>
|
|
315
|
+
|
|
316
|
+
<article class="panel span-6">
|
|
317
|
+
<h2 class="section-title">Project links</h2>
|
|
318
|
+
<div class="links">
|
|
319
|
+
<a class="link-card" href="${githubUrl}">
|
|
320
|
+
<div>
|
|
321
|
+
<strong>GitHub repository</strong><br />
|
|
322
|
+
<span>Source, issues, and release history</span>
|
|
323
|
+
</div>
|
|
324
|
+
<span>↗</span>
|
|
325
|
+
</a>
|
|
326
|
+
<a class="link-card" href="${smitheryUrl}">
|
|
327
|
+
<div>
|
|
328
|
+
<strong>Smithery server page</strong><br />
|
|
329
|
+
<span>Install and discover this MCP server</span>
|
|
330
|
+
</div>
|
|
331
|
+
<span>↗</span>
|
|
332
|
+
</a>
|
|
333
|
+
<a class="link-card" href="${coincapDocsUrl}">
|
|
334
|
+
<div>
|
|
335
|
+
<strong>CoinCap API docs</strong><br />
|
|
336
|
+
<span>Reference for assets, markets, and API access</span>
|
|
337
|
+
</div>
|
|
338
|
+
<span>↗</span>
|
|
339
|
+
</a>
|
|
340
|
+
</div>
|
|
341
|
+
</article>
|
|
342
|
+
</section>
|
|
343
|
+
|
|
344
|
+
<div class="footer">
|
|
345
|
+
Built for MCP clients and crypto researchers who want a fast, structured view of market data.<br />
|
|
346
|
+
Created by Tracey Russell.
|
|
347
|
+
</div>
|
|
348
|
+
</main>
|
|
349
|
+
</body>
|
|
350
|
+
</html>`;
|
|
351
|
+
}
|
package/dist/http.js
CHANGED
|
@@ -3,6 +3,7 @@ import http from 'node:http';
|
|
|
3
3
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
4
4
|
import { createServer } from './index.js';
|
|
5
5
|
import { SERVER_CONFIG } from './config/index.js';
|
|
6
|
+
import { renderHomepage } from './homepage.js';
|
|
6
7
|
const PORT = parseInt(process.env.PORT ?? '3000', 10);
|
|
7
8
|
async function handleMcp(req, res, searchParams) {
|
|
8
9
|
const coincapApiKey = searchParams.get('COINCAP_API_KEY') ?? process.env.COINCAP_API_KEY;
|
|
@@ -142,8 +143,14 @@ const httpServer = http.createServer(async (req, res) => {
|
|
|
142
143
|
res.end(JSON.stringify(serverCard));
|
|
143
144
|
return;
|
|
144
145
|
}
|
|
145
|
-
//
|
|
146
|
-
if (
|
|
146
|
+
// Homepage: GET /
|
|
147
|
+
if (pathname === '/' && req.method === 'GET') {
|
|
148
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
149
|
+
res.end(renderHomepage());
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
// Health check: GET /health
|
|
153
|
+
if (pathname === '/health' && req.method === 'GET') {
|
|
147
154
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
148
155
|
res.end(JSON.stringify({ status: 'ok' }));
|
|
149
156
|
return;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-crypto-price",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
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
|