cryptoiz-mcp 4.15.7 → 4.15.9

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 +1 -1
  2. package/package.json +4 -2
  3. package/setup.js +117 -0
package/index.js CHANGED
@@ -9,7 +9,7 @@ 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.7';
12
+ var VERSION = 'v4.15.9';
13
13
  var GATEWAY = 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-x402-gateway';
14
14
  // Per-tool endpoints for Dexter settlement naming
15
15
  var TOOL_ENDPOINTS = {
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "4.15.7",
3
+ "version": "4.15.9",
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.9';
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); });