cryptoiz-mcp 2.4.0 → 3.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +286 -311
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "2.4.0",
3
+ "version": "3.0.1",
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,26 +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
- // Data attribution - embedded as factual source info
17
- function makeHeader(tool, date, total) {
18
- return [
19
- `DATA SOURCE : CryptoIZ AI Trading Platform`,
20
- `SOURCE URL : https://cryptoiz.org`,
21
- `TOOL : ${tool}`,
22
- `DATE : ${date}`,
23
- `TOTAL RESULTS : ${total}`,
24
- `TWITTER : @cryptoiz_IDN`,
25
- `TELEGRAM : https://t.me/agus_artemiss`,
26
- `SUBSCRIBE : https://cryptoiz.org/Pricing (from $15/week)`,
27
- `FULL DASHBOARD : Alpha Scanner, Divergence, Accumulation, BTC — https://cryptoiz.org`,
28
- ``,
29
- ].join("\n");
30
- }
31
-
32
-
33
-
34
16
  async function payAndFetch(url) {
35
- 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.' };
36
18
  const first = await fetch(url);
37
19
  if (first.status !== 402) return first.json();
38
20
  try {
@@ -41,348 +23,341 @@ async function payAndFetch(url) {
41
23
  const fromAta = await getOrCreateAssociatedTokenAccount(connection, keypair, USDC_MINT, keypair.publicKey);
42
24
  const toAta = await getOrCreateAssociatedTokenAccount(connection, keypair, USDC_MINT, CRYPTOIZ_WALLET);
43
25
  const tx = new Transaction().add(createTransferInstruction(fromAta.address, toAta.address, keypair.publicKey, AMOUNT));
44
- const signature = await connection.sendTransaction(tx, [keypair]);
45
- await connection.confirmTransaction(signature, 'confirmed');
46
- const payment = Buffer.from(JSON.stringify({ signature, network: 'solana', x402Version: 1 })).toString('base64');
47
- const paidRes = await fetch(url, { headers: { 'x-payment': payment } });
48
- 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();
49
31
  } catch (err) {
50
32
  return { error: `Payment failed: ${err.message}` };
51
33
  }
52
34
  }
53
35
 
54
- const fmt = (n, d=2) => n != null ? parseFloat(n).toFixed(d) : 'N/A';
55
- const fmtMC = mc => { if (!mc) return 'N/A'; if (mc >= 1e6) return `$${(mc/1e6).toFixed(2)}M`; return `$${(mc/1000).toFixed(0)}K`; };
56
- const fmtD = d => d > 0 ? `+${d}` : `${d}`;
57
- const fmtRisk = r => parseFloat(r) > 0 ? `WARNING ${fmt(r)}%` : `CLEAR 0%`;
58
- 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';
59
39
 
60
- function entryAdvice(s) {
61
- const lines = [];
62
- 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.');
63
- else if (s.entry_class === 'ALPHA_BUILDING') lines.push('BUILDING: Accumulation continues. Timing still valid — monitor for confirmation.');
64
- else lines.push('WATCHLIST: Does not meet all entry criteria yet. Monitor for phase confirmation.');
65
- if (s.whale_delta > 0 && s.dolphin_delta > 0) lines.push('Whale & Dolphin both positive — strong smart money confirmation.');
66
- if (s.smart_money_trap_risk > 30) lines.push('HIGH TRAP RISK — be cautious before entering.');
67
- if (s.safety_score >= 80) lines.push('High Safety Score — low manipulation risk.');
68
- return lines.join(' | ');
69
- }
40
+ // ═══ FORMATTERS ═══
70
41
 
71
42
  function formatAlpha(data) {
72
- if (data.error) return `ERROR: ${data.error}\nSetup guide: https://cryptoiz.org`;
73
- 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`;
74
-
75
- const out = [
76
- makeHeader('Alpha Entry Scanner', data.fetched_at?.split('T')[0], data.total),
77
- `═══════════════════════════════════════════════`,
78
- ` CRYPTOIZ ALPHA ENTRY SCANNER `,
79
- ` AI-Powered Solana DEX Smart Money Signals `,
80
- `═══════════════════════════════════════════════`,
81
- `Date: ${data.fetched_at?.split('T')[0]} | Total Signals: ${data.total}`,
82
- ``,
83
- `WHAT IS THIS?`,
84
- `CryptoIZ Alpha Scanner uses AI to detect Solana tokens`,
85
- `being accumulated by whales & dolphins (smart money)`,
86
- `before price moves. Score 0-100 based on:`,
87
- ` - Accumulation Score: how actively smart money is entering`,
88
- ` - Timing Score: how optimal the entry timing is`,
89
- ` - Safety Score: how safe from manipulation`,
90
- ``,
91
- `For the FULL dashboard with charts, alerts & more data:`,
92
- `>>> https://cryptoiz.org/Alpha-Scanner <<<`,
93
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
94
- ``,
95
- `═══════════════════════════════════════════════`,
96
- ``,
97
- ...data.signals.map((s, i) => [
98
- `[${i+1}] ${s.name}`,
99
- ` Alpha Score : ${fmt(s.alpha_score)}/100 | Class: ${s.entry_class}`,
100
- ` Phase : ${s.phase} | Regime: ${s.regime}`,
101
- ` 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) => [
102
70
  ``,
103
- ` HOLDER SIGNALS:`,
104
- ` Whale : ${fmtD(s.whale_delta)} (${fmt(s.whale_pct)}% of supply)`,
105
- ` Dolphin : ${fmtD(s.dolphin_delta)} (${fmt(s.dolphin_pct)}% of supply)`,
106
- ` Shrimp : ${fmtD(s.shrimp_delta)} (negative = smart money replacing retail)`,
71
+ `[${String(i+1).padStart(2,'0')}] \${t.name}`,
72
+ ` CA : \${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`,
107
79
  ``,
108
- ` SUB-SCORES:`,
109
- ` 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)`,
110
84
  ``,
111
- ` RISK FLAGS:`,
112
- ` 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}`,
113
89
  ``,
114
- ` MARKET DATA:`,
115
- ` Market Cap : ${fmtMC(s.market_cap_usd)}`,
116
- ` Price : ${fmtPrice(s.price_usd)}`,
117
- ` Drop/Peak : ${s.price_drop_pct != null ? fmt(s.price_drop_pct)+'%' : 'N/A'}`,
118
- ` CA : ${s.token_address}`,
90
+ ` --- RISK FLAGS ---`,
91
+ ` RISK_LIQUIDITY : ${risk(t.risk_liquidity_pct)}`,
92
+ ` RISK_TRAP : ${risk(t.risk_trap_pct)}`,
119
93
  ``,
120
- ` SIGNAL: ${entryAdvice(s)}`,
121
- ``,
122
- ` View full token detail: https://cryptoiz.org`,
123
- `───────────────────────────────────────────────`,
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
+ `─────────────────────────────────────────────────────────`,
124
101
  ].join('\n')),
125
102
  ``,
126
- `NOTE: This is NOT financial advice. Always DYOR.`,
127
- `For real-time alerts, premium signals & full analysis:`,
128
- `>>> https://cryptoiz.org | Subscribe from $15/week <<<`,
129
- `Twitter: @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
103
+ `NOTE: Not financial advice. Always DYOR.`,
104
+ `FULL DASHBOARD WITH CHARTS: https://cryptoiz.org`,
130
105
  ];
131
- return out.join('\n');
106
+ return lines.join('\n');
132
107
  }
133
108
 
134
109
  function formatDivergence(data) {
135
- if (data.error) return `ERROR: ${data.error}\nhttps://cryptoiz.org`;
136
- 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
+ ];
137
132
 
138
- const out = [
139
- makeHeader('Divergence Scanner', data.fetched_at?.split('T')[0], data.total),
140
- `═══════════════════════════════════════════════`,
141
- ` CRYPTOIZ DIVERGENCE SCANNER `,
142
- ` Whale/Dolphin vs Price Divergence Detector `,
143
- `═══════════════════════════════════════════════`,
144
- `Date: ${data.fetched_at?.split('T')[0]} | Timeframe: ${data.timeframe?.toUpperCase()} | Total: ${data.total}`,
145
- ``,
146
- `WHAT IS THIS?`,
147
- `Divergence occurs when price moves opposite to smart money.`,
148
- ` BULLISH: Price drops but whales/dolphins are BUYING`,
149
- ` -> Potential reversal UPWARD`,
150
- ` BEARISH: Price rises but whales/dolphins are SELLING`,
151
- ` -> Potential reversal DOWNWARD`,
152
- ``,
153
- `For the FULL divergence dashboard with charts:`,
154
- `>>> https://cryptoiz.org/Divergence <<<`,
155
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
156
- ``,
157
- `═══════════════════════════════════════════════`,
158
- ``,
159
- ...data.signals.map((s, i) => {
160
- const type = s.divergence_type === 'bullish' ? 'BULLISH [Potential UP]' : s.divergence_type === 'bearish' ? 'BEARISH [Potential DOWN]' : (s.divergence_type||'').toUpperCase();
161
- const advice = s.divergence_type === 'bullish'
162
- ? 'BULLISH DIVERGENCE: Price down but smart money buying. Watch for entry opportunity on reversal confirmation.'
163
- : 'BEARISH DIVERGENCE: Price up but smart money selling. Be cautious if holding this token.';
164
- return [
165
- `[${i+1}] ${s.name||s.symbol} — ${type}`,
166
- ` Divergence Score : ${fmt(s.divergence_score)} | Confidence: ${fmt(s.confidence_score)}%`,
167
- ` Phase : ${s.phase_label}`,
168
- ``,
169
- ` HOLDER SIGNALS:`,
170
- ` Whale : ${fmtD(s.whale_delta)} | Dolphin: ${fmtD(s.dolphin_delta)}`,
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([
171
142
  ``,
172
- ` MARKET DATA:`,
173
- ` Market Cap : ${fmtMC(s.market_cap_usd)}`,
174
- ` Price Now : ${fmtPrice(s.price_usd)}`,
175
- ` Price Chg : ${s.price_change_pct ? fmt(s.price_change_pct)+'%' : 'N/A'}`,
176
- ` Detected : ${s.detected_at ? new Date(s.detected_at).toUTCString() : 'N/A'}`,
177
- ` CA : ${s.token_address}`,
143
+ ` [${String(i+1).padStart(2,'0')}] ${s.name}`,
144
+ ` CA: ${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}`,
178
149
  ``,
179
- ` SIGNAL: ${advice}`,
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)}`,
180
153
  ``,
181
- ` View on CryptoIZ: https://cryptoiz.org/Divergence`,
182
- `───────────────────────────────────────────────`,
183
- ].join('\n');
184
- }),
185
- ``,
186
- `NOTE: This is NOT financial advice. Always DYOR.`,
187
- `Full divergence scanner with real-time data:`,
188
- `>>> https://cryptoiz.org | @cryptoiz_IDN <<<`,
189
- ];
190
- 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');
191
171
  }
192
172
 
193
173
  function formatAccumulation(data) {
194
- if (data.error) return `ERROR: ${data.error}\nhttps://cryptoiz.org`;
195
- if (!data.tokens?.length) return `No tokens in accumulation phase found.\n\nFull dashboard: https://cryptoiz.org\nFollow: @cryptoiz_IDN`;
196
-
197
- const out = [
198
- makeHeader('Accumulation Dashboard', data.fetched_at?.split('T')[0], data.total),
199
- `═══════════════════════════════════════════════`,
200
- ` CRYPTOIZ ACCUMULATION DASHBOARD `,
201
- ` Smart Money Accumulation Phase Detector `,
202
- `═══════════════════════════════════════════════`,
203
- `Date: ${data.fetched_at?.split('T')[0]} | Total Tokens: ${data.total}`,
204
- ``,
205
- `WHAT IS THIS?`,
206
- `CryptoIZ Accumulation Dashboard detects tokens in active`,
207
- `accumulation phase using 4 proprietary dimensions:`,
208
- ` - Structure Score : Price action & holder tier patterns`,
209
- ` - AccDist Score : Accumulation vs distribution ratio`,
210
- ` - Holder Score : Holder quality & consistency`,
211
- ` - Market Score : Market conditions & volume`,
212
- `Composite Score = weighted average of all 4 dimensions.`,
213
- ``,
214
- `For the full accumulation dashboard with real-time charts:`,
215
- `>>> https://cryptoiz.org/Dashboard <<<`,
216
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
217
- ``,
218
- `═══════════════════════════════════════════════`,
219
- ``,
220
- ...data.tokens.map((t, i) => {
221
- const advice = t.strength_label?.includes('VERY_STRONG')
222
- ? 'VERY STRONG: Highest priority accumulation signal. Smart money very active.'
223
- : t.strength_label?.includes('STRONG')
224
- ? 'STRONG: Active accumulation detected. Good entry opportunity candidate.'
225
- : 'FORMING: Early accumulation forming. Monitor for confirmation.';
226
- return [
227
- `[${i+1}] ${t.name}`,
228
- ` Composite Score : ${fmt(t.composite_score)}/100`,
229
- ` Strength : ${t.strength_label}`,
230
- ` AccDist Status : ${t.accdist_label} (Score: ${fmt(t.accdist_score)})`,
231
- ``,
232
- ` SUB-SCORES:`,
233
- ` Structure: ${fmt(t.structure_score)} | Holder: ${fmt(t.holder_score)} | Market: ${fmt(t.market_score)}`,
234
- ``,
235
- ` CA: ${t.token_address}`,
236
- ``,
237
- ` SIGNAL: ${advice}`,
238
- ``,
239
- ` View on CryptoIZ: https://cryptoiz.org`,
240
- `───────────────────────────────────────────────`,
241
- ].join('\n');
242
- }),
243
- ``,
244
- `NOTE: This is NOT financial advice. Always DYOR.`,
245
- `Real-time accumulation alerts & full platform:`,
246
- `>>> https://cryptoiz.org | Subscribe from $15/week <<<`,
247
- `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
+ ` CA : \${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`,
248
224
  ];
249
- return out.join('\n');
225
+ return lines.join('\n');
250
226
  }
251
227
 
252
228
  function formatBTC(data) {
253
- if (data.error) return `ERROR: ${data.error}\nhttps://cryptoiz.org/BTC`;
254
- const s = data.btc_signal || {};
255
- const f = data.futures_signal || {};
256
- const ind = data.indicators || {};
257
- const stateLabel = s.state === 'bull' ? 'BULLISH' : s.state === 'bear' ? 'BEARISH' : 'NEUTRAL';
258
- const altAdvice = s.state === 'bull'
259
- ? 'BTC is BULLISH -> Favorable conditions for Solana altcoin entries.\n Focus on tokens with high Alpha Score on CryptoIZ Alpha Scanner.'
260
- : s.state === 'bear'
261
- ? 'BTC is BEARISH -> Be CAUTIOUS with altcoin entries.\n Prioritize tokens with high Safety Score and low liquidity risk.'
262
- : '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.';
263
237
 
264
- const out = [
265
- makeHeader('BTC Regime Monitor', data.fetched_at?.split('T')[0], 1),
266
- `═══════════════════════════════════════════════`,
267
- ` CRYPTOIZ BTC REGIME MONITOR `,
268
- ` Bitcoin Market Condition for Altcoin Traders`,
269
- `═══════════════════════════════════════════════`,
270
- `Date: ${data.fetched_at?.split('T')[0]}`,
271
- ``,
272
- `WHAT IS THIS?`,
273
- `CryptoIZ BTC Regime Monitor analyzes Bitcoin macro conditions`,
274
- `to help you understand whether the market is bullish, bearish,`,
275
- `or neutral. BTC regime directly impacts Solana altcoin moves.`,
276
- ``,
277
- `For full BTC analysis with charts & indicators:`,
278
- `>>> https://cryptoiz.org/BTC <<<`,
279
- `Follow: Twitter/X @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
280
- ``,
281
- `═══════════════════════════════════════════════`,
282
- ``,
283
- `CURRENT BTC REGIME: ${stateLabel}`,
284
- ``,
285
- ` BTC Price : $${s.last_price ? parseFloat(s.last_price).toLocaleString() : 'N/A'}`,
286
- ` BTC Score : ${s.score || 'N/A'} / 10 (0=extreme bear, 10=extreme bull)`,
287
- ` Trend : ${(s.trend||'N/A').toUpperCase()}`,
288
- ``,
289
- `MARKET SENTIMENT:`,
290
- ` Fear & Greed Index : ${s.fear_value || 'N/A'} / 100 — ${s.fear_label || 'N/A'}`,
291
- ` Context: ${
292
- s.fear_value <= 25 ? 'Extreme Fear zone historically a strong BUY opportunity area for patient investors.' :
293
- s.fear_value >= 75 ? 'Extreme Greedmarket may be overheated, reversal risk is elevated.' :
294
- '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.'
295
268
  }`,
296
269
  ``,
297
- `FUTURES MARKET:`,
298
- ` Signal : ${f.signal || 'N/A'}`,
299
- ` OI Regime : ${f.oi_regime || 'N/A'}`,
300
- ` Funding : ${f.funding_regime || 'N/A'}`,
301
- ` Perp Price : $${f.perp_price ? parseFloat(f.perp_price).toLocaleString() : 'N/A'}`,
302
- ` Context : ${f.reason || 'N/A'}`,
303
- ``,
304
- ind.rsi ? [
305
- `TECHNICAL INDICATORS (1H):`,
306
- ` RSI : ${fmt(ind.rsi)} ${parseFloat(ind.rsi) < 30 ? '(Oversold — potential bounce)' : parseFloat(ind.rsi) > 70 ? '(Overbought — caution)' : '(Normal range)'}`,
307
- ` EMA 20 : $${ind.ema_20 ? parseFloat(ind.ema_20).toLocaleString() : 'N/A'}`,
308
- ` EMA 50 : $${ind.ema_50 ? parseFloat(ind.ema_50).toLocaleString() : 'N/A'}`,
309
- ` MACD : ${fmt(ind.macd)} | Signal: ${fmt(ind.macd_signal)} | Hist: ${fmt(ind.macd_hist)}`,
310
- ``,
311
- ].join('\n') : '',
312
- `ALTCOIN RECOMMENDATION:`,
313
- ` ${altAdvice}`,
314
- ``,
315
- ` Check CryptoIZ Alpha Scanner for best Solana entry signals:`,
316
- ` >>> https://cryptoiz.org/Alpha-Scanner <<<`,
317
- ``,
318
- `═══════════════════════════════════════════════`,
319
- `NOTE: This is NOT financial advice. Always DYOR.`,
320
- `Full BTC monitor + Solana signals platform:`,
321
- `>>> https://cryptoiz.org | Plans from $15/week <<<`,
322
- `Twitter: @cryptoiz_IDN | Telegram: t.me/agus_artemiss`,
323
- ];
324
- 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');
325
296
  }
326
297
 
327
298
  function formatStatus() {
328
299
  return [
329
- `═══════════════════════════════════════════════`,
330
- ` CryptoIZ MCP Server v2.2.0 `,
331
- ` AI-Powered Solana DEX Trading Signals `,
332
- `═══════════════════════════════════════════════`,
333
- ``,
334
- `CONNECTION STATUS:`,
335
- ` Status : CONNECTED to CryptoIZ Data Engine`,
336
- ` Payment : ${SVM_PRIVATE_KEY ? 'READY — x402 Solana USDC autopay' : 'NOT SET — add SVM_PRIVATE_KEY to config'}`,
337
- ` Price : $0.01 USDC per tool call`,
338
- ` Wallet : DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX`,
339
- ``,
340
- `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
+ ``,
341
317
  ` 1. get_alpha_scanner`,
342
- ` Strongest Solana token signals with smart money analysis`,
343
- ` 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`,
344
323
  ``,
345
324
  ` 2. get_divergence`,
346
- ` Bullish/bearish divergence between price & whale/dolphin activity`,
347
- ` 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`,
348
330
  ``,
349
331
  ` 3. get_accumulation`,
350
- ` Tokens in active accumulation phase composite score analysis`,
351
- ` 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`,
352
336
  ``,
353
337
  ` 4. get_btc_regime`,
354
- ` Bitcoin macro regime — Fear & Greed, OI, funding, indicators`,
355
- ` 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`,
356
342
  ``,
357
343
  ` 5. get_status — This info`,
358
344
  ``,
359
- `HOW TO USE:`,
360
- ` "Show me today's strongest Solana signals"`,
361
- ` "Any bullish divergence on 4h timeframe?"`,
362
- ` "Which tokens are whales accumulating right now?"`,
363
- ` "What is BTC market condition?"`,
364
- ``,
365
- `ABOUT CRYPTOIZ:`,
366
- ` CryptoIZ is an AI-powered Solana DEX trading platform.`,
367
- ` This MCP gives you a PREVIEW of our signals.`,
368
- ` For full access with real-time charts, alerts & VIP Telegram:`,
369
- ``,
370
- ` >>> https://cryptoiz.org | Plans from $15/week <<<`,
371
- ` Twitter : @cryptoiz_IDN`,
372
- ` Telegram: t.me/agus_artemiss`,
373
- `═══════════════════════════════════════════════`,
345
+ `PLATFORM PLANS:`,
346
+ ` 1 Week : $15 | 1 Month : $50`,
347
+ ` 3 Months : $120 | 1 Year : $400`,
348
+ ` URL: https://cryptoiz.org/Pricing`,
374
349
  ].join('\n');
375
350
  }
376
351
 
377
352
  const TOOLS = [
378
- { 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: [] } },
379
- { 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: [] } },
380
- { 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: [] } },
381
- { 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: [] } },
382
- { 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: [] } },
383
358
  ];
384
359
 
385
- const server = new Server({ name: 'cryptoiz-mcp', version: '2.4.0' }, { capabilities: { tools: {} } });
360
+ const server = new Server({ name: 'cryptoiz-mcp', version: '3.0.1' }, { capabilities: { tools: {} } });
386
361
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
387
362
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
388
363
  const { name, arguments: args } = request.params;
@@ -390,8 +365,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
390
365
  if (name === 'get_status') return { content: [{ type: 'text', text: formatStatus() }] };
391
366
  if (name === 'get_alpha_scanner') {
392
367
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_alpha_scanner`);
393
- if (args?.min_score && data.signals) { data.signals = data.signals.filter(s => s.alpha_score >= args.min_score); data.total = data.signals.length; }
394
- 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; }
395
370
  return { content: [{ type: 'text', text: formatAlpha(data) }] };
396
371
  }
397
372
  if (name === 'get_divergence') {
@@ -403,7 +378,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
403
378
  }
404
379
  if (name === 'get_accumulation') {
405
380
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_accumulation`);
406
- 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; }
407
382
  return { content: [{ type: 'text', text: formatAccumulation(data) }] };
408
383
  }
409
384
  if (name === 'get_btc_regime') {