cryptoiz-mcp 4.15.6 → 4.15.8

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 (3) hide show
  1. package/index.js +18 -4
  2. package/package.json +4 -2
  3. package/setup.js +117 -0
package/index.js CHANGED
@@ -9,8 +9,15 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprot
9
9
  import { Connection, Keypair, PublicKey, Transaction, SystemProgram, VersionedTransaction, TransactionMessage } from '@solana/web3.js';
10
10
  import bs58 from 'bs58';
11
11
 
12
- var VERSION = 'v4.15.6';
12
+ var VERSION = 'v4.15.8';
13
13
  var GATEWAY = 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-x402-gateway';
14
+ // Per-tool endpoints for Dexter settlement naming
15
+ var TOOL_ENDPOINTS = {
16
+ get_alpha_scanner: 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-alpha-scanner',
17
+ get_divergence: 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-divergence',
18
+ get_accumulation: 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-accumulation',
19
+ get_btc_regime: 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-btc-regime',
20
+ };
14
21
  var RECIPIENT = 'DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX';
15
22
  var USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
16
23
  var DEXTER_FEE_PAYER = 'DEXVS3su4dZQWTvvPnLDJLRK1CeeKG6K3QqdzthgAkNV';
@@ -170,8 +177,15 @@ async function sendUSDC(amount) {
170
177
 
171
178
  // ===== TOOL CALL HANDLER =====
172
179
  async function callTool(toolName, args) {
173
- var toolParam = toolName;
174
- var queryParts = ['tool=' + toolParam];
180
+ var queryParts = [];
181
+
182
+ // Use per-tool endpoint if available, otherwise gateway
183
+ var baseUrl = TOOL_ENDPOINTS[toolName] || GATEWAY;
184
+
185
+ if (!TOOL_ENDPOINTS[toolName]) {
186
+ // Free tools go to gateway with tool param
187
+ queryParts.push('tool=' + toolName);
188
+ }
175
189
 
176
190
  if (toolName === 'get_divergence' && args && args.timeframe) {
177
191
  queryParts.push('tf=' + args.timeframe);
@@ -180,7 +194,7 @@ async function callTool(toolName, args) {
180
194
  queryParts.push('name=' + encodeURIComponent(args.name));
181
195
  }
182
196
 
183
- var url = GATEWAY + '?' + queryParts.join('&');
197
+ var url = queryParts.length > 0 ? baseUrl + '?' + queryParts.join('&') : baseUrl;
184
198
 
185
199
  // Dev mode bypass
186
200
  if (DEV_KEY) {
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "4.15.6",
3
+ "version": "4.15.8",
4
4
  "description": "CryptoIZ MCP Server - Solana DEX trading signals via Claude Desktop with x402 USDC micropayments (V2 Dexter facilitator)",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "bin": {
8
- "cryptoiz-mcp": "./index.js"
8
+ "cryptoiz-mcp": "./index.js",
9
+ "cryptoiz-mcp-setup": "./setup.js"
9
10
  },
10
11
  "files": [
11
12
  "index.js",
13
+ "setup.js",
12
14
  "package.json",
13
15
  "README.md"
14
16
  ],
package/setup.js ADDED
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import os from 'os';
5
+ import readline from 'readline';
6
+ import { execSync } from 'child_process';
7
+
8
+ var VERSION = 'v4.15.7';
9
+ function print(msg) { process.stdout.write(msg + '\n'); }
10
+
11
+ function findConfigPath() {
12
+ var p = os.platform(), candidates = [];
13
+ if (p === 'darwin') {
14
+ candidates.push(path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'));
15
+ } else if (p === 'win32') {
16
+ var appdata = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
17
+ candidates.push(path.join(appdata, 'Claude', 'claude_desktop_config.json'));
18
+ var localAppData = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');
19
+ try {
20
+ var packagesDir = path.join(localAppData, 'Packages');
21
+ if (fs.existsSync(packagesDir)) {
22
+ var dirs = fs.readdirSync(packagesDir);
23
+ for (var i = 0; i < dirs.length; i++) {
24
+ if (dirs[i].startsWith('Claude_')) {
25
+ candidates.push(path.join(packagesDir, dirs[i], 'LocalCache', 'Roaming', 'Claude', 'claude_desktop_config.json'));
26
+ }
27
+ }
28
+ }
29
+ } catch(e) {}
30
+ } else {
31
+ candidates.push(path.join(os.homedir(), '.config', 'Claude', 'claude_desktop_config.json'));
32
+ }
33
+ for (var j = 0; j < candidates.length; j++) {
34
+ if (fs.existsSync(candidates[j])) return candidates[j];
35
+ }
36
+ return candidates[0] || null;
37
+ }
38
+
39
+ function findPackagePath() {
40
+ if (os.platform() !== 'win32') return null;
41
+ var prefix = '';
42
+ try { prefix = execSync('npm config get prefix', { encoding: 'utf8' }).trim(); } catch(e) {
43
+ prefix = path.join(process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming'), 'npm');
44
+ }
45
+ var c = [
46
+ path.join(prefix, 'node_modules', 'cryptoiz-mcp', 'index.js'),
47
+ path.join(prefix, 'lib', 'node_modules', 'cryptoiz-mcp', 'index.js'),
48
+ ];
49
+ for (var i = 0; i < c.length; i++) { if (fs.existsSync(c[i])) return c[i]; }
50
+ return null;
51
+ }
52
+
53
+ function buildEntry(key) {
54
+ if (os.platform() === 'win32') {
55
+ var pkgPath = findPackagePath();
56
+ if (!pkgPath) { print('ERROR: Run npm install -g cryptoiz-mcp first'); process.exit(1); }
57
+ return { command: process.execPath, args: [pkgPath], env: { SVM_PRIVATE_KEY: key } };
58
+ }
59
+ return { command: 'npx', args: ['-y', 'cryptoiz-mcp@' + VERSION.replace('v','')], env: { SVM_PRIVATE_KEY: key } };
60
+ }
61
+
62
+ function injectConfig(cfgPath, entry) {
63
+ var config = {};
64
+ if (fs.existsSync(cfgPath)) {
65
+ try { config = JSON.parse(fs.readFileSync(cfgPath, 'utf8')); } catch(e) {
66
+ fs.copyFileSync(cfgPath, cfgPath + '.backup.' + Date.now());
67
+ print('Config had error. Backup created.');
68
+ }
69
+ }
70
+ if (!config.mcpServers) config.mcpServers = {};
71
+ if (config.mcpServers.cryptoiz) print('Updating existing CryptoIZ entry...');
72
+ config.mcpServers.cryptoiz = entry;
73
+ var dir = path.dirname(cfgPath);
74
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
75
+ fs.writeFileSync(cfgPath, JSON.stringify(config, null, 2), 'utf8');
76
+ }
77
+
78
+ async function setup() {
79
+ print('');
80
+ print('========================================');
81
+ print(' CryptoIZ MCP Installer ' + VERSION);
82
+ print('========================================');
83
+ print('OS: ' + os.platform() + ' ' + os.arch());
84
+ var cfgPath = findConfigPath();
85
+ if (!cfgPath) { print('ERROR: Claude Desktop not found.'); process.exit(1); }
86
+ print('Config: ' + cfgPath);
87
+ if (os.platform() === 'win32') {
88
+ print('[Windows] absolute paths mode');
89
+ var pkg = findPackagePath();
90
+ if (!pkg) { print('Run: npm install -g cryptoiz-mcp'); process.exit(1); }
91
+ print('Node: ' + process.execPath);
92
+ print('Package: ' + pkg);
93
+ }
94
+ print('');
95
+ print('SECURITY: Use dedicated wallet, $1-5 USDC only, no SOL needed.');
96
+ print('Export: Phantom > Settings > Security > Export Private Key');
97
+ print('');
98
+ var rl = readline.createInterface({ input: process.stdin, output: process.stdout });
99
+ var key = await new Promise(function(r) { rl.question('Paste Solana private key (base58): ', function(a) { r(a.trim()); }); });
100
+ rl.close();
101
+ var chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
102
+ if (!key || key.length < 40 || key.length > 100) { print('ERROR: Invalid key length.'); process.exit(1); }
103
+ for (var i = 0; i < key.length; i++) { if (chars.indexOf(key[i]) === -1) { print('ERROR: Invalid base58 character.'); process.exit(1); } }
104
+ injectConfig(cfgPath, buildEntry(key));
105
+ print('');
106
+ print('SETUP COMPLETE!');
107
+ print('Config: ' + cfgPath);
108
+ print('');
109
+ print('1. Close Claude Desktop completely');
110
+ print('2. Reopen Claude Desktop');
111
+ print('3. Type: get_status');
112
+ print('');
113
+ print('Guide: cryptoiz.org/McpLanding');
114
+ print('');
115
+ }
116
+
117
+ setup().catch(function(e) { print('Failed: ' + e.message); process.exit(1); });