cryptoiz-mcp 3.4.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +277 -379
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
4
4
  "description": "CryptoIZ MCP Server — Solana DEX signals with x402 micropayments. Pay $0.01 USDC per call.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -14,7 +14,7 @@ const SOL_RPC = 'https://api.mainnet-beta.solana.com';
14
14
  const AMOUNT = 10000;
15
15
 
16
16
  async function payAndFetch(url) {
17
- if (!SVM_PRIVATE_KEY) return { error: 'SVM_PRIVATE_KEY not set. Add to Claude Desktop config.' };
17
+ if (!SVM_PRIVATE_KEY) return { error: 'SVM_PRIVATE_KEY not set.' };
18
18
  const first = await fetch(url);
19
19
  if (first.status !== 402) return first.json();
20
20
  try {
@@ -34,376 +34,329 @@ async function payAndFetch(url) {
34
34
  }
35
35
 
36
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';
41
-
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');
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 = (name, addr) => {
61
- if (!addr || addr === 'N/A') return ` ⚠ CONTRACT ADDRESS NOT AVAILABLE`;
62
- return [
63
- ` ⚠ SAFETY WARNING: Many fake tokens use the same name "${name}".`,
64
- ` ⚠ ONLY buy using this exact contract address to avoid scams:`,
65
- ` CONTRACT_ADDRESS : ${addr}`,
66
- ` BUY_ON_JUPITER : https://jup.ag/swap/SOL-${addr}`,
67
- ].join('\n');
68
- };
37
+ const sign = v => { const n = parseFloat(v||0); return n > 0 ? `+${n}` : `${n}`; };
38
+ const shortCA = ca => ca ? `${ca.slice(0,6)}...${ca.slice(-4)}` : 'N/A';
39
+ const jupLink = ca => ca ? `[Trade](https://jup.ag/swap/SOL-${ca})` : 'N/A';
69
40
 
70
41
  // ══════════════════════════════════════════════════════════════════
71
- // ALPHA SCANNER
42
+ // ALPHA SCANNER — Markdown Table Format
72
43
  // ══════════════════════════════════════════════════════════════════
73
44
  function formatAlpha(data) {
74
- if (data.error) return `ERROR: ${data.error}\nSetup: https://cryptoiz.org`;
75
- const s = data.signals || [];
45
+ if (data.error) return `❌ **Error:** ${data.error}\n\nSetup: https://cryptoiz.org`;
46
+ const signals = data.signals || [];
47
+ const date = data.fetched_at?.split('T')[0];
76
48
 
77
- const lines = [
78
- HEADER('ALPHA ENTRY SCANNER', 'AI Smart Money Signal Detector for Solana DEX', 'Alpha-Scanner'),
79
- ``,
80
- `DATE : ${data.fetched_at?.split('T')[0]}`,
81
- `TOTAL SIGNALS : ${data.total_signals}`,
82
- ``,
83
- `HOW TO READ:`,
84
- ` ALPHA_SCORE = Overall strength 0-100 (higher = stronger signal)`,
85
- ` SIGNAL_CLASS = ALPHA_EARLY (best) > ALPHA_BUILDING > WATCHLIST_ONLY`,
86
- ` Score Accum = How actively smart money is entering (0-100)`,
87
- ` Score Timing = How optimal the entry timing is right now (0-100)`,
88
- ` Score Safety = Protection from manipulation & fake signals (0-100)`,
89
- ` Whale/Dolphin = Smart money tiers: Whale > Dolphin > Shrimp (retail)`,
90
- ` Delta (+/-) = Net change in holder count this period`,
91
- ` Drop/Peak = Price drop from all-time-high in this period`,
92
- ``,
93
- `═══════════════════════════════════════════════════════════════`,
94
- ``,
95
- ...s.map((t, i) => {
96
- const urgency = parseFloat(t.alpha_score) >= 85 ? '🔥 HIGH CONVICTION' :
97
- parseFloat(t.alpha_score) >= 75 ? '⚡ STRONG SIGNAL' :
98
- parseFloat(t.alpha_score) >= 65 ? '👁 WATCH' : '📋 MONITOR';
99
- return [
100
- `[${String(i+1).padStart(2,'0')}] ${t.name || 'Unknown'} ${urgency}`,
101
- CA_LINE(t.name, t.contract_address || 'N/A'),
102
- ``,
103
- ` SIGNAL_CLASS : ${t.signal_class}`,
104
- ` ALPHA_SCORE : ${N(t.alpha_score)} / 100`,
105
- ` CURRENT_PHASE : ${t.phase || 'N/A'}`,
106
- ` REGIME : ${t.regime || 'N/A'}`,
107
- ` PHASE_CONFIDENCE : ${pct(t.phase_confidence_pct)}`,
108
- ` PHASE_AGE : ${t.phase_age_bars} bars`,
109
- ``,
110
- ` ── HOLDER SIGNALS ──────────────────────────────────`,
111
- ` WHALE_DELTA : ${sign(t.whale_delta)} (holds ${pct(t.whale_supply_pct)} of supply)`,
112
- ` DOLPHIN_DELTA : ${sign(t.dolphin_delta)} (holds ${pct(t.dolphin_supply_pct)} of supply)`,
113
- ` SHRIMP_DELTA : ${sign(t.shrimp_delta)} (negative = retail exiting = bullish sign)`,
114
- ``,
115
- ` ── SUB-SCORES ──────────────────────────────────────`,
116
- ` SCORE_ACCUMULATION : ${N(t.score_accumulation)}`,
117
- ` SCORE_TIMING : ${N(t.score_timing)}`,
118
- ` SCORE_SAFETY : ${N(t.score_safety)}`,
119
- ``,
120
- ` ── RISK FLAGS ──────────────────────────────────────`,
121
- ` RISK_LIQUIDITY : ${risk(t.risk_liquidity_pct, 'exit may be difficult')}`,
122
- ` RISK_TRAP : ${risk(t.risk_trap_pct, 'possible smart money trap')}`,
123
- ``,
124
- ` ── MARKET DATA ─────────────────────────────────────`,
125
- ` MARKET_CAP_NOW : ${mc(t.market_cap_now)}`,
126
- ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
127
- ` PRICE_DROP_FROM_PEAK : ${t.price_drop_from_peak_pct ? N(t.price_drop_from_peak_pct)+'%' : 'N/A'}`,
128
- ` MC_WHEN_SIGNAL_FORMED : ${mc(t.market_cap_when_signal_formed)}`,
129
- ` PRICE_WHEN_SIGNAL_FORMED: $${t.price_when_signal_formed_usd || 'N/A'}`,
130
- ``,
131
- `═══════════════════════════════════════════════════════════`,
132
- ].join('\n');
133
- }),
134
- FOOTER,
135
- ];
136
- return lines.join('\n');
49
+ // Group by class
50
+ const early = signals.filter(s => s.signal_class === 'ALPHA_EARLY');
51
+ const building = signals.filter(s => s.signal_class === 'ALPHA_BUILDING');
52
+ const watchlist = signals.filter(s => s.signal_class === 'WATCHLIST_ONLY');
53
+ const others = signals.filter(s => !['ALPHA_EARLY','ALPHA_BUILDING','WATCHLIST_ONLY'].includes(s.signal_class));
54
+
55
+ const tableRow = (s, i) => {
56
+ const risk = parseFloat(s.risk_liquidity_pct||0) > 0 || parseFloat(s.risk_trap_pct||0) > 0
57
+ ? `⚠️ Liq:${N(s.risk_liquidity_pct)}% Trap:${N(s.risk_trap_pct)}%`
58
+ : '✅ Clear';
59
+ return `| ${i} | **${s.name}** | \`${s.contract_address||'N/A'}\` | ${N(s.alpha_score)} | ${s.phase||'N/A'} | ${sign(s.whale_delta)} | ${sign(s.dolphin_delta)} | ${s.market_cap_now||'N/A'} | $${s.price_now_usd||'N/A'} | ${N(s.score_safety)} | ${risk} | ${jupLink(s.contract_address)} |`;
60
+ };
61
+
62
+ const tableHeader = `| # | Token | Contract Address (CA) | Score | Phase | Whale Δ | Dolphin Δ | MC | Price | Safety | Risk | Trade |
63
+ |---|-------|----------------------|-------|-------|---------|-----------|-----|-------|--------|------|-------|`;
64
+
65
+ let out = [];
66
+
67
+ out.push(`## 🔍 CryptoIZ Alpha Entry Scanner`);
68
+ out.push(`**Date:** ${date} | **Total Signals:** ${data.total_signals} | **Source:** https://cryptoiz.org/Alpha-Scanner`);
69
+ out.push(`**Subscribe:** https://cryptoiz.org/Pricing (1W $15 | 1M $50) | **Twitter:** @cryptoiz_IDN | **Telegram:** https://t.me/agus_artemiss`);
70
+ out.push(``);
71
+ out.push(`> ℹ️ **How to read:** Score 0-100 | Whale/Dolphin Δ = smart money movement | ⚠️ = risk flag | CA = contract address`);
72
+ out.push(`> ⚠️ **Safety:** Many fake tokens share the same name. Always use the exact CA below to trade.`);
73
+ out.push(``);
74
+
75
+ if (early.length) {
76
+ out.push(`### 🟢 ALPHA_EARLY — Best Entry (Smart Money Just Entering)`);
77
+ out.push(`> Phase: Early accumulation | Timing: Optimal | Action: Priority entry`);
78
+ out.push(tableHeader);
79
+ early.forEach((s, i) => out.push(tableRow(s, i+1)));
80
+ out.push(``);
81
+ out.push(`**Full CA for copy-paste:**`);
82
+ early.forEach(s => out.push(`- **${s.name}:** \`${s.contract_address}\` → ${jupLink(s.contract_address)}`));
83
+ out.push(``);
84
+ }
85
+
86
+ if (building.length) {
87
+ out.push(`### 🔵 ALPHA_BUILDING — Still Valid, Less Optimal Timing`);
88
+ out.push(`> Accumulation ongoing | Still good entry | Monitor closely`);
89
+ out.push(tableHeader);
90
+ building.forEach((s, i) => out.push(tableRow(s, i+1)));
91
+ out.push(``);
92
+ out.push(`**Full CA for copy-paste:**`);
93
+ building.forEach(s => out.push(`- **${s.name}:** \`${s.contract_address}\` ${jupLink(s.contract_address)}`));
94
+ out.push(``);
95
+ }
96
+
97
+ if (watchlist.length) {
98
+ out.push(`### 🟡 WATCHLIST_ONLY — Not Ready Yet`);
99
+ out.push(tableHeader);
100
+ watchlist.slice(0,10).forEach((s, i) => out.push(tableRow(s, i+1)));
101
+ if (watchlist.length > 10) out.push(`| ... | *+${watchlist.length-10} more* | | | | | | | | | | |`);
102
+ out.push(``);
103
+ }
104
+
105
+ if (others.length) {
106
+ out.push(`### 🔴 LATE/WEAK/TRAP — Skip or Extreme Caution`);
107
+ out.push(`> ${others.map(s => `${s.name} (${N(s.alpha_score)})`).join(', ')}`);
108
+ out.push(``);
109
+ }
110
+
111
+ out.push(`---`);
112
+ out.push(`⚠️ *Not financial advice. Always DYOR. Data: [CryptoIZ](https://cryptoiz.org) | @cryptoiz_IDN*`);
113
+ return out.join('\n');
137
114
  }
138
115
 
139
116
  // ══════════════════════════════════════════════════════════════════
140
- // DIVERGENCE SCANNER
117
+ // DIVERGENCE — Markdown Table Format
141
118
  // ══════════════════════════════════════════════════════════════════
142
119
  function formatDivergence(data) {
143
- if (data.error) return `ERROR: ${data.error}`;
144
- const byType = data.signals_by_type || {};
120
+ if (data.error) return `❌ **Error:** ${data.error}`;
145
121
  const total = data.total_signals || 0;
122
+ const date = data.fetched_at?.split('T')[0];
123
+ const byType = data.signals_by_type || {};
146
124
 
147
- const lines = [
148
- HEADER('DIVERGENCE SCANNER', 'Smart Money vs Price Divergence Detector', 'Divergence'),
149
- ``,
150
- `DATE : ${data.fetched_at?.split('T')[0]}`,
151
- `TIMEFRAME : ${(data.timeframe||'4h').toUpperCase()}`,
152
- `TOTAL SIGNALS : ${total}`,
153
- ``,
154
- `DIVERGENCE TYPES:`,
155
- ` HIDDEN_ACCUMULATION = Price flat/weak but smart money quietly buying.`,
156
- ` Stealth entry BEFORE the upward move.`,
157
- ` BREAKOUT_ACCUMULATION = Whales buying aggressively on price breakout.`,
158
- ` Momentum-driven entry with strong conviction.`,
159
- ` CLASSIC_DIVERGENCE = Price and smart money moving in OPPOSITE directions.`,
160
- ` High reversal potential watch closely.`,
161
- ``,
162
- `HOW TO READ:`,
163
- ` Divergence Score = Strength of the divergence (higher = stronger)`,
164
- ` Confidence % = AI confidence in the signal`,
165
- ` Whale Now/Prev = Absolute whale holder count change`,
166
- ` Price Change % = Price movement this period`,
167
- ``,
168
- `═══════════════════════════════════════════════════════════════`,
169
- ];
125
+ const tableHeader = `| # | Token | Contract Address (CA) | Div Score | Confidence | Whale Now→Prev | Dolphin Δ | Price | MC | Detected | Trade |
126
+ |---|-------|----------------------|-----------|------------|----------------|-----------|-------|-----|----------|-------|`;
127
+
128
+ const tableRow = (s, i) =>
129
+ `| ${i} | **${s.name||'N/A'}** | \`${s.contract_address||'N/A'}\` | ${N(s.divergence_score)} | ${N(s.confidence_pct)}% | ${s.whale_holders_now||'?'}→${s.whale_holders_prev||'?'} (+${s.whale_delta||0}) | ${sign(s.dolphin_delta)} | $${s.price_now_usd||'N/A'} | ${s.market_cap_usd||'N/A'} | ${s.detected||'N/A'} | ${jupLink(s.contract_address)} |`;
130
+
131
+ let out = [];
132
+ out.push(`## 📊 CryptoIZ Divergence Scanner`);
133
+ out.push(`**Date:** ${date} | **Timeframe:** ${(data.timeframe||'4h').toUpperCase()} | **Total Signals:** ${total}`);
134
+ out.push(`**Source:** https://cryptoiz.org/Divergence | **Subscribe:** https://cryptoiz.org/Pricing | **Twitter:** @cryptoiz_IDN`);
135
+ out.push(``);
136
+ out.push(`> **Divergence Types:**`);
137
+ out.push(`> - **HIDDEN_ACCUMULATION** = Price flat/weak but whales quietly buying stealth entry before move`);
138
+ out.push(`> - **BREAKOUT_ACCUMULATION** = Whales buying on price breakout → momentum entry`);
139
+ out.push(`> - **CLASSIC_DIVERGENCE** = Price & smart money opposite direction → reversal signal`);
140
+ out.push(`> ⚠️ Always use the exact CA to trade. Many tokens share the same name.`);
141
+ out.push(``);
170
142
 
171
143
  if (!total) {
172
- lines.push(`\nNo divergence signals detected at this time.`);
173
- lines.push(`This is normal during low-volatility/sideways markets.`);
174
- lines.push(`Try again in a few hours or switch to 1d timeframe.`);
175
- lines.push(FOOTER);
176
- return lines.join('\n');
144
+ out.push(`*No divergence signals detected at this time. Normal during sideways/low-volatility markets. Try again later or switch timeframe to 1d.*`);
145
+ out.push(``);
146
+ out.push(`---`);
147
+ out.push(`⚠️ *Not financial advice. Data: [CryptoIZ](https://cryptoiz.org) | @cryptoiz_IDN*`);
148
+ return out.join('\n');
177
149
  }
178
150
 
179
151
  const typeOrder = ['HIDDEN_ACCUMULATION','BREAKOUT_ACCUMULATION','CLASSIC_DIVERGENCE'];
180
152
  const typeDesc = {
181
- HIDDEN_ACCUMULATION: 'Price appears weak but smart money is secretly buying stealth setup',
182
- BREAKOUT_ACCUMULATION: 'Whales chasing breakoutsmomentum-driven, high conviction entry',
183
- CLASSIC_DIVERGENCE: 'Price vs smart money in opposite directions — strong reversal signal',
153
+ HIDDEN_ACCUMULATION: '🫥 Stealth smart money entry price weak but whales buying quietly',
154
+ BREAKOUT_ACCUMULATION: '🚀 Momentum entrywhales chasing breakout aggressively',
155
+ CLASSIC_DIVERGENCE: '🔄 Reversal signal — price and smart money in opposite directions',
184
156
  };
185
157
 
186
158
  typeOrder.forEach(type => {
187
159
  const sigs = byType[type] || [];
188
160
  if (!sigs.length) return;
189
- lines.push(`\n▶▶ ${type} — ${sigs.length} signal(s)`);
190
- lines.push(` ${typeDesc[type]}`);
191
- lines.push(`───────────────────────────────────────────────────────────`);
192
-
193
- sigs.forEach((s, i) => {
194
- const urgency = parseFloat(s.divergence_score) > 300 ? '🔥 VERY HIGH' :
195
- parseFloat(s.divergence_score) > 100 ? '⚡ HIGH' :
196
- parseFloat(s.divergence_score) > 50 ? '👁 MODERATE' : '📋 LOW';
197
- lines.push([
198
- ``,
199
- ` [${String(i+1).padStart(2,'0')}] ${s.name || 'Unknown'} — Signal Strength: ${urgency}`,
200
- CA_LINE(s.name, s.contract_address || 'N/A'),
201
- ``,
202
- ` DIVERGENCE_TYPE : ${s.divergence_type}`,
203
- ` DIVERGENCE_SCORE : ${N(s.divergence_score)}`,
204
- ` CONFIDENCE : ${pct(s.confidence_pct)}`,
205
- ` CURRENT_PHASE : ${s.current_phase || 'N/A'}`,
206
- ``,
207
- ` ── HOLDER MOVEMENT ──────────────────────────────`,
208
- ` WHALE_HOLDERS_NOW : ${s.whale_holders_now || 'N/A'} wallets`,
209
- ` WHALE_HOLDERS_PREV : ${s.whale_holders_prev || 'N/A'} wallets`,
210
- ` WHALE_DELTA : ${sign(s.whale_delta)} (new whales entering)`,
211
- ` DOLPHIN_DELTA : ${sign(s.dolphin_delta)}`,
212
- ``,
213
- ` ── PRICE & MARKET ───────────────────────────────`,
214
- ` PRICE_NOW : $${s.price_now_usd || 'N/A'}`,
215
- ` PRICE_PREV_PERIOD : $${s.price_prev_usd || 'N/A'}`,
216
- ` PRICE_CHANGE : ${pct(s.price_change_pct)}`,
217
- ` MARKET_CAP : ${s.market_cap_usd || 'N/A'}`,
218
- ` SIGNAL_AGE : ${s.detected || 'N/A'}`,
219
- ``,
220
- `───────────────────────────────────────────────────────────`,
221
- ].join('\n'));
222
- });
161
+ out.push(`### ${typeDesc[type]}`);
162
+ out.push(tableHeader);
163
+ sigs.forEach((s, i) => out.push(tableRow(s, i+1)));
164
+ out.push(``);
165
+ out.push(`**Full CA for copy-paste:**`);
166
+ sigs.forEach(s => out.push(`- **${s.name}:** \`${s.contract_address}\` ${jupLink(s.contract_address)}`));
167
+ out.push(``);
223
168
  });
224
169
 
225
- lines.push(FOOTER);
226
- return lines.join('\n');
170
+ out.push(`---`);
171
+ out.push(`⚠️ *Not financial advice. Always DYOR. Data: [CryptoIZ](https://cryptoiz.org/Divergence) | @cryptoiz_IDN*`);
172
+ return out.join('\n');
227
173
  }
228
174
 
229
175
  // ══════════════════════════════════════════════════════════════════
230
- // ACCUMULATION DASHBOARD
176
+ // ACCUMULATION — Markdown Table Format
231
177
  // ══════════════════════════════════════════════════════════════════
232
178
  function formatAccumulation(data) {
233
- if (data.error) return `ERROR: ${data.error}`;
179
+ if (data.error) return `❌ **Error:** ${data.error}`;
234
180
  const tokens = data.tokens || [];
181
+ const date = data.fetched_at?.split('T')[0];
235
182
 
236
- const lines = [
237
- HEADER('ACCUMULATION DASHBOARD', '4-Dimension Smart Money Accumulation Detector', 'Dashboard'),
238
- ``,
239
- `DATE : ${data.fetched_at?.split('T')[0]}`,
240
- `TOTAL TOKENS : ${data.total_tokens}`,
241
- ``,
242
- `4-DIMENSION SCORING SYSTEM:`,
243
- ` Structure Score = Price action quality & holder tier patterns (0-100)`,
244
- ` AccDist Score = Accumulation vs distribution balance (0-100)`,
245
- ` Holder Score = Holder loyalty, quality & consistency (0-100)`,
246
- ` Market Score = Market conditions, volume & momentum (0-100)`,
247
- ` Composite Score = Weighted average of all 4 dimensions`,
248
- ``,
249
- `STRENGTH LABELS:`,
250
- ` VERY_STRONG_SMART_MONEY = Highest conviction — priority entry`,
251
- ` STRONG_SMART_MONEY_FORMING = Strong signal — monitor closely`,
252
- ` FORMING = Early stage needs confirmation`,
253
- ` WEAK_OR_NOISY = Low confidence — skip`,
254
- ``,
255
- `═══════════════════════════════════════════════════════════════`,
256
- ``,
257
- ...tokens.map((t, i) => {
258
- const urgency = t.accumulation_strength?.includes('VERY_STRONG') ? '🔥 VERY STRONG' :
259
- t.accumulation_strength?.includes('STRONG') ? '⚡ STRONG FORMING' :
260
- t.accumulation_strength?.includes('FORMING') ? '👁 FORMING' : '📋 WEAK/NOISY';
261
- return [
262
- `[${String(i+1).padStart(2,'0')}] ${t.name || 'Unknown'} — ${urgency}`,
263
- CA_LINE(t.name, t.contract_address || 'N/A'),
264
- ``,
265
- ` ACCUMULATION_STRENGTH : ${t.accumulation_strength || 'N/A'}`,
266
- ` ACCDIST_STATUS : ${t.accdist_status || 'N/A'}`,
267
- ``,
268
- ` ── COMPOSITE SCORE: ${N(t.score_composite)} / 100 ─────────────────`,
269
- ` SCORE_STRUCTURE : ${N(t.score_structure)}`,
270
- ` SCORE_ACCDIST : ${N(t.score_accdist)}`,
271
- ` SCORE_HOLDER : ${N(t.score_holder)}`,
272
- ` SCORE_MARKET : ${N(t.score_market)}`,
273
- ``,
274
- ` ── MARKET DATA ─────────────────────────────────────`,
275
- ` MARKET_CAP_NOW : ${mc(t.market_cap_now)}`,
276
- ` PRICE_NOW : $${t.price_now_usd || 'N/A'}`,
277
- ` LAST_UPDATED : ${t.last_updated || 'N/A'}`,
278
- ``,
279
- `═══════════════════════════════════════════════════════════`,
280
- ].join('\n');
281
- }),
282
- FOOTER,
283
- ];
284
- return lines.join('\n');
183
+ const tableHeader = `| # | Token | Contract Address (CA) | Composite | Strength | Structure | AccDist | Holder | Market | MC | Price | Trade |
184
+ |---|-------|----------------------|-----------|----------|-----------|---------|--------|--------|-----|-------|-------|`;
185
+
186
+ const tableRow = (t, i) =>
187
+ `| ${i} | **${t.name||'N/A'}** | \`${t.contract_address||'N/A'}\` | **${N(t.score_composite)}** | ${t.accumulation_strength||'N/A'} | ${N(t.score_structure)} | ${N(t.score_accdist)} | ${N(t.score_holder)} | ${N(t.score_market)} | ${t.market_cap_now||'N/A'} | $${t.price_now_usd||'N/A'} | ${jupLink(t.contract_address)} |`;
188
+
189
+ let out = [];
190
+ out.push(`## 💰 CryptoIZ Accumulation Dashboard`);
191
+ out.push(`**Date:** ${date} | **Total:** ${data.total_tokens} tokens | **Source:** https://cryptoiz.org/Dashboard`);
192
+ out.push(`**Subscribe:** https://cryptoiz.org/Pricing (1W $15 | 1M $50) | **Twitter:** @cryptoiz_IDN | **Telegram:** https://t.me/agus_artemiss`);
193
+ out.push(``);
194
+ out.push(`> **4-Dimension Scoring:** Structure (price action) + AccDist (accum vs distrib) + Holder (quality) + Market (conditions)`);
195
+ out.push(`> **Strength:** VERY_STRONG → STRONG_FORMING → FORMING → WEAK/NOISY`);
196
+ out.push(`> ⚠️ Always use the exact CA to trade. Many tokens share the same name.`);
197
+ out.push(``);
198
+ out.push(tableHeader);
199
+ tokens.forEach((t, i) => out.push(tableRow(t, i+1)));
200
+ out.push(``);
201
+ out.push(`**Full CA for copy-paste:**`);
202
+ tokens.slice(0, 10).forEach(t => out.push(`- **${t.name}:** \`${t.contract_address}\` → ${jupLink(t.contract_address)}`));
203
+ out.push(``);
204
+ out.push(`---`);
205
+ out.push(`⚠️ *Not financial advice. Always DYOR. Data: [CryptoIZ](https://cryptoiz.org) | @cryptoiz_IDN*`);
206
+ return out.join('\n');
285
207
  }
286
208
 
287
209
  // ══════════════════════════════════════════════════════════════════
288
- // BTC REGIME MONITOR
210
+ // BTC REGIME — Markdown Format
289
211
  // ══════════════════════════════════════════════════════════════════
290
212
  function formatBTC(data) {
291
- if (data.error) return `ERROR: ${data.error}`;
292
- const regime = (data.btc_regime || 'UNKNOWN').toUpperCase();
293
- const regimeIcon = regime === 'BULL' ? '🟢 BULLISH' : regime === 'BEAR' ? '🔴 BEARISH' : '🟡 NEUTRAL';
294
- const fgi = parseFloat(data.fear_and_greed_index || 0);
295
- const fgiContext = fgi <= 25 ? 'Extreme Fear — Historically strong contrarian buy zone for patient investors.' :
296
- fgi >= 75 ? 'Extreme Greed — Market overheated, elevated reversal risk.' :
297
- 'Neutral zone Follow technical signals for direction.';
298
- const altAdvice = regime === 'BULL'
299
- ? '✅ BTC BULLISH → Favorable for altcoin entries.\n Focus on high Alpha Score tokens on CryptoIZ Alpha Scanner.'
300
- : regime === 'BEAR'
301
- ? 'BTC BEARISH → Be CAUTIOUS.\n Size down. Prioritize Safety Score ≥80 and CLEAR risk flags only.'
302
- : '🟡 BTC NEUTRAL → Be SELECTIVE.\n Wait for signal confirmation before large positions.';
303
- const rsiVal = parseFloat(data.rsi_1h || 50);
304
- const rsiNote = rsiVal < 30 ? '(Oversold — potential bounce)' : rsiVal > 70 ? '(Overbought — caution)' : '(Normal range)';
213
+ if (data.error) return `❌ **Error:** ${data.error}`;
214
+ const regime = (data.btc_regime||'UNKNOWN').toUpperCase();
215
+ const icon = regime==='BULL' ? '🟢' : regime==='BEAR' ? '🔴' : '🟡';
216
+ const fgi = parseFloat(data.fear_and_greed_index||0);
217
+ const fgiCtx = fgi<=25 ? '📉 Extreme Fear — historically strong contrarian buy zone' :
218
+ fgi>=75 ? '📈 Extreme Greed — elevated reversal risk' :
219
+ '➡️ Neutral — follow technical signals';
220
+ const advice = regime==='BULL'
221
+ ? '✅ **BTC BULLISH**Good conditions for altcoin entries. Focus on high Alpha Score tokens.'
222
+ : regime==='BEAR'
223
+ ? '⚠️ **BTC BEARISH** → Size down. Only enter tokens with Safety ≥80 and CLEAR risk flags.'
224
+ : '🟡 **BTC NEUTRAL** → Be selective. Wait for confirmation before large entries.';
225
+ const rsi = parseFloat(data.rsi_1h||50);
226
+ const rsiNote = rsi<30 ? '🟢 Oversold' : rsi>70 ? '🔴 Overbought' : 'Normal';
305
227
 
306
228
  return [
307
- HEADER('BTC REGIME MONITOR', 'Bitcoin Macro Condition for Solana Altcoin Traders', 'BTC'),
308
- ``,
309
- `DATE : ${data.fetched_at?.split('T')[0]}`,
229
+ `## ${icon} CryptoIZ BTC Regime Monitor`,
230
+ `**Date:** ${data.fetched_at?.split('T')[0]} | **Source:** https://cryptoiz.org/BTC | **Twitter:** @cryptoiz_IDN`,
231
+ `**Subscribe:** https://cryptoiz.org/Pricing (1W $15 | 1M $50 | 3M $120 | 1Y $400)`,
310
232
  ``,
311
- `══════════════ BTC REGIME: ${regimeIcon} ════════════════`,
233
+ `### ${icon} BTC Regime: **${regime}**`,
312
234
  ``,
313
- `BTC_PRICE_USD : $${data.btc_price_usd || 'N/A'}`,
314
- `BTC_SCORE : ${data.btc_score} / 10 (0=extreme bear, 10=extreme bull)`,
315
- `BTC_TREND : ${data.btc_trend || 'N/A'}`,
316
- `OPEN_INTEREST : ${data.open_interest || 'N/A'}`,
317
- `FUNDING_RATE : ${data.funding_rate || 'N/A'}`,
235
+ `| Metric | Value |`,
236
+ `|--------|-------|`,
237
+ `| 💵 BTC Price | **$${data.btc_price_usd||'N/A'}** |`,
238
+ `| 📊 BTC Score | **${data.btc_score}/10** (0=extreme bear, 10=extreme bull) |`,
239
+ `| 📈 Trend | ${data.btc_trend||'N/A'} |`,
240
+ `| 📂 Open Interest | ${data.open_interest||'N/A'} |`,
241
+ `| 💸 Funding Rate | ${data.funding_rate||'N/A'} |`,
318
242
  ``,
319
- `══════════════ MARKET SENTIMENT ════════════════════════`,
243
+ `### 😨 Market Sentiment`,
320
244
  ``,
321
- `FEAR_GREED_INDEX : ${data.fear_and_greed_index} / 100`,
322
- `FEAR_GREED_LABEL : ${data.fear_and_greed_label || 'N/A'}`,
323
- `FEAR_GREED_CONTEXT : ${fgiContext}`,
245
+ `| Metric | Value |`,
246
+ `|--------|-------|`,
247
+ `| Fear & Greed Index | **${data.fear_and_greed_index}/100 — ${data.fear_and_greed_label||'N/A'}** |`,
248
+ `| Context | ${fgiCtx} |`,
324
249
  ``,
325
- `══════════════ FUTURES MARKET ══════════════════════════`,
250
+ `### 📊 Futures Market`,
326
251
  ``,
327
- `FUTURES_SIGNAL : ${data.futures_signal || 'N/A'}`,
328
- `OI_REGIME : ${data.oi_regime || 'N/A'}`,
329
- `FUNDING_REGIME : ${data.funding_regime || 'N/A'}`,
330
- `PERP_PRICE_USD : $${data.perp_price_usd || 'N/A'}`,
331
- `FUTURES_CONTEXT : ${data.futures_context || 'N/A'}`,
252
+ `| Metric | Value |`,
253
+ `|--------|-------|`,
254
+ `| Futures Signal | **${data.futures_signal||'N/A'}** |`,
255
+ `| OI Regime | ${data.oi_regime||'N/A'} |`,
256
+ `| Funding Regime | ${data.funding_regime||'N/A'} |`,
257
+ `| Perp Price | $${data.perp_price_usd||'N/A'} |`,
258
+ `| Context | ${data.futures_context||'N/A'} |`,
332
259
  ``,
333
- `══════════════ TECHNICAL INDICATORS (1H) ═══════════════`,
260
+ `### 📉 Technical Indicators (1H)`,
334
261
  ``,
335
- `RSI_1H : ${data.rsi_1h || 'N/A'} ${data.rsi_1h ? rsiNote : ''}`,
336
- `EMA20_1H : $${data.ema20_1h || 'N/A'}`,
337
- `EMA50_1H : $${data.ema50_1h || 'N/A'}`,
338
- `MACD_1H : ${data.macd_1h || 'N/A'}`,
339
- `MACD_SIGNAL_1H : ${data.macd_signal_1h || 'N/A'}`,
262
+ `| Indicator | Value | Signal |`,
263
+ `|-----------|-------|--------|`,
264
+ `| RSI | ${data.rsi_1h||'N/A'} | ${rsiNote} |`,
265
+ `| EMA 20 | $${data.ema20_1h||'N/A'} | — |`,
266
+ `| EMA 50 | $${data.ema50_1h||'N/A'} | — |`,
267
+ `| MACD | ${data.macd_1h||'N/A'} | — |`,
268
+ `| MACD Signal | ${data.macd_signal_1h||'N/A'} | — |`,
340
269
  ``,
341
- `══════════════ ALTCOIN RECOMMENDATION ══════════════════`,
270
+ `### 💡 Altcoin Recommendation`,
342
271
  ``,
343
- `RECOMMENDATION:`,
344
- ` ${altAdvice}`,
272
+ advice,
345
273
  ``,
346
- `For best entry signals under this regime:`,
347
- `>>> https://cryptoiz.org/Alpha-Scanner <<<`,
274
+ `**Best entry signals for this regime:** https://cryptoiz.org/Alpha-Scanner`,
348
275
  ``,
349
- `Plans from $15/week: https://cryptoiz.org/Pricing`,
350
- FOOTER,
276
+ `---`,
277
+ `⚠️ *Not financial advice. Always DYOR. Data: [CryptoIZ](https://cryptoiz.org/BTC) | @cryptoiz_IDN*`,
351
278
  ].join('\n');
352
279
  }
353
280
 
354
281
  // ══════════════════════════════════════════════════════════════════
355
- // STATUS
282
+ // GET TOKEN CA — Free tool
356
283
  // ══════════════════════════════════════════════════════════════════
357
- function formatStatus() {
284
+ async function getTokenCA(tokenName, data) {
285
+ const signals = data.signals || [];
286
+ const match = signals.find(s =>
287
+ (s.name||'').toLowerCase().includes(tokenName.toLowerCase()) ||
288
+ tokenName.toLowerCase().includes((s.name||'').toLowerCase())
289
+ );
290
+ if (!match) {
291
+ return [
292
+ `### ❌ Token "${tokenName}" not found in today's CryptoIZ signals`,
293
+ ``,
294
+ `Available tokens: ${signals.slice(0,20).map(s => s.name).join(', ')}`,
295
+ ``,
296
+ `Try [get_alpha_scanner] to see all signals.`,
297
+ ].join('\n');
298
+ }
358
299
  return [
359
- HEADER('MCP SERVER v3.2.0', 'AI-Powered Solana DEX Trading Signal Platform', 'Pricing'),
300
+ `### 🔐 Contract Address Verification ${match.name}`,
360
301
  ``,
361
- `CONNECTION_STATUS : CONNECTED to CryptoIZ Data Engine`,
362
- `PAYMENT_STATUS : ${SVM_PRIVATE_KEY ? 'READY — x402 Solana USDC autopay ($0.01/call)' : 'NOT SET — add SVM_PRIVATE_KEY to Claude Desktop config'}`,
363
- `PAYMENT_WALLET : DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX`,
302
+ `> ⚠️ **SAFETY:** Many fake tokens use the same name "${match.name}". Use ONLY this exact CA.`,
364
303
  ``,
365
- `AVAILABLE TOOLS:`,
304
+ `| Field | Value |`,
305
+ `|-------|-------|`,
306
+ `| Token Name | **${match.name}** |`,
307
+ `| Contract Address | \`${match.contract_address}\` |`,
308
+ `| Alpha Score | ${N(match.alpha_score)} |`,
309
+ `| Signal Class | ${match.signal_class} |`,
310
+ `| Market Cap | ${match.market_cap_now||'N/A'} |`,
311
+ `| Price | $${match.price_now_usd||'N/A'} |`,
366
312
  ``,
367
- ` 1. get_alpha_scanner`,
368
- ` → Alpha Score, Signal Class, Phase, Regime`,
369
- ` → Whale/Dolphin/Shrimp deltas & supply %`,
370
- ` → Sub-scores: Accumulation / Timing / Safety`,
371
- ` → Risk flags: Liquidity / Trap`,
372
- ` → MC & Price NOW + MC & Price WHEN SIGNAL FORMED`,
373
- ` → Contract address (copy to trade on DEX)`,
374
- ` → Full: https://cryptoiz.org/Alpha-Scanner`,
313
+ `**Trade Links (verified):**`,
314
+ `- 🪐 Jupiter: https://jup.ag/swap/SOL-${match.contract_address}`,
315
+ `- Raydium: https://raydium.io/swap/?inputCurrency=sol&outputCurrency=${match.contract_address}`,
375
316
  ``,
376
- ` 2. get_divergence [params: timeframe=4h|1d, limit=1-50]`,
377
- ` → 3 types: HIDDEN_ACCUMULATION / BREAKOUT_ACCUMULATION / CLASSIC_DIVERGENCE`,
378
- ` → Each type explained in plain English`,
379
- ` → Whale holders NOW vs PREV (absolute count)`,
380
- ` → Price now vs previous period`,
381
- ` → Signal age (how long ago detected)`,
382
- ` → Contract address (copy to trade on DEX)`,
383
- ` → Full: https://cryptoiz.org/Divergence`,
384
- ``,
385
- ` 3. get_accumulation [params: min_composite=0-100]`,
386
- ` → 4-dimension composite score`,
387
- ` → Structure / AccDist / Holder / Market scores`,
388
- ` → Strength label (Very Strong → Weak/Noisy)`,
389
- ` → MC & Price now`,
390
- ` → Contract address (copy to trade on DEX)`,
391
- ` → Full: https://cryptoiz.org/Dashboard`,
392
- ``,
393
- ` 4. get_btc_regime`,
394
- ` → BTC regime (Bull/Bear/Neutral) + score/10`,
395
- ` → Fear & Greed Index with interpretation`,
396
- ` → Futures: OI regime, funding rate, signal`,
397
- ` → Technical: RSI / EMA20 / EMA50 / MACD (1H)`,
398
- ` → Altcoin recommendation based on regime`,
399
- ` → Full: https://cryptoiz.org/BTC`,
400
- ``,
401
- ` 5. get_status → This info`,
402
- ``,
403
- `SUBSCRIPTION PLANS:`,
404
- ` 1 Week: $15 | 1 Month: $50 | 3 Months: $120 | 1 Year: $400`,
405
- ` https://cryptoiz.org/Pricing`,
406
- FOOTER,
317
+ `---`,
318
+ `*Data: [CryptoIZ](https://cryptoiz.org) | @cryptoiz_IDN*`,
319
+ ].join('\n');
320
+ }
321
+
322
+ // ══════════════════════════════════════════════════════════════════
323
+ // STATUS
324
+ // ══════════════════════════════════════════════════════════════════
325
+ function formatStatus() {
326
+ return [
327
+ `## 🚀 CryptoIZ MCP Server v4.0.0`,
328
+ ``,
329
+ `**AI-Powered Solana DEX Trading Signal Platform**`,
330
+ ``,
331
+ `| Field | Value |`,
332
+ `|-------|-------|`,
333
+ `| Status | ✅ CONNECTED |`,
334
+ `| Payment | ${SVM_PRIVATE_KEY ? '✅ READY — x402 Solana USDC ($0.01/call)' : '❌ NOT SET — add SVM_PRIVATE_KEY'} |`,
335
+ `| Platform | https://cryptoiz.org |`,
336
+ `| Twitter | @cryptoiz_IDN |`,
337
+ `| Telegram | https://t.me/agus_artemiss |`,
338
+ ``,
339
+ `### Available Tools`,
340
+ ``,
341
+ `| Tool | Description | Cost | Data |`,
342
+ `|------|-------------|------|------|`,
343
+ `| get_alpha_scanner | Strongest Solana signals with smart money analysis | $0.01 USDC | Score, Phase, Whale/Dolphin, MC, Price, CA, Jupiter link |`,
344
+ `| get_divergence | 3-type divergence: Hidden/Breakout/Classic | $0.01 USDC | Score, Confidence, Whale now vs prev, Price, MC, CA |`,
345
+ `| get_accumulation | 4-dimension accumulation scoring | $0.01 USDC | Composite + 4 sub-scores, MC, Price, CA |`,
346
+ `| get_btc_regime | Bitcoin macro regime + altcoin recommendation | $0.01 USDC | Price, Score, Fear&Greed, OI, Funding, RSI/EMA/MACD |`,
347
+ `| get_token_ca | Get exact CA for specific token (scam protection) | FREE | Full CA + Jupiter + Raydium links |`,
348
+ `| get_status | This info | FREE | — |`,
349
+ ``,
350
+ `### Subscription Plans`,
351
+ ``,
352
+ `| Plan | Price |`,
353
+ `|------|-------|`,
354
+ `| 1 Week | $15 |`,
355
+ `| 1 Month | $50 |`,
356
+ `| 3 Months | $120 |`,
357
+ `| 1 Year | $400 |`,
358
+ ``,
359
+ `**Subscribe:** https://cryptoiz.org/Pricing`,
407
360
  ].join('\n');
408
361
  }
409
362
 
@@ -411,37 +364,18 @@ function formatStatus() {
411
364
  // TOOL DEFINITIONS
412
365
  // ══════════════════════════════════════════════════════════════════
413
366
  const TOOLS = [
414
- {
415
- name: 'get_alpha_scanner',
416
- 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',
417
- 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: [] }
418
- },
419
- {
420
- name: 'get_divergence',
421
- 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',
422
- inputSchema: { type: 'object', properties: { timeframe: { type: 'string', enum: ['4h','1d'], description: 'Default: 4h' }, limit: { type: 'number', description: 'Max results 1-50, default 30' } }, required: [] }
423
- },
424
- {
425
- name: 'get_accumulation',
426
- 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',
427
- inputSchema: { type: 'object', properties: { min_composite: { type: 'number', description: 'Minimum composite score 0-100' } }, required: [] }
428
- },
429
- {
430
- name: 'get_btc_regime',
431
- 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',
432
- inputSchema: { type: 'object', properties: {}, required: [] }
433
- },
434
- {
435
- name: 'get_status',
436
- 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',
437
- inputSchema: { type: 'object', properties: {}, required: [] }
438
- },
367
+ { name: 'get_alpha_scanner', description: 'CryptoIZ Alpha Scanner — Solana smart money signals in markdown table format. Shows contract address, Jupiter trade link, alpha score, class, phase, whale/dolphin signals, sub-scores, risk flags, MC, price. $0.01 USDC/call.', inputSchema: { type: 'object', properties: { min_score: { type: 'number' }, entry_class: { type: 'string', enum: ['ALPHA_EARLY','ALPHA_BUILDING','WATCHLIST_ONLY'] } }, required: [] } },
368
+ { name: 'get_divergence', description: 'CryptoIZ Divergence Scanner — 3 types in table format: HIDDEN_ACCUMULATION, BREAKOUT_ACCUMULATION, CLASSIC_DIVERGENCE. Shows CA, Jupiter link, score, confidence, whale holders now vs prev. $0.01 USDC/call.', inputSchema: { type: 'object', properties: { timeframe: { type: 'string', enum: ['4h','1d'] }, limit: { type: 'number' } }, required: [] } },
369
+ { name: 'get_accumulation', description: 'CryptoIZ Accumulation Dashboard4-dimension scoring table. Shows CA, Jupiter link, composite + 4 sub-scores (structure/accdist/holder/market), MC, price. $0.01 USDC/call.', inputSchema: { type: 'object', properties: { min_composite: { type: 'number' } }, required: [] } },
370
+ { name: 'get_btc_regime', description: 'CryptoIZ BTC Regime Monitor BTC macro in table format. Shows price, score, Fear&Greed, OI regime, funding, futures signal, RSI/EMA/MACD 1H, altcoin recommendation. $0.01 USDC/call.', inputSchema: { type: 'object', properties: {}, required: [] } },
371
+ { name: 'get_token_ca', description: 'FREE: Get exact contract address for a specific token. Includes Jupiter and Raydium trade links. Use this to avoid buying wrong token (many fake tokens share same names). No USDC payment required.', inputSchema: { type: 'object', properties: { token_name: { type: 'string', description: 'Token name to look up, e.g. "Aliens" or "PENGUIN"' } }, required: ['token_name'] } },
372
+ { name: 'get_status', description: 'CryptoIZ MCP server status, all available tools, and subscription plans. Platform: https://cryptoiz.org', inputSchema: { type: 'object', properties: {}, required: [] } },
439
373
  ];
440
374
 
441
375
  // ══════════════════════════════════════════════════════════════════
442
376
  // SERVER
443
377
  // ══════════════════════════════════════════════════════════════════
444
- const server = new Server({ name: 'cryptoiz-mcp', version: '3.4.0' }, { capabilities: { tools: {} } });
378
+ const server = new Server({ name: 'cryptoiz-mcp', version: '4.0.0' }, { capabilities: { tools: {} } });
445
379
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
446
380
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
447
381
  const { name, arguments: args } = request.params;
@@ -450,6 +384,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
450
384
 
451
385
  if (name === 'get_alpha_scanner') {
452
386
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_alpha_scanner`);
387
+ if (data.error) return { content: [{ type: 'text', text: `❌ ${data.error}` }], isError: true };
453
388
  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; }
454
389
  if (args?.entry_class && data.signals) { data.signals = data.signals.filter(s => s.signal_class === args.entry_class); data.total_signals = data.signals.length; }
455
390
  return { content: [{ type: 'text', text: formatAlpha(data) }] };
@@ -460,68 +395,31 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
460
395
  if (args?.timeframe) p.set('tf', args.timeframe);
461
396
  if (args?.limit) p.set('limit', String(args.limit));
462
397
  const data = await payAndFetch(`${GATEWAY_URL}?${p}`);
398
+ if (data.error) return { content: [{ type: 'text', text: `❌ ${data.error}` }], isError: true };
463
399
  return { content: [{ type: 'text', text: formatDivergence(data) }] };
464
400
  }
465
401
 
466
402
  if (name === 'get_accumulation') {
467
403
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_accumulation`);
404
+ if (data.error) return { content: [{ type: 'text', text: `❌ ${data.error}` }], isError: true };
468
405
  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; }
469
406
  return { content: [{ type: 'text', text: formatAccumulation(data) }] };
470
407
  }
471
408
 
472
409
  if (name === 'get_btc_regime') {
473
410
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_btc_regime`);
411
+ if (data.error) return { content: [{ type: 'text', text: `❌ ${data.error}` }], isError: true };
474
412
  return { content: [{ type: 'text', text: formatBTC(data) }] };
475
413
  }
476
414
 
477
415
  if (name === 'get_token_ca') {
478
416
  const tokenName = args?.token_name || '';
417
+ if (!tokenName) return { content: [{ type: 'text', text: '❌ Please provide a token_name. Example: "Aliens"' }], isError: true };
479
418
  const data = await payAndFetch(`${GATEWAY_URL}?tool=get_alpha_scanner`);
480
-
481
- if (data.error) return { content: [{ type: 'text', text: `Error: ${data.error}` }], isError: true };
482
-
483
- // Search by name (case insensitive)
484
- const signals = data.signals || [];
485
- const match = signals.find(s =>
486
- (s.name || '').toLowerCase().includes(tokenName.toLowerCase()) ||
487
- tokenName.toLowerCase().includes((s.name || '').toLowerCase())
488
- );
489
-
490
- if (!match) {
491
- return { content: [{ type: 'text', text: [
492
- `Token "${tokenName}" not found in today's CryptoIZ signals.`,
493
- ``,
494
- `Available tokens today: ${signals.map(s => s.name).join(', ')}`,
495
- ``,
496
- `Try get_alpha_scanner to see all available tokens.`,
497
- ].join('\n') }] };
498
- }
499
-
500
- return { content: [{ type: 'text', text: [
501
- `TOKEN VERIFICATION — ${match.name}`,
502
- ``,
503
- `⚠ IMPORTANT: Many fake tokens use the same name.`,
504
- `⚠ ONLY use this exact contract address to avoid scams.`,
505
- ``,
506
- `TOKEN_NAME : ${match.name}`,
507
- `CONTRACT_ADDRESS : ${match.contract_address}`,
508
- ``,
509
- `TRADE LINKS (verified):`,
510
- `BUY_ON_JUPITER : https://jup.ag/swap/SOL-${match.contract_address}`,
511
- `BUY_ON_RAYDIUM : https://raydium.io/swap/?inputCurrency=sol&outputCurrency=${match.contract_address}`,
512
- ``,
513
- `CURRENT SIGNALS:`,
514
- `ALPHA_SCORE : ${match.alpha_score}`,
515
- `SIGNAL_CLASS : ${match.signal_class}`,
516
- `MARKET_CAP : ${match.market_cap_now || 'N/A'}`,
517
- `PRICE_NOW : $${match.price_now_usd || 'N/A'}`,
518
- ``,
519
- `Data from CryptoIZ — https://cryptoiz.org`,
520
- `Not financial advice. Always DYOR.`,
521
- ].join('\n') }] };
419
+ return { content: [{ type: 'text', text: await getTokenCA(tokenName, data) }] };
522
420
  }
523
421
 
524
- return { content: [{ type: 'text', text: `Unknown tool: \${name}` }], isError: true };
422
+ return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
525
423
  } catch (err) {
526
424
  return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
527
425
  }