cryptoiz-mcp 4.6.0 โ 4.8.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/package.json +15 -4
- package/src/index.js +47 -16
package/package.json
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cryptoiz-mcp",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "CryptoIZ MCP Server
|
|
3
|
+
"version": "4.8.0",
|
|
4
|
+
"description": "CryptoIZ MCP Server \u2014 Solana DEX signals with x402 micropayments. Pay $0.01 USDC per call.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"cryptoiz-mcp": "src/index.js"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"cryptoiz",
|
|
12
|
+
"solana",
|
|
13
|
+
"defi",
|
|
14
|
+
"mcp",
|
|
15
|
+
"claude",
|
|
16
|
+
"crypto",
|
|
17
|
+
"alpha",
|
|
18
|
+
"signals",
|
|
19
|
+
"x402",
|
|
20
|
+
"usdc"
|
|
21
|
+
],
|
|
11
22
|
"author": "CryptoIZ <cryptoiz.suport@gmail.com> (https://cryptoiz.org)",
|
|
12
23
|
"license": "MIT",
|
|
13
24
|
"repository": {
|
|
@@ -24,4 +35,4 @@
|
|
|
24
35
|
"engines": {
|
|
25
36
|
"node": ">=18.0.0"
|
|
26
37
|
}
|
|
27
|
-
}
|
|
38
|
+
}
|
package/src/index.js
CHANGED
|
@@ -28,7 +28,15 @@ const PRICE_LABELS = {
|
|
|
28
28
|
async function payAndFetch(url, tool = 'get_alpha_scanner') {
|
|
29
29
|
const AMOUNT = PRICES[tool] || 10000;
|
|
30
30
|
if (!SVM_PRIVATE_KEY) return { error: 'SVM_PRIVATE_KEY not set.' };
|
|
31
|
-
|
|
31
|
+
// Timeout: 20s for initial check, 30s for paid request
|
|
32
|
+
const fetchWithTimeout = (u, opts = {}, ms = 20000) => {
|
|
33
|
+
const ctrl = new AbortController();
|
|
34
|
+
const t = setTimeout(() => ctrl.abort(), ms);
|
|
35
|
+
return fetch(u, { ...opts, signal: ctrl.signal }).finally(() => clearTimeout(t));
|
|
36
|
+
};
|
|
37
|
+
let first;
|
|
38
|
+
try { first = await fetchWithTimeout(url, {}, 20000); }
|
|
39
|
+
catch (e) { return { error: `Gateway timeout or unreachable: ${e.message}` }; }
|
|
32
40
|
if (first.status !== 402) return first.json();
|
|
33
41
|
try {
|
|
34
42
|
const keypair = Keypair.fromSecretKey(bs58.decode(SVM_PRIVATE_KEY));
|
|
@@ -39,7 +47,7 @@ async function payAndFetch(url, tool = 'get_alpha_scanner') {
|
|
|
39
47
|
const sig = await connection.sendTransaction(tx, [keypair]);
|
|
40
48
|
await connection.confirmTransaction(sig, 'confirmed');
|
|
41
49
|
const payment = Buffer.from(JSON.stringify({ signature: sig, network: 'solana', x402Version: 1 })).toString('base64');
|
|
42
|
-
const paid = await
|
|
50
|
+
const paid = await fetchWithTimeout(url, { headers: { 'x-payment': payment } }, 30000);
|
|
43
51
|
return paid.json();
|
|
44
52
|
} catch (err) {
|
|
45
53
|
return { error: `Payment failed: ${err.message}` };
|
|
@@ -56,7 +64,12 @@ const dexLink = ca => ca ? `[Chart ๐](https://dexscreener.com/solana/${ca})`
|
|
|
56
64
|
// ALPHA SCANNER โ Markdown Table Format
|
|
57
65
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
58
66
|
function formatAlpha(data) {
|
|
59
|
-
if (data.error) return `โ **Error:** ${data.error}\n\nSetup: https://cryptoiz.org`;
|
|
67
|
+
if (data.error) return `โ **Error:** ${data.error}\n\nSetup: https://cryptoiz.org/McpLanding`;
|
|
68
|
+
|
|
69
|
+
// Show signal quality warnings at top
|
|
70
|
+
let warnings = '';
|
|
71
|
+
if (data.signal_quality) warnings += `\n${data.signal_quality}\n`;
|
|
72
|
+
if (data.data_freshness) warnings += `\n${data.data_freshness}\n`;
|
|
60
73
|
const signals = data.signals || [];
|
|
61
74
|
const date = data.fetched_at?.split('T')[0];
|
|
62
75
|
|
|
@@ -340,20 +353,29 @@ async function getTokenCA(tokenName, data) {
|
|
|
340
353
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
341
354
|
function formatStatus() {
|
|
342
355
|
const walletReady = !!SVM_PRIVATE_KEY;
|
|
356
|
+
const securityWarning = [
|
|
357
|
+
``,
|
|
358
|
+
`> ๐ **SECURITY WARNING**`,
|
|
359
|
+
`> Use a **dedicated wallet** with max $5 USDC + 0.01 SOL.`,
|
|
360
|
+
`> **NEVER** use your main wallet. **NEVER** share your config file.`,
|
|
361
|
+
`> If compromised โ create a new wallet immediately.`,
|
|
362
|
+
``,
|
|
363
|
+
].join('\n');
|
|
364
|
+
|
|
343
365
|
return [
|
|
344
|
-
`## โก CryptoIZ MCP Server v4.
|
|
366
|
+
`## โก CryptoIZ MCP Server v4.7.0`,
|
|
345
367
|
`**AI-Powered Solana DEX Smart Money Signals โ Pay Per Call via Solana USDC**`,
|
|
346
368
|
``,
|
|
347
369
|
`> Detect whale accumulation, divergence signals, and BTC macro regime directly in Claude Desktop.`,
|
|
348
370
|
`> No subscription needed โ pay only when you call.`,
|
|
349
|
-
|
|
371
|
+
securityWarning,
|
|
350
372
|
`---`,
|
|
351
373
|
``,
|
|
352
374
|
`### ๐ Connection Status`,
|
|
353
375
|
``,
|
|
354
376
|
`| | |`,
|
|
355
377
|
`|-|-|`,
|
|
356
|
-
`| Server | โ
Connected |`,
|
|
378
|
+
`| Server | โ
Connected โ v4.7.0 |`,
|
|
357
379
|
`| Wallet | ${walletReady ? 'โ
Ready โ USDC payments enabled' : 'โ Not configured โ add SVM_PRIVATE_KEY to Claude Desktop config'} |`,
|
|
358
380
|
`| Network | Solana Mainnet ยท USDC payments |`,
|
|
359
381
|
`| Platform | https://cryptoiz.org |`,
|
|
@@ -364,11 +386,11 @@ function formatStatus() {
|
|
|
364
386
|
``,
|
|
365
387
|
`| Tool | What You Get | Cost |`,
|
|
366
388
|
`|------|-------------|------|`,
|
|
367
|
-
`| \`get_alpha_scanner\` | Top
|
|
389
|
+
`| \`get_alpha_scanner\` | Top signals (ALPHA_EARLY + BUILDING + WATCHLIST). Score, phase, whale/dolphin delta, MC now vs signal MC, risk flags, CA + chart + Jupiter buy link | **$0.05 USDC** |`,
|
|
368
390
|
`| \`get_divergence\` | 3 divergence types (Hidden/Breakout/Classic). Score, confidence, whale holders now vs prev, dolphin delta, MC, CA + chart | **$0.02 USDC** |`,
|
|
369
|
-
`| \`get_accumulation\` | 4-dimension accumulation score (Structure/AccDist/Holder/Market). Top 20 tokens
|
|
370
|
-
`| \`get_btc_regime\` | BTC macro: regime (Bull/Bear/Neutral), Fear & Greed, OI regime, funding rate, RSI/EMA/MACD (1H)
|
|
371
|
-
`| \`get_token_ca\` |
|
|
391
|
+
`| \`get_accumulation\` | 4-dimension accumulation score (Structure/AccDist/Holder/Market). Top 20 tokens with CA + chart | **$0.02 USDC** |`,
|
|
392
|
+
`| \`get_btc_regime\` | BTC macro: regime (Bull/Bear/Neutral), Fear & Greed, OI regime, funding rate, RSI/EMA/MACD (1H) | **$0.01 USDC** |`,
|
|
393
|
+
`| \`get_token_ca\` | Contract address lookup + DexScreener + Jupiter. Protects against scam tokens with same name | **FREE** |`,
|
|
372
394
|
`| \`get_status\` | This status page | **FREE** |`,
|
|
373
395
|
``,
|
|
374
396
|
`---`,
|
|
@@ -376,12 +398,12 @@ function formatStatus() {
|
|
|
376
398
|
`### ๐ก Quick Start`,
|
|
377
399
|
``,
|
|
378
400
|
`\`\`\``,
|
|
379
|
-
`get_status โ you are here`,
|
|
401
|
+
`get_status โ you are here (free)`,
|
|
402
|
+
`get token ca [name] โ verify any token CA (free)`,
|
|
380
403
|
`get btc regime โ check macro first ($0.01)`,
|
|
381
404
|
`get alpha scanner โ find best entry signals ($0.05)`,
|
|
382
405
|
`get divergence scanner โ find reversal signals ($0.02)`,
|
|
383
406
|
`get accumulation dashboard โ find tokens in accumulation ($0.02)`,
|
|
384
|
-
`get token ca [name] โ verify any token CA (free)`,
|
|
385
407
|
`\`\`\``,
|
|
386
408
|
``,
|
|
387
409
|
`---`,
|
|
@@ -395,7 +417,7 @@ function formatStatus() {
|
|
|
395
417
|
`| 3 Months | **$120** | Serious investors |`,
|
|
396
418
|
`| 1 Year | **$400** | Best value |`,
|
|
397
419
|
``,
|
|
398
|
-
`Full platform
|
|
420
|
+
`Full platform: visual charts, real-time alerts, Phase Leaderboard, Episode Feed, VIP Telegram.`,
|
|
399
421
|
``,
|
|
400
422
|
`๐ **Subscribe:** https://cryptoiz.org/Pricing`,
|
|
401
423
|
`๐ **Setup Guide:** https://cryptoiz.org/McpLanding`,
|
|
@@ -419,7 +441,7 @@ const TOOLS = [
|
|
|
419
441
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
420
442
|
// SERVER
|
|
421
443
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
422
|
-
const server = new Server({ name: 'cryptoiz-mcp', version: '4.
|
|
444
|
+
const server = new Server({ name: 'cryptoiz-mcp', version: '4.7.0' }, { capabilities: { tools: {} } });
|
|
423
445
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
424
446
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
425
447
|
const { name, arguments: args } = request.params;
|
|
@@ -459,8 +481,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
459
481
|
if (name === 'get_token_ca') {
|
|
460
482
|
const tokenName = args?.token_name || '';
|
|
461
483
|
if (!tokenName) return { content: [{ type: 'text', text: 'โ Please provide a token_name. Example: "Aliens"' }], isError: true };
|
|
462
|
-
|
|
463
|
-
|
|
484
|
+
// FREE tool โ fetch without payment using free-ca endpoint
|
|
485
|
+
try {
|
|
486
|
+
const controller = new AbortController();
|
|
487
|
+
const timeout = setTimeout(() => controller.abort(), 15000);
|
|
488
|
+
const res = await fetch(`${GATEWAY_URL}?tool=get_token_ca&name=${encodeURIComponent(tokenName)}`, { signal: controller.signal });
|
|
489
|
+
clearTimeout(timeout);
|
|
490
|
+
const data = await res.json();
|
|
491
|
+
return { content: [{ type: 'text', text: await getTokenCA(tokenName, data) }] };
|
|
492
|
+
} catch (err) {
|
|
493
|
+
return { content: [{ type: 'text', text: `โ CA lookup failed: ${err.message}` }], isError: true };
|
|
494
|
+
}
|
|
464
495
|
}
|
|
465
496
|
|
|
466
497
|
return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
|