cryptoiz-mcp 3.0.2 → 3.2.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 +311 -228
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "3.0.2",
3
+ "version": "3.2.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
@@ -33,238 +33,287 @@ async function payAndFetch(url) {
33
33
  }
34
34
  }
35
35
 
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';
36
+ const N = (v, d=2) => v != null && v !== 'N/A' ? parseFloat(v).toFixed(d) : 'N/A';
37
+ const sign = v => { const n = parseFloat(v); return n > 0 ? `+${n}` : `${n}`; };
38
+ const risk = (v, label) => parseFloat(v||0) > 0 ? `⚠ WARNING ${parseFloat(v).toFixed(1)}% — ${label}` : 'CLEAR';
39
+ const mc = v => v || 'N/A';
40
+ const pct = v => v != null ? `${parseFloat(v).toFixed(2)}%` : 'N/A';
39
41
 
40
- // ═══ FORMATTERS ═══
42
+ const HEADER = (tool, subtitle, url) => [
43
+ `╔══════════════════════════════════════════════════════════════╗`,
44
+ `║ CRYPTOIZ — ${tool.padEnd(49)}║`,
45
+ `║ ${subtitle.padEnd(62)}║`,
46
+ `╠══════════════════════════════════════════════════════════════╣`,
47
+ `║ PLATFORM : https://cryptoiz.org${' '.repeat(27)}║`,
48
+ `║ FULL DATA : https://cryptoiz.org/${url.padEnd(26)}║`,
49
+ `║ SUBSCRIBE : https://cryptoiz.org/Pricing (from $15/week) ║`,
50
+ `║ TWITTER : @cryptoiz_IDN ║`,
51
+ `║ TELEGRAM : https://t.me/agus_artemiss ║`,
52
+ `╚══════════════════════════════════════════════════════════════╝`,
53
+ ].join('\n');
41
54
 
55
+ const FOOTER = `\n⚠ NOT FINANCIAL ADVICE. Always DYOR before trading.\nPowered by CryptoIZ AI — https://cryptoiz.org | @cryptoiz_IDN`;
56
+
57
+ const CA_LINE = (addr) => ` ┌─ COPY TO TRADE (paste on Jupiter/Raydium — do NOT click) ─┐
58
+ │ ${addr} │
59
+ └───────────────────────────────────────────────────────────┘`;
60
+
61
+ // ══════════════════════════════════════════════════════════════════
62
+ // ALPHA SCANNER
63
+ // ══════════════════════════════════════════════════════════════════
42
64
  function formatAlpha(data) {
43
- if (data.error) return `ERROR: ${data.error}`;
65
+ if (data.error) return `ERROR: ${data.error}\nSetup: https://cryptoiz.org`;
44
66
  const s = data.signals || [];
67
+
45
68
  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) => [
70
- ``,
71
- `[${String(i+1).padStart(2,'0')}] \${t.name} | CA: \${t.contract_address}`,
72
- ` ALPHA_SCORE : ${t.alpha_score} / 100`,
73
- ` SIGNAL_CLASS : ${t.signal_class}`,
74
- ` CURRENT_PHASE : ${t.phase}`,
75
- ` REGIME : ${t.regime}`,
76
- ` PHASE_CONFIDENCE : ${t.phase_confidence_pct}%`,
77
- ` PHASE_AGE : ${t.phase_age_bars} bars`,
78
- ``,
79
- ` --- HOLDER SIGNALS ---`,
80
- ` WHALE_DELTA : ${sign(t.whale_delta)} (now holds ${t.whale_supply_pct}% of supply)`,
81
- ` DOLPHIN_DELTA : ${sign(t.dolphin_delta)} (now holds ${t.dolphin_supply_pct}% of supply)`,
82
- ` SHRIMP_DELTA : ${sign(t.shrimp_delta)} (negative = retail exiting = bullish)`,
83
- ``,
84
- ` --- SUB-SCORES ---`,
85
- ` SCORE_ACCUMULATION : ${t.score_accumulation}`,
86
- ` SCORE_TIMING : ${t.score_timing}`,
87
- ` SCORE_SAFETY : ${t.score_safety}`,
88
- ``,
89
- ` --- RISK FLAGS ---`,
90
- ` RISK_LIQUIDITY : ${risk(t.risk_liquidity_pct)}`,
91
- ` RISK_TRAP : ${risk(t.risk_trap_pct)}`,
92
- ``,
93
- ` --- MARKET DATA ---`,
94
- ` MARKET_CAP_NOW : ${t.market_cap_now || 'N/A'}`,
95
- ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
96
- ` PRICE_DROP_FROM_PEAK : ${t.price_drop_from_peak_pct ? t.price_drop_from_peak_pct+'%' : 'N/A'}`,
97
- ` MC_WHEN_SIGNAL_FORMED : ${t.market_cap_when_signal_formed || 'N/A'}`,
98
- ` PRICE_WHEN_SIGNAL_FORMED: $${t.price_when_signal_formed_usd || 'N/A'}`,
99
- `─────────────────────────────────────────────────────────`,
100
- ].join('\n')),
101
- ``,
102
- `NOTE: Not financial advice. Always DYOR.`,
103
- `FULL DASHBOARD WITH CHARTS: https://cryptoiz.org`,
69
+ HEADER('ALPHA ENTRY SCANNER', 'AI Smart Money Signal Detector for Solana DEX', 'Alpha-Scanner'),
70
+ ``,
71
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
72
+ `TOTAL SIGNALS : ${data.total_signals}`,
73
+ ``,
74
+ `HOW TO READ:`,
75
+ ` ALPHA_SCORE = Overall strength 0-100 (higher = stronger signal)`,
76
+ ` SIGNAL_CLASS = ALPHA_EARLY (best) > ALPHA_BUILDING > WATCHLIST_ONLY`,
77
+ ` Score Accum = How actively smart money is entering (0-100)`,
78
+ ` Score Timing = How optimal the entry timing is right now (0-100)`,
79
+ ` Score Safety = Protection from manipulation & fake signals (0-100)`,
80
+ ` Whale/Dolphin = Smart money tiers: Whale > Dolphin > Shrimp (retail)`,
81
+ ` Delta (+/-) = Net change in holder count this period`,
82
+ ` Drop/Peak = Price drop from all-time-high in this period`,
83
+ ``,
84
+ `═══════════════════════════════════════════════════════════════`,
85
+ ``,
86
+ ...s.map((t, i) => {
87
+ const urgency = parseFloat(t.alpha_score) >= 85 ? '🔥 HIGH CONVICTION' :
88
+ parseFloat(t.alpha_score) >= 75 ? '⚡ STRONG SIGNAL' :
89
+ parseFloat(t.alpha_score) >= 65 ? '👁 WATCH' : '📋 MONITOR';
90
+ return [
91
+ `[${String(i+1).padStart(2,'0')}] ${t.name || 'Unknown'} — ${urgency}`,
92
+ CA_LINE(t.contract_address || 'N/A'),
93
+ ``,
94
+ ` SIGNAL_CLASS : ${t.signal_class}`,
95
+ ` ALPHA_SCORE : ${N(t.alpha_score)} / 100`,
96
+ ` CURRENT_PHASE : ${t.phase || 'N/A'}`,
97
+ ` REGIME : ${t.regime || 'N/A'}`,
98
+ ` PHASE_CONFIDENCE : ${pct(t.phase_confidence_pct)}`,
99
+ ` PHASE_AGE : ${t.phase_age_bars} bars`,
100
+ ``,
101
+ ` ── HOLDER SIGNALS ──────────────────────────────────`,
102
+ ` WHALE_DELTA : ${sign(t.whale_delta)} (holds ${pct(t.whale_supply_pct)} of supply)`,
103
+ ` DOLPHIN_DELTA : ${sign(t.dolphin_delta)} (holds ${pct(t.dolphin_supply_pct)} of supply)`,
104
+ ` SHRIMP_DELTA : ${sign(t.shrimp_delta)} (negative = retail exiting = bullish sign)`,
105
+ ``,
106
+ ` ── SUB-SCORES ──────────────────────────────────────`,
107
+ ` SCORE_ACCUMULATION : ${N(t.score_accumulation)}`,
108
+ ` SCORE_TIMING : ${N(t.score_timing)}`,
109
+ ` SCORE_SAFETY : ${N(t.score_safety)}`,
110
+ ``,
111
+ ` ── RISK FLAGS ──────────────────────────────────────`,
112
+ ` RISK_LIQUIDITY : ${risk(t.risk_liquidity_pct, 'exit may be difficult')}`,
113
+ ` RISK_TRAP : ${risk(t.risk_trap_pct, 'possible smart money trap')}`,
114
+ ``,
115
+ ` ── MARKET DATA ─────────────────────────────────────`,
116
+ ` MARKET_CAP_NOW : ${mc(t.market_cap_now)}`,
117
+ ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
118
+ ` PRICE_DROP_FROM_PEAK : ${t.price_drop_from_peak_pct ? N(t.price_drop_from_peak_pct)+'%' : 'N/A'}`,
119
+ ` MC_WHEN_SIGNAL_FORMED : ${mc(t.market_cap_when_signal_formed)}`,
120
+ ` PRICE_WHEN_SIGNAL_FORMED: $${t.price_when_signal_formed_usd || 'N/A'}`,
121
+ ``,
122
+ `═══════════════════════════════════════════════════════════`,
123
+ ].join('\n');
124
+ }),
125
+ FOOTER,
104
126
  ];
105
127
  return lines.join('\n');
106
128
  }
107
129
 
130
+ // ══════════════════════════════════════════════════════════════════
131
+ // DIVERGENCE SCANNER
132
+ // ══════════════════════════════════════════════════════════════════
108
133
  function formatDivergence(data) {
109
134
  if (data.error) return `ERROR: ${data.error}`;
135
+ const byType = data.signals_by_type || {};
136
+ const total = data.total_signals || 0;
137
+
110
138
  const lines = [
111
- `╔═══════════════════════════════════════════════════════════╗`,
112
- `║ CRYPTOIZ DIVERGENCE SCANNER — v3 ║`,
113
- `║ Smart Money vs Price Divergence Detector ║`,
114
- `╠═══════════════════════════════════════════════════════════╣`,
115
- `║ PLATFORM : https://cryptoiz.org/Divergence ║`,
116
- `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
117
- `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
118
- `╚═══════════════════════════════════════════════════════════╝`,
119
- ``,
120
- `DATE : ${data.fetched_at?.split('T')[0]}`,
121
- `TIMEFRAME : ${data.timeframe?.toUpperCase()}`,
122
- `TOTAL SIGNALS: ${data.total_signals}`,
123
- ``,
124
- `DIVERGENCE TYPES EXPLAINED:`,
125
- ` HIDDEN_ACCUMULATION = Price flat/weak but whales quietly buying. Stealth entry before the move.`,
126
- ` BREAKOUT_ACCUMULATION= Whales buying aggressively on price breakout. Strong momentum entry.`,
127
- ` CLASSIC_DIVERGENCE = Price & smart money moving in opposite directions. High reversal potential.`,
128
- ``,
129
- `═══════════════════════════════════════════════════════════`,
139
+ HEADER('DIVERGENCE SCANNER', 'Smart Money vs Price Divergence Detector', 'Divergence'),
140
+ ``,
141
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
142
+ `TIMEFRAME : ${(data.timeframe||'4h').toUpperCase()}`,
143
+ `TOTAL SIGNALS : ${total}`,
144
+ ``,
145
+ `DIVERGENCE TYPES:`,
146
+ ` HIDDEN_ACCUMULATION = Price flat/weak but smart money quietly buying.`,
147
+ ` Stealth entry BEFORE the upward move.`,
148
+ ` BREAKOUT_ACCUMULATION = Whales buying aggressively on price breakout.`,
149
+ ` Momentum-driven entry with strong conviction.`,
150
+ ` CLASSIC_DIVERGENCE = Price and smart money moving in OPPOSITE directions.`,
151
+ ` High reversal potential — watch closely.`,
152
+ ``,
153
+ `HOW TO READ:`,
154
+ ` Divergence Score = Strength of the divergence (higher = stronger)`,
155
+ ` Confidence % = AI confidence in the signal`,
156
+ ` Whale Now/Prev = Absolute whale holder count change`,
157
+ ` Price Change % = Price movement this period`,
158
+ ``,
159
+ `═══════════════════════════════════════════════════════════════`,
130
160
  ];
131
161
 
132
- const byType = data.signals_by_type || {};
133
- const typeOrder = ['HIDDEN_ACCUMULATION', 'BREAKOUT_ACCUMULATION', 'CLASSIC_DIVERGENCE'];
134
-
162
+ if (!total) {
163
+ lines.push(`\nNo divergence signals detected at this time.`);
164
+ lines.push(`This is normal during low-volatility/sideways markets.`);
165
+ lines.push(`Try again in a few hours or switch to 1d timeframe.`);
166
+ lines.push(FOOTER);
167
+ return lines.join('\n');
168
+ }
169
+
170
+ const typeOrder = ['HIDDEN_ACCUMULATION','BREAKOUT_ACCUMULATION','CLASSIC_DIVERGENCE'];
171
+ const typeDesc = {
172
+ HIDDEN_ACCUMULATION: 'Price appears weak but smart money is secretly buying — stealth setup',
173
+ BREAKOUT_ACCUMULATION: 'Whales chasing breakouts — momentum-driven, high conviction entry',
174
+ CLASSIC_DIVERGENCE: 'Price vs smart money in opposite directions — strong reversal signal',
175
+ };
176
+
135
177
  typeOrder.forEach(type => {
136
178
  const sigs = byType[type] || [];
137
179
  if (!sigs.length) return;
138
- lines.push(``, `▶ ${type} (${sigs.length} signals)`, `─────────────────────────────────────────────────────────`);
180
+ lines.push(`\n▶▶ ${type} ${sigs.length} signal(s)`);
181
+ lines.push(` ${typeDesc[type]}`);
182
+ lines.push(`───────────────────────────────────────────────────────────`);
183
+
139
184
  sigs.forEach((s, i) => {
185
+ const urgency = parseFloat(s.divergence_score) > 300 ? '🔥 VERY HIGH' :
186
+ parseFloat(s.divergence_score) > 100 ? '⚡ HIGH' :
187
+ parseFloat(s.divergence_score) > 50 ? '👁 MODERATE' : '📋 LOW';
140
188
  lines.push([
141
189
  ``,
142
- ` [${String(i+1).padStart(2,'0')}] ${s.name} | CA: ${s.contract_address}`,
143
- ` DIVERGENCE_TYPE : ${s.divergence_type}`,
144
- ` DIVERGENCE_SCORE : ${s.divergence_score}`,
145
- ` CONFIDENCE : ${s.confidence_pct}%`,
146
- ` CURRENT_PHASE : ${s.current_phase}`,
190
+ ` [${String(i+1).padStart(2,'0')}] ${s.name || 'Unknown'} — Signal Strength: ${urgency}`,
191
+ CA_LINE(s.contract_address || 'N/A'),
192
+ ``,
193
+ ` DIVERGENCE_TYPE : ${s.divergence_type}`,
194
+ ` DIVERGENCE_SCORE : ${N(s.divergence_score)}`,
195
+ ` CONFIDENCE : ${pct(s.confidence_pct)}`,
196
+ ` CURRENT_PHASE : ${s.current_phase || 'N/A'}`,
147
197
  ``,
148
- ` --- HOLDER MOVEMENT ---`,
149
- ` WHALE_HOLDERS_NOW : ${s.whale_holders_now} (was: ${s.whale_holders_prev}, delta: ${sign(s.whale_delta)})`,
150
- ` DOLPHIN_DELTA : ${sign(s.dolphin_delta)}`,
198
+ ` ── HOLDER MOVEMENT ──────────────────────────────`,
199
+ ` WHALE_HOLDERS_NOW : ${s.whale_holders_now || 'N/A'} wallets`,
200
+ ` WHALE_HOLDERS_PREV : ${s.whale_holders_prev || 'N/A'} wallets`,
201
+ ` WHALE_DELTA : ${sign(s.whale_delta)} (new whales entering)`,
202
+ ` DOLPHIN_DELTA : ${sign(s.dolphin_delta)}`,
151
203
  ``,
152
- ` --- PRICE DATA ---`,
153
- ` PRICE_NOW : $${s.price_now_usd}`,
154
- ` PRICE_PREV_PERIOD : $${s.price_prev_usd}`,
155
- ` PRICE_CHANGE : ${s.price_change_pct}%`,
156
- ` MARKET_CAP : ${s.market_cap_usd || 'N/A'}`,
157
- ` DETECTED : ${s.detected}`,
204
+ ` ── PRICE & MARKET ───────────────────────────────`,
205
+ ` PRICE_NOW : $${s.price_now_usd || 'N/A'}`,
206
+ ` PRICE_PREV_PERIOD : $${s.price_prev_usd || 'N/A'}`,
207
+ ` PRICE_CHANGE : ${pct(s.price_change_pct)}`,
208
+ ` MARKET_CAP : ${s.market_cap_usd || 'N/A'}`,
209
+ ` SIGNAL_AGE : ${s.detected || 'N/A'}`,
210
+ ``,
211
+ `───────────────────────────────────────────────────────────`,
158
212
  ].join('\n'));
159
213
  });
160
- lines.push(`─────────────────────────────────────────────────────────`);
161
214
  });
162
215
 
163
- if (!data.total_signals) {
164
- 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.`);
165
- }
166
-
167
- lines.push(``, `NOTE: Not financial advice. Always DYOR.`, `FULL DIVERGENCE DASHBOARD: https://cryptoiz.org/Divergence`);
216
+ lines.push(FOOTER);
168
217
  return lines.join('\n');
169
218
  }
170
219
 
220
+ // ══════════════════════════════════════════════════════════════════
221
+ // ACCUMULATION DASHBOARD
222
+ // ══════════════════════════════════════════════════════════════════
171
223
  function formatAccumulation(data) {
172
224
  if (data.error) return `ERROR: ${data.error}`;
173
225
  const tokens = data.tokens || [];
226
+
174
227
  const lines = [
175
- `╔═══════════════════════════════════════════════════════════╗`,
176
- `║ CRYPTOIZ ACCUMULATION DASHBOARD — v3 ║`,
177
- `║ 4-Dimension Smart Money Accumulation Detector ║`,
178
- `╠═══════════════════════════════════════════════════════════╣`,
179
- `║ PLATFORM : https://cryptoiz.org/Dashboard ║`,
180
- `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
181
- `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
182
- `╚═══════════════════════════════════════════════════════════╝`,
228
+ HEADER('ACCUMULATION DASHBOARD', '4-Dimension Smart Money Accumulation Detector', 'Dashboard'),
183
229
  ``,
184
230
  `DATE : ${data.fetched_at?.split('T')[0]}`,
185
231
  `TOTAL TOKENS : ${data.total_tokens}`,
186
232
  ``,
187
- `COMPOSITE SCORE = Weighted average of 4 dimensions:`,
188
- ` Structure Score = Price action & holder tier pattern quality`,
189
- ` AccDist Score = Accumulation vs distribution ratio`,
190
- ` Holder Score = Holder quality, loyalty & consistency`,
191
- ` Market Score = Market conditions, volume & momentum`,
233
+ `4-DIMENSION SCORING SYSTEM:`,
234
+ ` Structure Score = Price action quality & holder tier patterns (0-100)`,
235
+ ` AccDist Score = Accumulation vs distribution balance (0-100)`,
236
+ ` Holder Score = Holder loyalty, quality & consistency (0-100)`,
237
+ ` Market Score = Market conditions, volume & momentum (0-100)`,
238
+ ` Composite Score = Weighted average of all 4 dimensions`,
192
239
  ``,
193
240
  `STRENGTH LABELS:`,
194
- ` VERY_STRONG_SMART_MONEY = Highest conviction — act now`,
241
+ ` VERY_STRONG_SMART_MONEY = Highest conviction — priority entry`,
195
242
  ` STRONG_SMART_MONEY_FORMING = Strong signal — monitor closely`,
196
- ` FORMING = Early stage — needs confirmation`,
197
- ` WEAK_OR_NOISY = Low confidence — skip for now`,
198
- ``,
199
- `═══════════════════════════════════════════════════════════`,
200
- ...tokens.map((t, i) => [
201
- ``,
202
- `[${String(i+1).padStart(2,'0')}] \${t.name} | CA: \${t.contract_address}`,
203
- ` ACCUMULATION : ${t.accumulation_strength}`,
204
- ` ACCDIST_STATUS : ${t.accdist_status}`,
205
- ``,
206
- ` --- COMPOSITE SCORE: ${t.score_composite} / 100 ---`,
207
- ` SCORE_STRUCTURE : ${t.score_structure}`,
208
- ` SCORE_ACCDIST : ${t.score_accdist}`,
209
- ` SCORE_HOLDER : ${t.score_holder}`,
210
- ` SCORE_MARKET : ${t.score_market}`,
211
- ``,
212
- ` --- MARKET DATA ---`,
213
- ` MARKET_CAP_NOW : ${t.market_cap_now || 'N/A'}`,
214
- ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
215
- ` LAST_UPDATED : ${t.last_updated || 'N/A'}`,
216
- `─────────────────────────────────────────────────────────`,
217
- ].join('\n')),
218
- ``,
219
- `NOTE: Not financial advice. Always DYOR.`,
220
- `FULL ACCUMULATION DASHBOARD: https://cryptoiz.org`,
243
+ ` FORMING = Early stage — needs confirmation`,
244
+ ` WEAK_OR_NOISY = Low confidence — skip`,
245
+ ``,
246
+ `═══════════════════════════════════════════════════════════════`,
247
+ ``,
248
+ ...tokens.map((t, i) => {
249
+ const urgency = t.accumulation_strength?.includes('VERY_STRONG') ? '🔥 VERY STRONG' :
250
+ t.accumulation_strength?.includes('STRONG') ? '⚡ STRONG FORMING' :
251
+ t.accumulation_strength?.includes('FORMING') ? '👁 FORMING' : '📋 WEAK/NOISY';
252
+ return [
253
+ `[${String(i+1).padStart(2,'0')}] ${t.name || 'Unknown'} ${urgency}`,
254
+ CA_LINE(t.contract_address || 'N/A'),
255
+ ``,
256
+ ` ACCUMULATION_STRENGTH : ${t.accumulation_strength || 'N/A'}`,
257
+ ` ACCDIST_STATUS : ${t.accdist_status || 'N/A'}`,
258
+ ``,
259
+ ` ── COMPOSITE SCORE: ${N(t.score_composite)} / 100 ─────────────────`,
260
+ ` SCORE_STRUCTURE : ${N(t.score_structure)}`,
261
+ ` SCORE_ACCDIST : ${N(t.score_accdist)}`,
262
+ ` SCORE_HOLDER : ${N(t.score_holder)}`,
263
+ ` SCORE_MARKET : ${N(t.score_market)}`,
264
+ ``,
265
+ ` ── MARKET DATA ─────────────────────────────────────`,
266
+ ` MARKET_CAP_NOW : ${mc(t.market_cap_now)}`,
267
+ ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
268
+ ` LAST_UPDATED : ${t.last_updated || 'N/A'}`,
269
+ ``,
270
+ `═══════════════════════════════════════════════════════════`,
271
+ ].join('\n');
272
+ }),
273
+ FOOTER,
221
274
  ];
222
275
  return lines.join('\n');
223
276
  }
224
277
 
278
+ // ══════════════════════════════════════════════════════════════════
279
+ // BTC REGIME MONITOR
280
+ // ══════════════════════════════════════════════════════════════════
225
281
  function formatBTC(data) {
226
282
  if (data.error) return `ERROR: ${data.error}`;
227
- const regime = data.btc_regime || 'UNKNOWN';
228
- const icon = regime === 'BULL' ? 'BULLISH' : regime === 'BEAR' ? 'BEARISH' : 'NEUTRAL';
229
- const advice = regime === 'BULL'
230
- ? 'BTC BULLISH -> Favorable for altcoin entries. Focus on high Alpha Score tokens.'
283
+ const regime = (data.btc_regime || 'UNKNOWN').toUpperCase();
284
+ const regimeIcon = regime === 'BULL' ? '🟢 BULLISH' : regime === 'BEAR' ? '🔴 BEARISH' : '🟡 NEUTRAL';
285
+ const fgi = parseFloat(data.fear_and_greed_index || 0);
286
+ const fgiContext = fgi <= 25 ? 'Extreme Fear Historically strong contrarian buy zone for patient investors.' :
287
+ fgi >= 75 ? 'Extreme Greed — Market overheated, elevated reversal risk.' :
288
+ 'Neutral zone — Follow technical signals for direction.';
289
+ const altAdvice = regime === 'BULL'
290
+ ? '✅ BTC BULLISH → Favorable for altcoin entries.\n Focus on high Alpha Score tokens on CryptoIZ Alpha Scanner.'
231
291
  : regime === 'BEAR'
232
- ? 'BTC BEARISH -> Be cautious. Prioritize high Safety Score, low Liquidity Risk tokens. Size down.'
233
- : 'BTC NEUTRAL -> Be selective. Wait for signal confirmation before large positions.';
292
+ ? 'BTC BEARISH Be CAUTIOUS.\n Size down. Prioritize Safety Score ≥80 and CLEAR risk flags only.'
293
+ : '🟡 BTC NEUTRAL Be SELECTIVE.\n Wait for signal confirmation before large positions.';
294
+ const rsiVal = parseFloat(data.rsi_1h || 50);
295
+ const rsiNote = rsiVal < 30 ? '(Oversold — potential bounce)' : rsiVal > 70 ? '(Overbought — caution)' : '(Normal range)';
234
296
 
235
297
  return [
236
- `╔═══════════════════════════════════════════════════════════╗`,
237
- `║ CRYPTOIZ BTC REGIME MONITOR — v3 ║`,
238
- `║ Bitcoin Macro Condition for Solana Altcoin Traders ║`,
239
- `╠═══════════════════════════════════════════════════════════╣`,
240
- `║ PLATFORM : https://cryptoiz.org/BTC ║`,
241
- `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
242
- `║ TWITTER : @cryptoiz_IDN | TELEGRAM: t.me/agus_artemiss║`,
243
- `╚═══════════════════════════════════════════════════════════╝`,
298
+ HEADER('BTC REGIME MONITOR', 'Bitcoin Macro Condition for Solana Altcoin Traders', 'BTC'),
244
299
  ``,
245
- `DATE : ${data.fetched_at?.split('T')[0]}`,
300
+ `DATE : ${data.fetched_at?.split('T')[0]}`,
246
301
  ``,
247
- `═══ BTC REGIME: ${icon} ═══`,
302
+ `══════════════ BTC REGIME: ${regimeIcon} ════════════════`,
248
303
  ``,
249
304
  `BTC_PRICE_USD : $${data.btc_price_usd || 'N/A'}`,
250
- `BTC_SCORE : ${data.btc_score} / 10 (0=extreme bear, 10=extreme bull)`,
305
+ `BTC_SCORE : ${data.btc_score} / 10 (0=extreme bear, 10=extreme bull)`,
251
306
  `BTC_TREND : ${data.btc_trend || 'N/A'}`,
252
307
  `OPEN_INTEREST : ${data.open_interest || 'N/A'}`,
253
308
  `FUNDING_RATE : ${data.funding_rate || 'N/A'}`,
254
309
  ``,
255
- `═══ MARKET SENTIMENT ═══`,
310
+ `══════════════ MARKET SENTIMENT ════════════════════════`,
256
311
  ``,
257
312
  `FEAR_GREED_INDEX : ${data.fear_and_greed_index} / 100`,
258
- `FEAR_GREED_LABEL : ${data.fear_and_greed_label}`,
259
- `FEAR_GREED_CONTEXT : ${
260
- data.fear_and_greed_index <= 25
261
- ? 'Extreme Fear zone — historically strong contrarian buy opportunity for patient investors.'
262
- : data.fear_and_greed_index >= 75
263
- ? 'Extreme Greed — market overheated, reversal risk elevated.'
264
- : 'Neutral zone — follow technical signals.'
265
- }`,
313
+ `FEAR_GREED_LABEL : ${data.fear_and_greed_label || 'N/A'}`,
314
+ `FEAR_GREED_CONTEXT : ${fgiContext}`,
266
315
  ``,
267
- `═══ FUTURES MARKET ═══`,
316
+ `══════════════ FUTURES MARKET ══════════════════════════`,
268
317
  ``,
269
318
  `FUTURES_SIGNAL : ${data.futures_signal || 'N/A'}`,
270
319
  `OI_REGIME : ${data.oi_regime || 'N/A'}`,
@@ -272,100 +321,131 @@ function formatBTC(data) {
272
321
  `PERP_PRICE_USD : $${data.perp_price_usd || 'N/A'}`,
273
322
  `FUTURES_CONTEXT : ${data.futures_context || 'N/A'}`,
274
323
  ``,
275
- `═══ TECHNICAL INDICATORS (1H) ═══`,
324
+ `══════════════ TECHNICAL INDICATORS (1H) ═══════════════`,
276
325
  ``,
277
- `RSI_1H : ${data.rsi_1h || 'N/A'}${data.rsi_1h ? (parseFloat(data.rsi_1h) < 30 ? ' (Oversold)' : parseFloat(data.rsi_1h) > 70 ? ' (Overbought)' : ' (Normal)') : ''}`,
326
+ `RSI_1H : ${data.rsi_1h || 'N/A'} ${data.rsi_1h ? rsiNote : ''}`,
278
327
  `EMA20_1H : $${data.ema20_1h || 'N/A'}`,
279
328
  `EMA50_1H : $${data.ema50_1h || 'N/A'}`,
280
329
  `MACD_1H : ${data.macd_1h || 'N/A'}`,
281
330
  `MACD_SIGNAL_1H : ${data.macd_signal_1h || 'N/A'}`,
282
331
  ``,
283
- `═══ ALTCOIN RECOMMENDATION ═══`,
332
+ `══════════════ ALTCOIN RECOMMENDATION ══════════════════`,
284
333
  ``,
285
- `RECOMMENDATION: ${advice}`,
334
+ `RECOMMENDATION:`,
335
+ ` ${altAdvice}`,
286
336
  ``,
287
- `For best Solana entry signals during this BTC regime:`,
337
+ `For best entry signals under this regime:`,
288
338
  `>>> https://cryptoiz.org/Alpha-Scanner <<<`,
289
339
  ``,
290
- `NOTE: Not financial advice. Always DYOR.`,
291
- `FULL BTC MONITOR: https://cryptoiz.org/BTC`,
340
+ `Plans from $15/week: https://cryptoiz.org/Pricing`,
341
+ FOOTER,
292
342
  ].join('\n');
293
343
  }
294
344
 
345
+ // ══════════════════════════════════════════════════════════════════
346
+ // STATUS
347
+ // ══════════════════════════════════════════════════════════════════
295
348
  function formatStatus() {
296
349
  return [
297
- `╔═══════════════════════════════════════════════════════════╗`,
298
- `║ CryptoIZ MCP Server v3.0.0 ║`,
299
- `║ AI-Powered Solana DEX Trading Signal Platform ║`,
300
- `╠═══════════════════════════════════════════════════════════╣`,
301
- `║ WEBSITE : https://cryptoiz.org ║`,
302
- `║ SUBSCRIBE : https://cryptoiz.org/Pricing ($15/week) ║`,
303
- `║ TWITTER : @cryptoiz_IDN ║`,
304
- `║ TELEGRAM : https://t.me/agus_artemiss ║`,
305
- `╚═══════════════════════════════════════════════════════════╝`,
306
- ``,
307
- `CONNECTION_STATUS : CONNECTED`,
308
- `PAYMENT_STATUS : ${SVM_PRIVATE_KEY ? 'READY — x402 Solana USDC autopay' : 'NOT SET — add SVM_PRIVATE_KEY'}`,
309
- `PRICE_PER_CALL : $0.01 USDC via Solana`,
350
+ HEADER('MCP SERVER v3.2.0', 'AI-Powered Solana DEX Trading Signal Platform', 'Pricing'),
351
+ ``,
352
+ `CONNECTION_STATUS : CONNECTED to CryptoIZ Data Engine`,
353
+ `PAYMENT_STATUS : ${SVM_PRIVATE_KEY ? 'READY — x402 Solana USDC autopay ($0.01/call)' : 'NOT SET — add SVM_PRIVATE_KEY to Claude Desktop config'}`,
310
354
  `PAYMENT_WALLET : DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX`,
311
355
  ``,
312
- `AVAILABLE_TOOLS:`,
356
+ `AVAILABLE TOOLS:`,
313
357
  ``,
314
358
  ` 1. get_alpha_scanner`,
315
- ` What: Strongest Solana tokens being accumulated by smart money`,
316
- ` Data: Contract address, alpha score, class, phase, regime,`,
317
- ` whale/dolphin/shrimp signals, 3 sub-scores, risk flags,`,
318
- ` MC now, price now, MC & price when signal formed`,
319
- ` URL : https://cryptoiz.org/Alpha-Scanner`,
320
- ``,
321
- ` 2. get_divergence`,
322
- ` What: Tokens where price & smart money activity diverge`,
323
- ` Types: HIDDEN_ACCUMULATION, BREAKOUT_ACCUMULATION, CLASSIC_DIVERGENCE`,
324
- ` Data: Contract address, divergence type+explanation, score,`,
325
- ` confidence, whale movement (now vs prev), price, MC`,
326
- ` URL : https://cryptoiz.org/Divergence`,
327
- ``,
328
- ` 3. get_accumulation`,
329
- ` What: Tokens in active accumulation phase (4-dimension score)`,
330
- ` Data: Contract address, composite + 4 sub-scores (structure/`,
331
- ` accdist/holder/market), strength label, MC, price`,
332
- ` URL : https://cryptoiz.org/Dashboard`,
359
+ ` Alpha Score, Signal Class, Phase, Regime`,
360
+ ` Whale/Dolphin/Shrimp deltas & supply %`,
361
+ ` Sub-scores: Accumulation / Timing / Safety`,
362
+ ` Risk flags: Liquidity / Trap`,
363
+ ` MC & Price NOW + MC & Price WHEN SIGNAL FORMED`,
364
+ ` → Contract address (copy to trade on DEX)`,
365
+ ` → Full: https://cryptoiz.org/Alpha-Scanner`,
366
+ ``,
367
+ ` 2. get_divergence [params: timeframe=4h|1d, limit=1-50]`,
368
+ ` → 3 types: HIDDEN_ACCUMULATION / BREAKOUT_ACCUMULATION / CLASSIC_DIVERGENCE`,
369
+ ` Each type explained in plain English`,
370
+ ` Whale holders NOW vs PREV (absolute count)`,
371
+ ` → Price now vs previous period`,
372
+ ` Signal age (how long ago detected)`,
373
+ ` Contract address (copy to trade on DEX)`,
374
+ ` → Full: https://cryptoiz.org/Divergence`,
375
+ ``,
376
+ ` 3. get_accumulation [params: min_composite=0-100]`,
377
+ ` → 4-dimension composite score`,
378
+ ` → Structure / AccDist / Holder / Market scores`,
379
+ ` → Strength label (Very Strong → Weak/Noisy)`,
380
+ ` → MC & Price now`,
381
+ ` → Contract address (copy to trade on DEX)`,
382
+ ` → Full: https://cryptoiz.org/Dashboard`,
333
383
  ``,
334
384
  ` 4. get_btc_regime`,
335
- ` What: Bitcoin macro regime critical context for altcoin trading`,
336
- ` Data: Price, score, trend, Fear&Greed, OI regime, funding rate,`,
337
- ` futures signal, RSI/EMA20/EMA50/MACD (1H)`,
338
- ` URL : https://cryptoiz.org/BTC`,
339
- ``,
340
- ` 5. get_status — This info`,
341
- ``,
342
- `PLATFORM PLANS:`,
343
- ` 1 Week : $15 | 1 Month : $50`,
344
- ` 3 Months : $120 | 1 Year : $400`,
345
- ` URL: https://cryptoiz.org/Pricing`,
385
+ ` BTC regime (Bull/Bear/Neutral) + score/10`,
386
+ ` Fear & Greed Index with interpretation`,
387
+ ` Futures: OI regime, funding rate, signal`,
388
+ ` Technical: RSI / EMA20 / EMA50 / MACD (1H)`,
389
+ ` → Altcoin recommendation based on regime`,
390
+ ` Full: https://cryptoiz.org/BTC`,
391
+ ``,
392
+ ` 5. get_status → This info`,
393
+ ``,
394
+ `SUBSCRIPTION PLANS:`,
395
+ ` 1 Week: $15 | 1 Month: $50 | 3 Months: $120 | 1 Year: $400`,
396
+ ` https://cryptoiz.org/Pricing`,
397
+ FOOTER,
346
398
  ].join('\n');
347
399
  }
348
400
 
401
+ // ══════════════════════════════════════════════════════════════════
402
+ // TOOL DEFINITIONS
403
+ // ══════════════════════════════════════════════════════════════════
349
404
  const TOOLS = [
350
- { 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: [] } },
351
- { 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: [] } },
352
- { 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: [] } },
353
- { 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: [] } },
354
- { 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: [] } },
405
+ {
406
+ name: 'get_alpha_scanner',
407
+ description: 'CryptoIZ Alpha Entry Scanner — strongest Solana tokens being accumulated by smart money. Returns: contract address (for DEX trading), alpha score, signal class (ALPHA_EARLY/BUILDING/WATCHLIST), phase, regime, whale/dolphin/shrimp deltas and supply %, accumulation/timing/safety sub-scores, liquidity and trap risk flags, market cap now, price now, MC and price when signal first formed. $0.01 USDC/call. Platform: https://cryptoiz.org/Alpha-Scanner',
408
+ 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: [] }
409
+ },
410
+ {
411
+ name: 'get_divergence',
412
+ description: 'CryptoIZ Divergence Scanner — detects 3 types: HIDDEN_ACCUMULATION (price weak but whales buying), BREAKOUT_ACCUMULATION (whales buying breakouts), CLASSIC_DIVERGENCE (price vs smart money opposite direction). Returns: contract address, divergence type with explanation, score, confidence %, whale holders now vs previous period, dolphin delta, price now vs previous, price change %, market cap, signal age. $0.01 USDC/call. Platform: https://cryptoiz.org/Divergence',
413
+ inputSchema: { type: 'object', properties: { timeframe: { type: 'string', enum: ['4h','1d'], description: 'Default: 4h' }, limit: { type: 'number', description: 'Max results 1-50, default 30' } }, required: [] }
414
+ },
415
+ {
416
+ name: 'get_accumulation',
417
+ description: 'CryptoIZ Accumulation Dashboard — tokens in active accumulation phase scored on 4 dimensions: Structure (price action patterns), AccDist (accumulation vs distribution ratio), Holder (quality and loyalty), Market (conditions and volume). Returns: contract address, composite score, all 4 sub-scores, strength label, market cap, price, last updated. $0.01 USDC/call. Platform: https://cryptoiz.org/Dashboard',
418
+ inputSchema: { type: 'object', properties: { min_composite: { type: 'number', description: 'Minimum composite score 0-100' } }, required: [] }
419
+ },
420
+ {
421
+ name: 'get_btc_regime',
422
+ description: 'CryptoIZ BTC Regime Monitor — Bitcoin macro condition critical for Solana altcoin trading. Returns: BTC price, regime score 0-10, trend, open interest, funding rate, Fear & Greed Index with interpretation, futures signal, OI regime, funding regime, perp price, RSI/EMA20/EMA50/MACD (1H timeframe), altcoin recommendation. $0.01 USDC/call. Platform: https://cryptoiz.org/BTC',
423
+ inputSchema: { type: 'object', properties: {}, required: [] }
424
+ },
425
+ {
426
+ name: 'get_status',
427
+ description: 'Check CryptoIZ MCP server v3.2.0 connection status, payment setup, and complete list of all tools with full data descriptions. Platform: https://cryptoiz.org',
428
+ inputSchema: { type: 'object', properties: {}, required: [] }
429
+ },
355
430
  ];
356
431
 
357
- const server = new Server({ name: 'cryptoiz-mcp', version: '3.0.2' }, { capabilities: { tools: {} } });
432
+ // ══════════════════════════════════════════════════════════════════
433
+ // SERVER
434
+ // ══════════════════════════════════════════════════════════════════
435
+ const server = new Server({ name: 'cryptoiz-mcp', version: '3.2.0' }, { capabilities: { tools: {} } });
358
436
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
359
437
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
360
438
  const { name, arguments: args } = request.params;
361
439
  try {
362
440
  if (name === 'get_status') return { content: [{ type: 'text', text: formatStatus() }] };
441
+
363
442
  if (name === 'get_alpha_scanner') {
364
443
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_alpha_scanner`);
365
444
  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; }
366
445
  if (args?.entry_class && data.signals) { data.signals = data.signals.filter(s => s.signal_class === args.entry_class); data.total_signals = data.signals.length; }
367
446
  return { content: [{ type: 'text', text: formatAlpha(data) }] };
368
447
  }
448
+
369
449
  if (name === 'get_divergence') {
370
450
  const p = new URLSearchParams({ tool: 'get_divergence' });
371
451
  if (args?.timeframe) p.set('tf', args.timeframe);
@@ -373,15 +453,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
373
453
  const data = await payAndFetch(`${GATEWAY_URL}?${p}`);
374
454
  return { content: [{ type: 'text', text: formatDivergence(data) }] };
375
455
  }
456
+
376
457
  if (name === 'get_accumulation') {
377
458
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_accumulation`);
378
459
  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; }
379
460
  return { content: [{ type: 'text', text: formatAccumulation(data) }] };
380
461
  }
462
+
381
463
  if (name === 'get_btc_regime') {
382
464
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_btc_regime`);
383
465
  return { content: [{ type: 'text', text: formatBTC(data) }] };
384
466
  }
467
+
385
468
  return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
386
469
  } catch (err) {
387
470
  return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };