cryptoiz-mcp 4.5.0 → 4.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/package.json +1 -1
- package/src/index.js +75 -30
package/package.json
CHANGED
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}` };
|
|
@@ -339,40 +347,68 @@ async function getTokenCA(tokenName, data) {
|
|
|
339
347
|
// STATUS
|
|
340
348
|
// ══════════════════════════════════════════════════════════════════
|
|
341
349
|
function formatStatus() {
|
|
350
|
+
const walletReady = !!SVM_PRIVATE_KEY;
|
|
342
351
|
return [
|
|
343
|
-
`##
|
|
352
|
+
`## ⚡ CryptoIZ MCP Server v4.5.0`,
|
|
353
|
+
`**AI-Powered Solana DEX Smart Money Signals — Pay Per Call via Solana USDC**`,
|
|
344
354
|
``,
|
|
345
|
-
|
|
355
|
+
`> Detect whale accumulation, divergence signals, and BTC macro regime directly in Claude Desktop.`,
|
|
356
|
+
`> No subscription needed — pay only when you call.`,
|
|
346
357
|
``,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
358
|
+
`---`,
|
|
359
|
+
``,
|
|
360
|
+
`### 🔌 Connection Status`,
|
|
361
|
+
``,
|
|
362
|
+
`| | |`,
|
|
363
|
+
`|-|-|`,
|
|
364
|
+
`| Server | ✅ Connected |`,
|
|
365
|
+
`| Wallet | ${walletReady ? '✅ Ready — USDC payments enabled' : '❌ Not configured — add SVM_PRIVATE_KEY to Claude Desktop config'} |`,
|
|
366
|
+
`| Network | Solana Mainnet · USDC payments |`,
|
|
351
367
|
`| Platform | https://cryptoiz.org |`,
|
|
352
|
-
`| Twitter | @cryptoiz_IDN |`,
|
|
353
|
-
`| Telegram | https://t.me/agus_artemiss |`,
|
|
354
368
|
``,
|
|
355
|
-
|
|
369
|
+
`---`,
|
|
370
|
+
``,
|
|
371
|
+
`### 🛠 Available Tools`,
|
|
356
372
|
``,
|
|
357
|
-
`| Tool |
|
|
358
|
-
|
|
359
|
-
`| get_alpha_scanner |
|
|
360
|
-
`| get_divergence | 3
|
|
361
|
-
`| get_accumulation | 4-dimension accumulation
|
|
362
|
-
`| get_btc_regime |
|
|
363
|
-
`| get_token_ca |
|
|
364
|
-
`| get_status | This
|
|
373
|
+
`| Tool | What You Get | Cost |`,
|
|
374
|
+
`|------|-------------|------|`,
|
|
375
|
+
`| \`get_alpha_scanner\` | Top 20 ALPHA_EARLY + ALPHA_BUILDING signals. Score, phase, whale/dolphin delta, MC now vs signal MC, risk flags, CA + DexScreener chart | **$0.05 USDC** |`,
|
|
376
|
+
`| \`get_divergence\` | 3 divergence types (Hidden/Breakout/Classic). Score, confidence, whale holders now vs prev, dolphin delta, MC, CA + chart | **$0.02 USDC** |`,
|
|
377
|
+
`| \`get_accumulation\` | 4-dimension accumulation score (Structure/AccDist/Holder/Market). Top 20 tokens in accumulation with CA + chart | **$0.02 USDC** |`,
|
|
378
|
+
`| \`get_btc_regime\` | BTC macro: regime (Bull/Bear/Neutral), Fear & Greed, OI regime, funding rate, RSI/EMA/MACD (1H), altcoin recommendation | **$0.01 USDC** |`,
|
|
379
|
+
`| \`get_token_ca\` | Exact contract address lookup + DexScreener link. Protects against fake/scam tokens with same name | **FREE** |`,
|
|
380
|
+
`| \`get_status\` | This status page | **FREE** |`,
|
|
365
381
|
``,
|
|
366
|
-
|
|
382
|
+
`---`,
|
|
383
|
+
``,
|
|
384
|
+
`### 💡 Quick Start`,
|
|
385
|
+
``,
|
|
386
|
+
`\`\`\``,
|
|
387
|
+
`get_status ← you are here`,
|
|
388
|
+
`get btc regime ← check macro first ($0.01)`,
|
|
389
|
+
`get alpha scanner ← find best entry signals ($0.05)`,
|
|
390
|
+
`get divergence scanner ← find reversal signals ($0.02)`,
|
|
391
|
+
`get accumulation dashboard ← find tokens in accumulation ($0.02)`,
|
|
392
|
+
`get token ca [name] ← verify any token CA (free)`,
|
|
393
|
+
`\`\`\``,
|
|
394
|
+
``,
|
|
395
|
+
`---`,
|
|
396
|
+
``,
|
|
397
|
+
`### 📊 Subscription Plans (Full Platform Access)`,
|
|
367
398
|
``,
|
|
368
|
-
`| Plan | Price |`,
|
|
369
|
-
|
|
370
|
-
`| 1 Week |
|
|
371
|
-
`| 1 Month |
|
|
372
|
-
`| 3 Months |
|
|
373
|
-
`| 1 Year |
|
|
399
|
+
`| Plan | Price | Best For |`,
|
|
400
|
+
`|------|-------|----------|`,
|
|
401
|
+
`| 1 Week | **$15** | Try the full platform |`,
|
|
402
|
+
`| 1 Month | **$50** | Active traders |`,
|
|
403
|
+
`| 3 Months | **$120** | Serious investors |`,
|
|
404
|
+
`| 1 Year | **$400** | Best value |`,
|
|
374
405
|
``,
|
|
375
|
-
|
|
406
|
+
`Full platform includes: visual charts, real-time alerts, Phase Leaderboard, Episode Feed, VIP Telegram signals.`,
|
|
407
|
+
``,
|
|
408
|
+
`🔗 **Subscribe:** https://cryptoiz.org/Pricing`,
|
|
409
|
+
`🔗 **Setup Guide:** https://cryptoiz.org/McpLanding`,
|
|
410
|
+
`🐦 **Twitter:** @cryptoiz_IDN`,
|
|
411
|
+
`📱 **Telegram:** https://t.me/agus_artemiss`,
|
|
376
412
|
].join('\n');
|
|
377
413
|
}
|
|
378
414
|
|
|
@@ -391,7 +427,7 @@ const TOOLS = [
|
|
|
391
427
|
// ══════════════════════════════════════════════════════════════════
|
|
392
428
|
// SERVER
|
|
393
429
|
// ══════════════════════════════════════════════════════════════════
|
|
394
|
-
const server = new Server({ name: 'cryptoiz-mcp', version: '4.
|
|
430
|
+
const server = new Server({ name: 'cryptoiz-mcp', version: '4.6.0' }, { capabilities: { tools: {} } });
|
|
395
431
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
396
432
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
397
433
|
const { name, arguments: args } = request.params;
|
|
@@ -431,8 +467,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
431
467
|
if (name === 'get_token_ca') {
|
|
432
468
|
const tokenName = args?.token_name || '';
|
|
433
469
|
if (!tokenName) return { content: [{ type: 'text', text: '❌ Please provide a token_name. Example: "Aliens"' }], isError: true };
|
|
434
|
-
|
|
435
|
-
|
|
470
|
+
// FREE tool — fetch without payment using free-ca endpoint
|
|
471
|
+
try {
|
|
472
|
+
const controller = new AbortController();
|
|
473
|
+
const timeout = setTimeout(() => controller.abort(), 15000);
|
|
474
|
+
const res = await fetch(`${GATEWAY_URL}?tool=get_token_ca&name=${encodeURIComponent(tokenName)}`, { signal: controller.signal });
|
|
475
|
+
clearTimeout(timeout);
|
|
476
|
+
const data = await res.json();
|
|
477
|
+
return { content: [{ type: 'text', text: await getTokenCA(tokenName, data) }] };
|
|
478
|
+
} catch (err) {
|
|
479
|
+
return { content: [{ type: 'text', text: `❌ CA lookup failed: ${err.message}` }], isError: true };
|
|
480
|
+
}
|
|
436
481
|
}
|
|
437
482
|
|
|
438
483
|
return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
|