genexus-mcp 1.1.3 → 1.1.4

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/cli/run.js +45 -5
  2. package/package.json +1 -1
package/cli/run.js CHANGED
@@ -40,12 +40,52 @@ if (args[0] === 'init' || args[0] === 'setup') {
40
40
  try {
41
41
  if (!fs.existsSync(finalKb)) fs.mkdirSync(finalKb, { recursive: true });
42
42
  fs.writeFileSync(targetConfigPath, JSON.stringify(defaultConfig, null, 2));
43
+
44
+ const os = require('os');
43
45
  console.log('\nāœ… Success! Configuration saved at: ' + targetConfigPath + '\n');
44
- console.log('If you are using a Global Agent (like Claude Desktop or Antigravity),');
45
- console.log('you MUST copy this exact path and put it in your AI configuration:\n');
46
- console.log(` "env": {`);
47
- console.log(` "GX_CONFIG_PATH": "${targetConfigPath.replace(/\\/g, '\\\\')}"`);
48
- console.log(` }\n`);
46
+
47
+ // AI Client Auto-Patching
48
+ const claudeWin = path.join(os.homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
49
+ const claudeMac = path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
50
+ const antigravityCfg = path.join(os.homedir(), '.gemini', 'antigravity', 'mcp_config.json');
51
+
52
+ const patchConfig = (cfgPath, clientName) => {
53
+ if (fs.existsSync(cfgPath)) {
54
+ try {
55
+ const rawStr = fs.readFileSync(cfgPath, 'utf8');
56
+ const cfgStr = rawStr.replace(/^\uFEFF/, ''); // Strip BOM if present
57
+ let cfgObj = {};
58
+ if (cfgStr.trim() !== '') cfgObj = JSON.parse(cfgStr);
59
+
60
+ cfgObj.mcpServers = cfgObj.mcpServers || {};
61
+ cfgObj.mcpServers["genexus"] = {
62
+ command: process.platform === 'win32' ? "npx.cmd" : "npx",
63
+ args: ["-y", "genexus-mcp@latest"],
64
+ env: { "GX_CONFIG_PATH": targetConfigPath }
65
+ };
66
+
67
+ fs.writeFileSync(cfgPath, JSON.stringify(cfgObj, null, 2));
68
+ console.log(`šŸ¤– Auto-configured ${clientName} successfully!`);
69
+ return true;
70
+ } catch (e) {
71
+ console.log(`āš ļø Found ${clientName} but couldn't parse its config: ${e.message}`);
72
+ }
73
+ }
74
+ return false;
75
+ };
76
+
77
+ const claudePatched = patchConfig(claudeWin, 'Claude Desktop') || patchConfig(claudeMac, 'Claude Desktop');
78
+ const antiPatched = patchConfig(antigravityCfg, 'Antigravity');
79
+
80
+ if (claudePatched || antiPatched) {
81
+ console.log('\nšŸŽ‰ You are all set! Please restart your AI Assistant to connect to GeneXus.');
82
+ } else {
83
+ console.log('If you are using a Global Agent (like Claude Desktop or Antigravity),');
84
+ console.log('you MUST copy this exact path and put it in your AI configuration:\n');
85
+ console.log(` "env": {`);
86
+ console.log(` "GX_CONFIG_PATH": "${targetConfigPath.replace(/\\/g, '\\\\')}"`);
87
+ console.log(` }\n`);
88
+ }
49
89
  } catch (err) {
50
90
  console.error('\nāŒ Failed to save configuration: ' + err.message);
51
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genexus-mcp",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "A high-performance Model Context Protocol (MCP) server for GeneXus 18",
5
5
  "bin": {
6
6
  "genexus-mcp": "cli/run.js"