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