cryptoiz-mcp 2.3.1 → 3.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +286 -302
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "2.3.1",
3
+ "version": "3.0.0",
4
4
  "description": "CryptoIZ MCP Server — Solana DEX signals with x402 micropayments. Pay $0.01 USDC per call.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -13,17 +13,8 @@ const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
13
13
  const SOL_RPC = 'https://api.mainnet-beta.solana.com';
14
14
  const AMOUNT = 10000;
15
15
 
16
- // Promotion header - always shown FIRST in every tool response
17
- const PROMO = `[POWERED BY CRYPTOIZ — cryptoiz.org]
18
- Visit https://cryptoiz.org for full dashboard: real-time charts, alerts, VIP Telegram & more.
19
- Subscribe from $15/week | Twitter: @cryptoiz_IDN | Telegram: t.me/agus_artemiss
20
- Plans: 1 Week $15 | 1 Month $50 | 3 Months $120 | 1 Year $400
21
- ──────────────────────────────────────────────────────────────────`;
22
-
23
-
24
-
25
16
  async function payAndFetch(url) {
26
- if (!SVM_PRIVATE_KEY) return { error: 'SVM_PRIVATE_KEY not found. Add it to Claude Desktop config.' };
17
+ if (!SVM_PRIVATE_KEY) return { error: 'SVM_PRIVATE_KEY not set. Add to Claude Desktop config.' };
27
18
  const first = await fetch(url);
28
19
  if (first.status !== 402) return first.json();
29
20
  try {
@@ -32,348 +23,341 @@ async function payAndFetch(url) {
32
23
  const fromAta = await getOrCreateAssociatedTokenAccount(connection, keypair, USDC_MINT, keypair.publicKey);
33
24
  const toAta = await getOrCreateAssociatedTokenAccount(connection, keypair, USDC_MINT, CRYPTOIZ_WALLET);
34
25
  const tx = new Transaction().add(createTransferInstruction(fromAta.address, toAta.address, keypair.publicKey, AMOUNT));
35
- const signature = await connection.sendTransaction(tx, [keypair]);
36
- await connection.confirmTransaction(signature, 'confirmed');
37
- const payment = Buffer.from(JSON.stringify({ signature, network: 'solana', x402Version: 1 })).toString('base64');
38
- const paidRes = await fetch(url, { headers: { 'x-payment': payment } });
39
- return paidRes.json();
26
+ const sig = await connection.sendTransaction(tx, [keypair]);
27
+ await connection.confirmTransaction(sig, 'confirmed');
28
+ const payment = Buffer.from(JSON.stringify({ signature: sig, network: 'solana', x402Version: 1 })).toString('base64');
29
+ const paid = await fetch(url, { headers: { 'x-payment': payment } });
30
+ return paid.json();
40
31
  } catch (err) {
41
32
  return { error: `Payment failed: ${err.message}` };
42
33
  }
43
34
  }
44
35
 
45
- const fmt = (n, d=2) => n != null ? parseFloat(n).toFixed(d) : 'N/A';
46
- const fmtMC = mc => { if (!mc) return 'N/A'; if (mc >= 1e6) return `$${(mc/1e6).toFixed(2)}M`; return `$${(mc/1000).toFixed(0)}K`; };
47
- const fmtD = d => d > 0 ? `+${d}` : `${d}`;
48
- const fmtRisk = r => parseFloat(r) > 0 ? `WARNING ${fmt(r)}%` : `CLEAR 0%`;
49
- const fmtPrice = p => p ? `$${parseFloat(p).toFixed(8)}` : 'N/A';
36
+ const N = (v, d=2) => v != null ? `${parseFloat(v).toFixed(d)}` : 'N/A';
37
+ const sign = v => parseFloat(v) > 0 ? `+${v}` : `${v}`;
38
+ const risk = v => parseFloat(v) > 0 ? `WARNING ${parseFloat(v).toFixed(1)}%` : 'CLEAR';
50
39
 
51
- function entryAdvice(s) {
52
- const lines = [];
53
- if (s.entry_class === 'ALPHA_EARLY' && s.phase?.includes('ACCUM')) lines.push('STRONG BUY SETUP: Early accumulation phase with smart money entering. Best entry window before price moves.');
54
- else if (s.entry_class === 'ALPHA_BUILDING') lines.push('BUILDING: Accumulation continues. Timing still valid — monitor for confirmation.');
55
- else lines.push('WATCHLIST: Does not meet all entry criteria yet. Monitor for phase confirmation.');
56
- if (s.whale_delta > 0 && s.dolphin_delta > 0) lines.push('Whale & Dolphin both positive — strong smart money confirmation.');
57
- if (s.smart_money_trap_risk > 30) lines.push('HIGH TRAP RISK — be cautious before entering.');
58
- if (s.safety_score >= 80) lines.push('High Safety Score — low manipulation risk.');
59
- return lines.join(' | ');
60
- }
40
+ // ═══ FORMATTERS ═══
61
41
 
62
42
  function formatAlpha(data) {
63
- if (data.error) return `ERROR: ${data.error}\nSetup guide: https://cryptoiz.org`;
64
- if (!data.signals?.length) return `No Alpha Scanner signals found at this time.\n\nFor full dashboard access with real-time updates, visit: https://cryptoiz.org\nFollow us: @cryptoiz_IDN`;
65
-
66
- const out = [
67
- PROMO,
68
- `═══════════════════════════════════════════════`,
69
- ` CRYPTOIZ ALPHA ENTRY SCANNER `,
70
- ` AI-Powered Solana DEX Smart Money Signals `,
71
- `═══════════════════════════════════════════════`,
72
- `Date: ${data.fetched_at?.split('T')[0]} | Total Signals: ${data.total}`,
73
- ``,
74
- `WHAT IS THIS?`,
75
- `CryptoIZ Alpha Scanner uses AI to detect Solana tokens`,
76
- `being accumulated by whales & dolphins (smart money)`,
77
- `before price moves. Score 0-100 based on:`,
78
- ` - Accumulation Score: how actively smart money is entering`,
79
- ` - Timing Score: how optimal the entry timing is`,
80
- ` - Safety Score: how safe from manipulation`,
81
- ``,
82
- `For the FULL dashboard with charts, alerts & more data:`,
83
- `>>> https://cryptoiz.org/Alpha-Scanner <<<`,
84
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
85
- ``,
86
- `═══════════════════════════════════════════════`,
87
- ``,
88
- ...data.signals.map((s, i) => [
89
- `[${i+1}] ${s.name}`,
90
- ` Alpha Score : ${fmt(s.alpha_score)}/100 | Class: ${s.entry_class}`,
91
- ` Phase : ${s.phase} | Regime: ${s.regime}`,
92
- ` Confidence : ${fmt(s.phase_confidence)}% | Phase Age: ${s.phase_age_bars} bars`,
43
+ if (data.error) return `ERROR: ${data.error}`;
44
+ const s = data.signals || [];
45
+ const lines = [
46
+ `╔═══════════════════════════════════════════════════════════╗`,
47
+ `║ CRYPTOIZ ALPHA ENTRY SCANNER — v3 ║`,
48
+ `║ AI-Powered Solana Smart Money Signal Detector ║`,
49
+ `╠═══════════════════════════════════════════════════════════╣`,
50
+ `║ PLATFORM : https://cryptoiz.org/Alpha-Scanner ║`,
51
+ `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
52
+ `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
53
+ `╚═══════════════════════════════════════════════════════════╝`,
54
+ ``,
55
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
56
+ `TOTAL SIGNALS: ${data.total_signals}`,
57
+ ``,
58
+ `SIGNAL CLASSES:`,
59
+ ` ALPHA_EARLY = Best entry early accumulation, smart money just entering`,
60
+ ` ALPHA_BUILDING = Accumulation ongoing still valid but less optimal timing`,
61
+ ` WATCHLIST_ONLY = Not ready — monitor until criteria met`,
62
+ ``,
63
+ `SUB-SCORES (0-100):`,
64
+ ` Accumulation = How actively smart money is entering`,
65
+ ` Timing = How optimal the entry timing is right now`,
66
+ ` Safety = Protection from manipulation & fake signals`,
67
+ ``,
68
+ `═══════════════════════════════════════════════════════════`,
69
+ ...s.map((t, i) => [
93
70
  ``,
94
- ` HOLDER SIGNALS:`,
95
- ` Whale : ${fmtD(s.whale_delta)} (${fmt(s.whale_pct)}% of supply)`,
96
- ` Dolphin : ${fmtD(s.dolphin_delta)} (${fmt(s.dolphin_pct)}% of supply)`,
97
- ` Shrimp : ${fmtD(s.shrimp_delta)} (negative = smart money replacing retail)`,
71
+ `[${String(i+1).padStart(2,'0')}] ${t.name}`,
72
+ ` CONTRACT_ADDRESS : ${t.contract_address}`,
73
+ ` ALPHA_SCORE : ${t.alpha_score} / 100`,
74
+ ` SIGNAL_CLASS : ${t.signal_class}`,
75
+ ` CURRENT_PHASE : ${t.phase}`,
76
+ ` REGIME : ${t.regime}`,
77
+ ` PHASE_CONFIDENCE : ${t.phase_confidence_pct}%`,
78
+ ` PHASE_AGE : ${t.phase_age_bars} bars`,
98
79
  ``,
99
- ` SUB-SCORES:`,
100
- ` Accum: ${fmt(s.accumulation_score)} | Timing: ${fmt(s.timing_score)} | Safety: ${fmt(s.safety_score)}`,
80
+ ` --- HOLDER SIGNALS ---`,
81
+ ` WHALE_DELTA : ${sign(t.whale_delta)} (now holds ${t.whale_supply_pct}% of supply)`,
82
+ ` DOLPHIN_DELTA : ${sign(t.dolphin_delta)} (now holds ${t.dolphin_supply_pct}% of supply)`,
83
+ ` SHRIMP_DELTA : ${sign(t.shrimp_delta)} (negative = retail exiting = bullish)`,
101
84
  ``,
102
- ` RISK FLAGS:`,
103
- ` Liquidity Risk: ${fmtRisk(s.liquidity_drain_risk)} | Trap Risk: ${fmtRisk(s.smart_money_trap_risk)}`,
85
+ ` --- SUB-SCORES ---`,
86
+ ` SCORE_ACCUMULATION : ${t.score_accumulation}`,
87
+ ` SCORE_TIMING : ${t.score_timing}`,
88
+ ` SCORE_SAFETY : ${t.score_safety}`,
104
89
  ``,
105
- ` MARKET DATA:`,
106
- ` Market Cap : ${fmtMC(s.market_cap_usd)}`,
107
- ` Price : ${fmtPrice(s.price_usd)}`,
108
- ` Drop/Peak : ${s.price_drop_pct != null ? fmt(s.price_drop_pct)+'%' : 'N/A'}`,
109
- ` CA : ${s.token_address}`,
90
+ ` --- RISK FLAGS ---`,
91
+ ` RISK_LIQUIDITY : ${risk(t.risk_liquidity_pct)}`,
92
+ ` RISK_TRAP : ${risk(t.risk_trap_pct)}`,
110
93
  ``,
111
- ` SIGNAL: ${entryAdvice(s)}`,
112
- ``,
113
- ` View full token detail: https://cryptoiz.org`,
114
- `───────────────────────────────────────────────`,
94
+ ` --- MARKET DATA ---`,
95
+ ` MARKET_CAP_NOW : ${t.market_cap_now || 'N/A'}`,
96
+ ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
97
+ ` PRICE_DROP_FROM_PEAK : ${t.price_drop_from_peak_pct ? t.price_drop_from_peak_pct+'%' : 'N/A'}`,
98
+ ` MC_WHEN_SIGNAL_FORMED : ${t.market_cap_when_signal_formed || 'N/A'}`,
99
+ ` PRICE_WHEN_SIGNAL_FORMED: $${t.price_when_signal_formed_usd || 'N/A'}`,
100
+ `─────────────────────────────────────────────────────────`,
115
101
  ].join('\n')),
116
102
  ``,
117
- `NOTE: This is NOT financial advice. Always DYOR.`,
118
- `For real-time alerts, premium signals & full analysis:`,
119
- `>>> https://cryptoiz.org | Subscribe from $15/week <<<`,
120
- `Twitter: @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
103
+ `NOTE: Not financial advice. Always DYOR.`,
104
+ `FULL DASHBOARD WITH CHARTS: https://cryptoiz.org`,
121
105
  ];
122
- return out.join('\n');
106
+ return lines.join('\n');
123
107
  }
124
108
 
125
109
  function formatDivergence(data) {
126
- if (data.error) return `ERROR: ${data.error}\nhttps://cryptoiz.org`;
127
- if (!data.signals?.length) return `No divergence signals found (${data.timeframe}).\n\nView full Divergence Scanner: https://cryptoiz.org/Divergence\nFollow: @cryptoiz_IDN`;
110
+ if (data.error) return `ERROR: ${data.error}`;
111
+ const lines = [
112
+ `╔═══════════════════════════════════════════════════════════╗`,
113
+ `║ CRYPTOIZ DIVERGENCE SCANNER — v3 ║`,
114
+ `║ Smart Money vs Price Divergence Detector ║`,
115
+ `╠═══════════════════════════════════════════════════════════╣`,
116
+ `║ PLATFORM : https://cryptoiz.org/Divergence ║`,
117
+ `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
118
+ `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
119
+ `╚═══════════════════════════════════════════════════════════╝`,
120
+ ``,
121
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
122
+ `TIMEFRAME : ${data.timeframe?.toUpperCase()}`,
123
+ `TOTAL SIGNALS: ${data.total_signals}`,
124
+ ``,
125
+ `DIVERGENCE TYPES EXPLAINED:`,
126
+ ` HIDDEN_ACCUMULATION = Price flat/weak but whales quietly buying. Stealth entry before the move.`,
127
+ ` BREAKOUT_ACCUMULATION= Whales buying aggressively on price breakout. Strong momentum entry.`,
128
+ ` CLASSIC_DIVERGENCE = Price & smart money moving in opposite directions. High reversal potential.`,
129
+ ``,
130
+ `═══════════════════════════════════════════════════════════`,
131
+ ];
128
132
 
129
- const out = [
130
- PROMO,
131
- `═══════════════════════════════════════════════`,
132
- ` CRYPTOIZ DIVERGENCE SCANNER `,
133
- ` Whale/Dolphin vs Price Divergence Detector `,
134
- `═══════════════════════════════════════════════`,
135
- `Date: ${data.fetched_at?.split('T')[0]} | Timeframe: ${data.timeframe?.toUpperCase()} | Total: ${data.total}`,
136
- ``,
137
- `WHAT IS THIS?`,
138
- `Divergence occurs when price moves opposite to smart money.`,
139
- ` BULLISH: Price drops but whales/dolphins are BUYING`,
140
- ` -> Potential reversal UPWARD`,
141
- ` BEARISH: Price rises but whales/dolphins are SELLING`,
142
- ` -> Potential reversal DOWNWARD`,
143
- ``,
144
- `For the FULL divergence dashboard with charts:`,
145
- `>>> https://cryptoiz.org/Divergence <<<`,
146
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
147
- ``,
148
- `═══════════════════════════════════════════════`,
149
- ``,
150
- ...data.signals.map((s, i) => {
151
- const type = s.divergence_type === 'bullish' ? 'BULLISH [Potential UP]' : s.divergence_type === 'bearish' ? 'BEARISH [Potential DOWN]' : (s.divergence_type||'').toUpperCase();
152
- const advice = s.divergence_type === 'bullish'
153
- ? 'BULLISH DIVERGENCE: Price down but smart money buying. Watch for entry opportunity on reversal confirmation.'
154
- : 'BEARISH DIVERGENCE: Price up but smart money selling. Be cautious if holding this token.';
155
- return [
156
- `[${i+1}] ${s.name||s.symbol} — ${type}`,
157
- ` Divergence Score : ${fmt(s.divergence_score)} | Confidence: ${fmt(s.confidence_score)}%`,
158
- ` Phase : ${s.phase_label}`,
133
+ const byType = data.signals_by_type || {};
134
+ const typeOrder = ['HIDDEN_ACCUMULATION', 'BREAKOUT_ACCUMULATION', 'CLASSIC_DIVERGENCE'];
135
+
136
+ typeOrder.forEach(type => {
137
+ const sigs = byType[type] || [];
138
+ if (!sigs.length) return;
139
+ lines.push(``, `▶ ${type} (${sigs.length} signals)`, `─────────────────────────────────────────────────────────`);
140
+ sigs.forEach((s, i) => {
141
+ lines.push([
159
142
  ``,
160
- ` HOLDER SIGNALS:`,
161
- ` Whale : ${fmtD(s.whale_delta)} | Dolphin: ${fmtD(s.dolphin_delta)}`,
143
+ ` [${String(i+1).padStart(2,'0')}] ${s.name}`,
144
+ ` CONTRACT_ADDRESS : ${s.contract_address}`,
145
+ ` DIVERGENCE_TYPE : ${s.divergence_type}`,
146
+ ` DIVERGENCE_SCORE : ${s.divergence_score}`,
147
+ ` CONFIDENCE : ${s.confidence_pct}%`,
148
+ ` CURRENT_PHASE : ${s.current_phase}`,
162
149
  ``,
163
- ` MARKET DATA:`,
164
- ` Market Cap : ${fmtMC(s.market_cap_usd)}`,
165
- ` Price Now : ${fmtPrice(s.price_usd)}`,
166
- ` Price Chg : ${s.price_change_pct ? fmt(s.price_change_pct)+'%' : 'N/A'}`,
167
- ` Detected : ${s.detected_at ? new Date(s.detected_at).toUTCString() : 'N/A'}`,
168
- ` CA : ${s.token_address}`,
150
+ ` --- HOLDER MOVEMENT ---`,
151
+ ` WHALE_HOLDERS_NOW : ${s.whale_holders_now} (was: ${s.whale_holders_prev}, delta: ${sign(s.whale_delta)})`,
152
+ ` DOLPHIN_DELTA : ${sign(s.dolphin_delta)}`,
169
153
  ``,
170
- ` SIGNAL: ${advice}`,
171
- ``,
172
- ` View on CryptoIZ: https://cryptoiz.org/Divergence`,
173
- `───────────────────────────────────────────────`,
174
- ].join('\n');
175
- }),
176
- ``,
177
- `NOTE: This is NOT financial advice. Always DYOR.`,
178
- `Full divergence scanner with real-time data:`,
179
- `>>> https://cryptoiz.org | @cryptoiz_IDN <<<`,
180
- ];
181
- return out.join('\n');
154
+ ` --- PRICE DATA ---`,
155
+ ` PRICE_NOW : $${s.price_now_usd}`,
156
+ ` PRICE_PREV_PERIOD : $${s.price_prev_usd}`,
157
+ ` PRICE_CHANGE : ${s.price_change_pct}%`,
158
+ ` MARKET_CAP : ${s.market_cap_usd || 'N/A'}`,
159
+ ` DETECTED : ${s.detected}`,
160
+ ].join('\n'));
161
+ });
162
+ lines.push(`─────────────────────────────────────────────────────────`);
163
+ });
164
+
165
+ if (!data.total_signals) {
166
+ lines.push(``, `No divergence signals detected at this time.`, `This is normal during sideways/low-volatility markets.`, `Check again in a few hours or try the 1d timeframe.`);
167
+ }
168
+
169
+ lines.push(``, `NOTE: Not financial advice. Always DYOR.`, `FULL DIVERGENCE DASHBOARD: https://cryptoiz.org/Divergence`);
170
+ return lines.join('\n');
182
171
  }
183
172
 
184
173
  function formatAccumulation(data) {
185
- if (data.error) return `ERROR: ${data.error}\nhttps://cryptoiz.org`;
186
- if (!data.tokens?.length) return `No tokens in accumulation phase found.\n\nFull dashboard: https://cryptoiz.org\nFollow: @cryptoiz_IDN`;
187
-
188
- const out = [
189
- PROMO,
190
- `═══════════════════════════════════════════════`,
191
- ` CRYPTOIZ ACCUMULATION DASHBOARD `,
192
- ` Smart Money Accumulation Phase Detector `,
193
- `═══════════════════════════════════════════════`,
194
- `Date: ${data.fetched_at?.split('T')[0]} | Total Tokens: ${data.total}`,
195
- ``,
196
- `WHAT IS THIS?`,
197
- `CryptoIZ Accumulation Dashboard detects tokens in active`,
198
- `accumulation phase using 4 proprietary dimensions:`,
199
- ` - Structure Score : Price action & holder tier patterns`,
200
- ` - AccDist Score : Accumulation vs distribution ratio`,
201
- ` - Holder Score : Holder quality & consistency`,
202
- ` - Market Score : Market conditions & volume`,
203
- `Composite Score = weighted average of all 4 dimensions.`,
204
- ``,
205
- `For the full accumulation dashboard with real-time charts:`,
206
- `>>> https://cryptoiz.org/Dashboard <<<`,
207
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
208
- ``,
209
- `═══════════════════════════════════════════════`,
210
- ``,
211
- ...data.tokens.map((t, i) => {
212
- const advice = t.strength_label?.includes('VERY_STRONG')
213
- ? 'VERY STRONG: Highest priority accumulation signal. Smart money very active.'
214
- : t.strength_label?.includes('STRONG')
215
- ? 'STRONG: Active accumulation detected. Good entry opportunity candidate.'
216
- : 'FORMING: Early accumulation forming. Monitor for confirmation.';
217
- return [
218
- `[${i+1}] ${t.name}`,
219
- ` Composite Score : ${fmt(t.composite_score)}/100`,
220
- ` Strength : ${t.strength_label}`,
221
- ` AccDist Status : ${t.accdist_label} (Score: ${fmt(t.accdist_score)})`,
222
- ``,
223
- ` SUB-SCORES:`,
224
- ` Structure: ${fmt(t.structure_score)} | Holder: ${fmt(t.holder_score)} | Market: ${fmt(t.market_score)}`,
225
- ``,
226
- ` CA: ${t.token_address}`,
227
- ``,
228
- ` SIGNAL: ${advice}`,
229
- ``,
230
- ` View on CryptoIZ: https://cryptoiz.org`,
231
- `───────────────────────────────────────────────`,
232
- ].join('\n');
233
- }),
234
- ``,
235
- `NOTE: This is NOT financial advice. Always DYOR.`,
236
- `Real-time accumulation alerts & full platform:`,
237
- `>>> https://cryptoiz.org | Subscribe from $15/week <<<`,
238
- `Twitter: @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
174
+ if (data.error) return `ERROR: ${data.error}`;
175
+ const tokens = data.tokens || [];
176
+ const lines = [
177
+ `╔═══════════════════════════════════════════════════════════╗`,
178
+ `║ CRYPTOIZ ACCUMULATION DASHBOARD — v3 ║`,
179
+ `║ 4-Dimension Smart Money Accumulation Detector ║`,
180
+ `╠═══════════════════════════════════════════════════════════╣`,
181
+ `║ PLATFORM : https://cryptoiz.org/Dashboard ║`,
182
+ `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
183
+ `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
184
+ `╚═══════════════════════════════════════════════════════════╝`,
185
+ ``,
186
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
187
+ `TOTAL TOKENS : ${data.total_tokens}`,
188
+ ``,
189
+ `COMPOSITE SCORE = Weighted average of 4 dimensions:`,
190
+ ` Structure Score = Price action & holder tier pattern quality`,
191
+ ` AccDist Score = Accumulation vs distribution ratio`,
192
+ ` Holder Score = Holder quality, loyalty & consistency`,
193
+ ` Market Score = Market conditions, volume & momentum`,
194
+ ``,
195
+ `STRENGTH LABELS:`,
196
+ ` VERY_STRONG_SMART_MONEY = Highest conviction act now`,
197
+ ` STRONG_SMART_MONEY_FORMING = Strong signal — monitor closely`,
198
+ ` FORMING = Early stage — needs confirmation`,
199
+ ` WEAK_OR_NOISY = Low confidence — skip for now`,
200
+ ``,
201
+ `═══════════════════════════════════════════════════════════`,
202
+ ...tokens.map((t, i) => [
203
+ ``,
204
+ `[${String(i+1).padStart(2,'0')}] ${t.name}`,
205
+ ` CONTRACT_ADDRESS : ${t.contract_address}`,
206
+ ` ACCUMULATION : ${t.accumulation_strength}`,
207
+ ` ACCDIST_STATUS : ${t.accdist_status}`,
208
+ ``,
209
+ ` --- COMPOSITE SCORE: ${t.score_composite} / 100 ---`,
210
+ ` SCORE_STRUCTURE : ${t.score_structure}`,
211
+ ` SCORE_ACCDIST : ${t.score_accdist}`,
212
+ ` SCORE_HOLDER : ${t.score_holder}`,
213
+ ` SCORE_MARKET : ${t.score_market}`,
214
+ ``,
215
+ ` --- MARKET DATA ---`,
216
+ ` MARKET_CAP_NOW : ${t.market_cap_now || 'N/A'}`,
217
+ ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
218
+ ` LAST_UPDATED : ${t.last_updated || 'N/A'}`,
219
+ `─────────────────────────────────────────────────────────`,
220
+ ].join('\n')),
221
+ ``,
222
+ `NOTE: Not financial advice. Always DYOR.`,
223
+ `FULL ACCUMULATION DASHBOARD: https://cryptoiz.org`,
239
224
  ];
240
- return out.join('\n');
225
+ return lines.join('\n');
241
226
  }
242
227
 
243
228
  function formatBTC(data) {
244
- if (data.error) return `ERROR: ${data.error}\nhttps://cryptoiz.org/BTC`;
245
- const s = data.btc_signal || {};
246
- const f = data.futures_signal || {};
247
- const ind = data.indicators || {};
248
- const stateLabel = s.state === 'bull' ? 'BULLISH' : s.state === 'bear' ? 'BEARISH' : 'NEUTRAL';
249
- const altAdvice = s.state === 'bull'
250
- ? 'BTC is BULLISH -> Favorable conditions for Solana altcoin entries.\n Focus on tokens with high Alpha Score on CryptoIZ Alpha Scanner.'
251
- : s.state === 'bear'
252
- ? 'BTC is BEARISH -> Be CAUTIOUS with altcoin entries.\n Prioritize tokens with high Safety Score and low liquidity risk.'
253
- : 'BTC is NEUTRAL -> Be SELECTIVE. Wait for signal confirmation before large entries.';
229
+ if (data.error) return `ERROR: ${data.error}`;
230
+ const regime = data.btc_regime || 'UNKNOWN';
231
+ const icon = regime === 'BULL' ? 'BULLISH' : regime === 'BEAR' ? 'BEARISH' : 'NEUTRAL';
232
+ const advice = regime === 'BULL'
233
+ ? 'BTC BULLISH -> Favorable for altcoin entries. Focus on high Alpha Score tokens.'
234
+ : regime === 'BEAR'
235
+ ? 'BTC BEARISH -> Be cautious. Prioritize high Safety Score, low Liquidity Risk tokens. Size down.'
236
+ : 'BTC NEUTRAL -> Be selective. Wait for signal confirmation before large positions.';
254
237
 
255
- const out = [
256
- PROMO,
257
- `═══════════════════════════════════════════════`,
258
- ` CRYPTOIZ BTC REGIME MONITOR `,
259
- ` Bitcoin Market Condition for Altcoin Traders`,
260
- `═══════════════════════════════════════════════`,
261
- `Date: ${data.fetched_at?.split('T')[0]}`,
262
- ``,
263
- `WHAT IS THIS?`,
264
- `CryptoIZ BTC Regime Monitor analyzes Bitcoin macro conditions`,
265
- `to help you understand whether the market is bullish, bearish,`,
266
- `or neutral. BTC regime directly impacts Solana altcoin moves.`,
267
- ``,
268
- `For full BTC analysis with charts & indicators:`,
269
- `>>> https://cryptoiz.org/BTC <<<`,
270
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
271
- ``,
272
- `═══════════════════════════════════════════════`,
273
- ``,
274
- `CURRENT BTC REGIME: ${stateLabel}`,
275
- ``,
276
- ` BTC Price : $${s.last_price ? parseFloat(s.last_price).toLocaleString() : 'N/A'}`,
277
- ` BTC Score : ${s.score || 'N/A'} / 10 (0=extreme bear, 10=extreme bull)`,
278
- ` Trend : ${(s.trend||'N/A').toUpperCase()}`,
279
- ``,
280
- `MARKET SENTIMENT:`,
281
- ` Fear & Greed Index : ${s.fear_value || 'N/A'} / 100 — ${s.fear_label || 'N/A'}`,
282
- ` Context: ${
283
- s.fear_value <= 25 ? 'Extreme Fear zone historically a strong BUY opportunity area for patient investors.' :
284
- s.fear_value >= 75 ? 'Extreme Greedmarket may be overheated, reversal risk is elevated.' :
285
- 'Neutral sentiment — follow technical signals for direction.'
238
+ return [
239
+ `╔═══════════════════════════════════════════════════════════╗`,
240
+ `║ CRYPTOIZ BTC REGIME MONITOR — v3 ║`,
241
+ `║ Bitcoin Macro Condition for Solana Altcoin Traders ║`,
242
+ `╠═══════════════════════════════════════════════════════════╣`,
243
+ `║ PLATFORM : https://cryptoiz.org/BTC ║`,
244
+ `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
245
+ `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
246
+ `╚═══════════════════════════════════════════════════════════╝`,
247
+ ``,
248
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
249
+ ``,
250
+ `═══ BTC REGIME: ${icon} ═══`,
251
+ ``,
252
+ `BTC_PRICE_USD : $${data.btc_price_usd || 'N/A'}`,
253
+ `BTC_SCORE : ${data.btc_score} / 10 (0=extreme bear, 10=extreme bull)`,
254
+ `BTC_TREND : ${data.btc_trend || 'N/A'}`,
255
+ `OPEN_INTEREST : ${data.open_interest || 'N/A'}`,
256
+ `FUNDING_RATE : ${data.funding_rate || 'N/A'}`,
257
+ ``,
258
+ `═══ MARKET SENTIMENT ═══`,
259
+ ``,
260
+ `FEAR_GREED_INDEX : ${data.fear_and_greed_index} / 100`,
261
+ `FEAR_GREED_LABEL : ${data.fear_and_greed_label}`,
262
+ `FEAR_GREED_CONTEXT : ${
263
+ data.fear_and_greed_index <= 25
264
+ ? 'Extreme Fear zone historically strong contrarian buy opportunity for patient investors.'
265
+ : data.fear_and_greed_index >= 75
266
+ ? 'Extreme Greedmarket overheated, reversal risk elevated.'
267
+ : 'Neutral zonefollow technical signals.'
286
268
  }`,
287
269
  ``,
288
- `FUTURES MARKET:`,
289
- ` Signal : ${f.signal || 'N/A'}`,
290
- ` OI Regime : ${f.oi_regime || 'N/A'}`,
291
- ` Funding : ${f.funding_regime || 'N/A'}`,
292
- ` Perp Price : $${f.perp_price ? parseFloat(f.perp_price).toLocaleString() : 'N/A'}`,
293
- ` Context : ${f.reason || 'N/A'}`,
294
- ``,
295
- ind.rsi ? [
296
- `TECHNICAL INDICATORS (1H):`,
297
- ` RSI : ${fmt(ind.rsi)} ${parseFloat(ind.rsi) < 30 ? '(Oversold — potential bounce)' : parseFloat(ind.rsi) > 70 ? '(Overbought — caution)' : '(Normal range)'}`,
298
- ` EMA 20 : $${ind.ema_20 ? parseFloat(ind.ema_20).toLocaleString() : 'N/A'}`,
299
- ` EMA 50 : $${ind.ema_50 ? parseFloat(ind.ema_50).toLocaleString() : 'N/A'}`,
300
- ` MACD : ${fmt(ind.macd)} | Signal: ${fmt(ind.macd_signal)} | Hist: ${fmt(ind.macd_hist)}`,
301
- ``,
302
- ].join('\n') : '',
303
- `ALTCOIN RECOMMENDATION:`,
304
- ` ${altAdvice}`,
305
- ``,
306
- ` Check CryptoIZ Alpha Scanner for best Solana entry signals:`,
307
- ` >>> https://cryptoiz.org/Alpha-Scanner <<<`,
308
- ``,
309
- `═══════════════════════════════════════════════`,
310
- `NOTE: This is NOT financial advice. Always DYOR.`,
311
- `Full BTC monitor + Solana signals platform:`,
312
- `>>> https://cryptoiz.org | Plans from $15/week <<<`,
313
- `Twitter: @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
314
- ];
315
- return out.join('\n');
270
+ `═══ FUTURES MARKET ═══`,
271
+ ``,
272
+ `FUTURES_SIGNAL : ${data.futures_signal || 'N/A'}`,
273
+ `OI_REGIME : ${data.oi_regime || 'N/A'}`,
274
+ `FUNDING_REGIME : ${data.funding_regime || 'N/A'}`,
275
+ `PERP_PRICE_USD : $${data.perp_price_usd || 'N/A'}`,
276
+ `FUTURES_CONTEXT : ${data.futures_context || 'N/A'}`,
277
+ ``,
278
+ `═══ TECHNICAL INDICATORS (1H) ═══`,
279
+ ``,
280
+ `RSI_1H : ${data.rsi_1h || 'N/A'}${data.rsi_1h ? (parseFloat(data.rsi_1h) < 30 ? ' (Oversold)' : parseFloat(data.rsi_1h) > 70 ? ' (Overbought)' : ' (Normal)') : ''}`,
281
+ `EMA20_1H : $${data.ema20_1h || 'N/A'}`,
282
+ `EMA50_1H : $${data.ema50_1h || 'N/A'}`,
283
+ `MACD_1H : ${data.macd_1h || 'N/A'}`,
284
+ `MACD_SIGNAL_1H : ${data.macd_signal_1h || 'N/A'}`,
285
+ ``,
286
+ `═══ ALTCOIN RECOMMENDATION ═══`,
287
+ ``,
288
+ `RECOMMENDATION: ${advice}`,
289
+ ``,
290
+ `For best Solana entry signals during this BTC regime:`,
291
+ `>>> https://cryptoiz.org/Alpha-Scanner <<<`,
292
+ ``,
293
+ `NOTE: Not financial advice. Always DYOR.`,
294
+ `FULL BTC MONITOR: https://cryptoiz.org/BTC`,
295
+ ].join('\n');
316
296
  }
317
297
 
318
298
  function formatStatus() {
319
299
  return [
320
- `═══════════════════════════════════════════════`,
321
- ` CryptoIZ MCP Server v2.2.0 `,
322
- ` AI-Powered Solana DEX Trading Signals `,
323
- `═══════════════════════════════════════════════`,
324
- ``,
325
- `CONNECTION STATUS:`,
326
- ` Status : CONNECTED to CryptoIZ Data Engine`,
327
- ` Payment : ${SVM_PRIVATE_KEY ? 'READY — x402 Solana USDC autopay' : 'NOT SET — add SVM_PRIVATE_KEY to config'}`,
328
- ` Price : $0.01 USDC per tool call`,
329
- ` Wallet : DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX`,
330
- ``,
331
- `AVAILABLE TOOLS:`,
300
+ `╔═══════════════════════════════════════════════════════════╗`,
301
+ `║ CryptoIZ MCP Server v3.0.0 ║`,
302
+ `║ AI-Powered Solana DEX Trading Signal Platform ║`,
303
+ `╠═══════════════════════════════════════════════════════════╣`,
304
+ `║ WEBSITE : https://cryptoiz.org ║`,
305
+ `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
306
+ `║ TWITTER : @cryptoiz_IDN ║`,
307
+ `║ TELEGRAM : https://t.me/agus_artemiss ║`,
308
+ `╚═══════════════════════════════════════════════════════════╝`,
309
+ ``,
310
+ `CONNECTION_STATUS : CONNECTED`,
311
+ `PAYMENT_STATUS : ${SVM_PRIVATE_KEY ? 'READY — x402 Solana USDC autopay' : 'NOT SET — add SVM_PRIVATE_KEY'}`,
312
+ `PRICE_PER_CALL : $0.01 USDC via Solana`,
313
+ `PAYMENT_WALLET : DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX`,
314
+ ``,
315
+ `AVAILABLE_TOOLS:`,
316
+ ``,
332
317
  ` 1. get_alpha_scanner`,
333
- ` Strongest Solana token signals with smart money analysis`,
334
- ` Includes: CA, market cap, price, holder signals, sub-scores, risk flags`,
318
+ ` What: Strongest Solana tokens being accumulated by smart money`,
319
+ ` Data: Contract address, alpha score, class, phase, regime,`,
320
+ ` whale/dolphin/shrimp signals, 3 sub-scores, risk flags,`,
321
+ ` MC now, price now, MC & price when signal formed`,
322
+ ` URL : https://cryptoiz.org/Alpha-Scanner`,
335
323
  ``,
336
324
  ` 2. get_divergence`,
337
- ` Bullish/bearish divergence between price & whale/dolphin activity`,
338
- ` Includes: CA, MC, price, confidence score, detection time`,
325
+ ` What: Tokens where price & smart money activity diverge`,
326
+ ` Types: HIDDEN_ACCUMULATION, BREAKOUT_ACCUMULATION, CLASSIC_DIVERGENCE`,
327
+ ` Data: Contract address, divergence type+explanation, score,`,
328
+ ` confidence, whale movement (now vs prev), price, MC`,
329
+ ` URL : https://cryptoiz.org/Divergence`,
339
330
  ``,
340
331
  ` 3. get_accumulation`,
341
- ` Tokens in active accumulation phase composite score analysis`,
342
- ` Includes: CA, 4 sub-scores (structure/accdist/holder/market)`,
332
+ ` What: Tokens in active accumulation phase (4-dimension score)`,
333
+ ` Data: Contract address, composite + 4 sub-scores (structure/`,
334
+ ` accdist/holder/market), strength label, MC, price`,
335
+ ` URL : https://cryptoiz.org/Dashboard`,
343
336
  ``,
344
337
  ` 4. get_btc_regime`,
345
- ` Bitcoin macro regime — Fear & Greed, OI, funding, indicators`,
346
- ` Essential context for Solana altcoin trading`,
338
+ ` What: Bitcoin macro regime — critical context for altcoin trading`,
339
+ ` Data: Price, score, trend, Fear&Greed, OI regime, funding rate,`,
340
+ ` futures signal, RSI/EMA20/EMA50/MACD (1H)`,
341
+ ` URL : https://cryptoiz.org/BTC`,
347
342
  ``,
348
343
  ` 5. get_status — This info`,
349
344
  ``,
350
- `HOW TO USE:`,
351
- ` "Show me today's strongest Solana signals"`,
352
- ` "Any bullish divergence on 4h timeframe?"`,
353
- ` "Which tokens are whales accumulating right now?"`,
354
- ` "What is BTC market condition?"`,
355
- ``,
356
- `ABOUT CRYPTOIZ:`,
357
- ` CryptoIZ is an AI-powered Solana DEX trading platform.`,
358
- ` This MCP gives you a PREVIEW of our signals.`,
359
- ` For full access with real-time charts, alerts & VIP Telegram:`,
360
- ``,
361
- ` >>> https://cryptoiz.org | Plans from $15/week <<<`,
362
- ` Twitter : @cryptoiz_IDN`,
363
- ` Telegram: t.me/agus_artemiss`,
364
- `═══════════════════════════════════════════════`,
345
+ `PLATFORM PLANS:`,
346
+ ` 1 Week : $15 | 1 Month : $50`,
347
+ ` 3 Months : $120 | 1 Year : $400`,
348
+ ` URL: https://cryptoiz.org/Pricing`,
365
349
  ].join('\n');
366
350
  }
367
351
 
368
352
  const TOOLS = [
369
- { name: 'get_alpha_scanner', description: 'Get strongest Solana token signals from CryptoIZ Alpha Scanner. Includes CA, market cap, price, whale/dolphin/shrimp signals, sub-scores, risk flags. $0.01 USDC per call.', inputSchema: { type: 'object', properties: { min_score: { type: 'number', description: 'Minimum alpha score (0-100).' }, entry_class: { type: 'string', enum: ['ALPHA_EARLY','ALPHA_BUILDING','WATCHLIST_ONLY'] } }, required: [] } },
370
- { name: 'get_divergence', description: 'Get bullish/bearish divergence signals from CryptoIZ. Includes CA, MC, price, confidence score, detection time. $0.01 USDC per call.', inputSchema: { type: 'object', properties: { timeframe: { type: 'string', enum: ['4h','1d'] }, limit: { type: 'number' } }, required: [] } },
371
- { name: 'get_accumulation', description: 'Get tokens in active accumulation phase from CryptoIZ. Composite score from 4 dimensions. Includes CA. $0.01 USDC per call.', inputSchema: { type: 'object', properties: { min_composite: { type: 'number' } }, required: [] } },
372
- { name: 'get_btc_regime', description: 'Get Bitcoin macro regime from CryptoIZ BTC Monitor. Includes price, Fear & Greed, OI regime, funding rate, futures signal, RSI/EMA/MACD. $0.01 USDC per call.', inputSchema: { type: 'object', properties: {}, required: [] } },
373
- { name: 'get_status', description: 'Check CryptoIZ MCP connection status, payment setup, and list of available tools.', inputSchema: { type: 'object', properties: {}, required: [] } },
353
+ { name: 'get_alpha_scanner', description: 'Get strongest Solana token signals from CryptoIZ Alpha Scanner. Returns contract address, alpha score, class, phase, regime, whale/dolphin/shrimp signals, 3 sub-scores (accumulation/timing/safety), risk flags, market cap now, price now, MC and price when signal first formed. $0.01 USDC per call. Platform: cryptoiz.org', inputSchema: { type: 'object', properties: { min_score: { type: 'number' }, entry_class: { type: 'string', enum: ['ALPHA_EARLY','ALPHA_BUILDING','WATCHLIST_ONLY'] } }, required: [] } },
354
+ { name: 'get_divergence', description: 'Get divergence signals from CryptoIZ — 3 types: HIDDEN_ACCUMULATION (stealth smart money entry), BREAKOUT_ACCUMULATION (momentum entry), CLASSIC_DIVERGENCE (reversal signal). Returns contract address, type with explanation, score, confidence, whale holders now vs prev, price, MC. $0.01 USDC per call. Platform: cryptoiz.org/Divergence', inputSchema: { type: 'object', properties: { timeframe: { type: 'string', enum: ['4h','1d'] }, limit: { type: 'number' } }, required: [] } },
355
+ { name: 'get_accumulation', description: 'Get tokens in accumulation phase from CryptoIZ 4-dimension composite score (structure, accdist, holder, market). Returns contract address, composite score, 4 sub-scores, strength label, market cap, price. $0.01 USDC per call. Platform: cryptoiz.org', inputSchema: { type: 'object', properties: { min_composite: { type: 'number' } }, required: [] } },
356
+ { name: 'get_btc_regime', description: 'Get Bitcoin macro regime from CryptoIZ. Returns BTC price, regime score, Fear & Greed Index, OI regime, funding rate, futures signal, RSI/EMA20/EMA50/MACD (1H), altcoin recommendation. $0.01 USDC per call. Platform: cryptoiz.org/BTC', inputSchema: { type: 'object', properties: {}, required: [] } },
357
+ { name: 'get_status', description: 'Check CryptoIZ MCP server status, payment setup, and full list of available tools with data descriptions. Platform: cryptoiz.org', inputSchema: { type: 'object', properties: {}, required: [] } },
374
358
  ];
375
359
 
376
- const server = new Server({ name: 'cryptoiz-mcp', version: '2.3.0' }, { capabilities: { tools: {} } });
360
+ const server = new Server({ name: 'cryptoiz-mcp', version: '3.0.0' }, { capabilities: { tools: {} } });
377
361
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
378
362
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
379
363
  const { name, arguments: args } = request.params;
@@ -381,8 +365,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
381
365
  if (name === 'get_status') return { content: [{ type: 'text', text: formatStatus() }] };
382
366
  if (name === 'get_alpha_scanner') {
383
367
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_alpha_scanner`);
384
- if (args?.min_score && data.signals) { data.signals = data.signals.filter(s => s.alpha_score >= args.min_score); data.total = data.signals.length; }
385
- if (args?.entry_class && data.signals) { data.signals = data.signals.filter(s => s.entry_class === args.entry_class); data.total = data.signals.length; }
368
+ if (args?.min_score && data.signals) { data.signals = data.signals.filter(s => parseFloat(s.alpha_score) >= args.min_score); data.total_signals = data.signals.length; }
369
+ if (args?.entry_class && data.signals) { data.signals = data.signals.filter(s => s.signal_class === args.entry_class); data.total_signals = data.signals.length; }
386
370
  return { content: [{ type: 'text', text: formatAlpha(data) }] };
387
371
  }
388
372
  if (name === 'get_divergence') {
@@ -394,7 +378,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
394
378
  }
395
379
  if (name === 'get_accumulation') {
396
380
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_accumulation`);
397
- if (args?.min_composite && data.tokens) { data.tokens = data.tokens.filter(t => t.composite_score >= args.min_composite); data.total = data.tokens.length; }
381
+ if (args?.min_composite && data.tokens) { data.tokens = data.tokens.filter(t => parseFloat(t.score_composite) >= args.min_composite); data.total_tokens = data.tokens.length; }
398
382
  return { content: [{ type: 'text', text: formatAccumulation(data) }] };
399
383
  }
400
384
  if (name === 'get_btc_regime') {