genexus-mcp 1.1.3 ā 1.1.5
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.
- package/cli/run.js +56 -15
- package/package.json +1 -1
- package/publish/gateway_debug.log +48 -0
package/cli/run.js
CHANGED
|
@@ -6,6 +6,14 @@ const fs = require('fs');
|
|
|
6
6
|
const cwdConfigPath = path.join(process.cwd(), 'config.json');
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
8
|
|
|
9
|
+
function generateConfig(gxPath, kbPath) {
|
|
10
|
+
return {
|
|
11
|
+
GeneXus: { InstallationPath: gxPath },
|
|
12
|
+
Server: { HttpPort: 5000, McpStdio: true, SessionIdleTimeoutMinutes: 10, WorkerIdleTimeoutMinutes: 5 },
|
|
13
|
+
Environment: { KBPath: kbPath }
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
// Interactive Setup Wizard
|
|
10
18
|
if (args[0] === 'init' || args[0] === 'setup') {
|
|
11
19
|
console.log('================================================');
|
|
@@ -32,20 +40,57 @@ if (args[0] === 'init' || args[0] === 'setup') {
|
|
|
32
40
|
const finalGx = gxAnswer.trim() || defaultGx;
|
|
33
41
|
|
|
34
42
|
const targetConfigPath = path.join(finalKb, 'config.json');
|
|
35
|
-
const defaultConfig =
|
|
36
|
-
GeneXus: { InstallationPath: finalGx },
|
|
37
|
-
Environment: { KBPath: finalKb }
|
|
38
|
-
};
|
|
43
|
+
const defaultConfig = generateConfig(finalGx, finalKb);
|
|
39
44
|
|
|
40
45
|
try {
|
|
41
46
|
if (!fs.existsSync(finalKb)) fs.mkdirSync(finalKb, { recursive: true });
|
|
42
47
|
fs.writeFileSync(targetConfigPath, JSON.stringify(defaultConfig, null, 2));
|
|
48
|
+
|
|
49
|
+
const os = require('os');
|
|
43
50
|
console.log('\nā
Success! Configuration saved at: ' + targetConfigPath + '\n');
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
|
|
52
|
+
// AI Client Auto-Patching
|
|
53
|
+
const claudeWin = path.join(os.homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
|
|
54
|
+
const claudeMac = path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
55
|
+
const antigravityCfg = path.join(os.homedir(), '.gemini', 'antigravity', 'mcp_config.json');
|
|
56
|
+
|
|
57
|
+
const patchConfig = (cfgPath, clientName) => {
|
|
58
|
+
if (fs.existsSync(cfgPath)) {
|
|
59
|
+
try {
|
|
60
|
+
const rawStr = fs.readFileSync(cfgPath, 'utf8');
|
|
61
|
+
const cfgStr = rawStr.replace(/^\uFEFF/, ''); // Strip BOM if present
|
|
62
|
+
let cfgObj = {};
|
|
63
|
+
if (cfgStr.trim() !== '') cfgObj = JSON.parse(cfgStr);
|
|
64
|
+
|
|
65
|
+
cfgObj.mcpServers = cfgObj.mcpServers || {};
|
|
66
|
+
cfgObj.mcpServers["genexus"] = {
|
|
67
|
+
command: process.platform === 'win32' ? "npx.cmd" : "npx",
|
|
68
|
+
args: ["-y", "genexus-mcp@latest"],
|
|
69
|
+
env: { "GX_CONFIG_PATH": targetConfigPath }
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
fs.writeFileSync(cfgPath, JSON.stringify(cfgObj, null, 2));
|
|
73
|
+
console.log(`š¤ Auto-configured ${clientName} successfully!`);
|
|
74
|
+
return true;
|
|
75
|
+
} catch (e) {
|
|
76
|
+
console.log(`ā ļø Found ${clientName} but couldn't parse its config: ${e.message}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const claudePatched = patchConfig(claudeWin, 'Claude Desktop') || patchConfig(claudeMac, 'Claude Desktop');
|
|
83
|
+
const antiPatched = patchConfig(antigravityCfg, 'Antigravity');
|
|
84
|
+
|
|
85
|
+
if (claudePatched || antiPatched) {
|
|
86
|
+
console.log('\nš You are all set! Please restart your AI Assistant to connect to GeneXus.');
|
|
87
|
+
} else {
|
|
88
|
+
console.log('If you are using a Global Agent (like Claude Desktop or Antigravity),');
|
|
89
|
+
console.log('you MUST copy this exact path and put it in your AI configuration:\n');
|
|
90
|
+
console.log(` "env": {`);
|
|
91
|
+
console.log(` "GX_CONFIG_PATH": "${targetConfigPath.replace(/\\/g, '\\\\')}"`);
|
|
92
|
+
console.log(` }\n`);
|
|
93
|
+
}
|
|
49
94
|
} catch (err) {
|
|
50
95
|
console.error('\nā Failed to save configuration: ' + err.message);
|
|
51
96
|
}
|
|
@@ -86,10 +131,7 @@ if (fs.existsSync(cwdConfigPath)) {
|
|
|
86
131
|
console.error(`[genexus-mcp] Auto-discovered GeneXus at: ${foundGxPath}`);
|
|
87
132
|
console.error(`[genexus-mcp] Generating default config.json for KB at: ${process.cwd()}`);
|
|
88
133
|
|
|
89
|
-
const defaultConfig =
|
|
90
|
-
GeneXus: { InstallationPath: foundGxPath },
|
|
91
|
-
Environment: { KBPath: process.cwd() }
|
|
92
|
-
};
|
|
134
|
+
const defaultConfig = generateConfig(foundGxPath, process.cwd());
|
|
93
135
|
|
|
94
136
|
fs.writeFileSync(cwdConfigPath, JSON.stringify(defaultConfig, null, 2));
|
|
95
137
|
process.env.GX_CONFIG_PATH = cwdConfigPath;
|
|
@@ -122,8 +164,7 @@ if (!fs.existsSync(gatewayExePath)) {
|
|
|
122
164
|
const child = spawn(gatewayExePath, process.argv.slice(2), {
|
|
123
165
|
stdio: 'inherit',
|
|
124
166
|
env: process.env,
|
|
125
|
-
windowsHide: true
|
|
126
|
-
shell: true
|
|
167
|
+
windowsHide: true
|
|
127
168
|
});
|
|
128
169
|
|
|
129
170
|
child.on('error', (err) => {
|
package/package.json
CHANGED
|
@@ -5945,3 +5945,51 @@
|
|
|
5945
5945
|
[2026-04-09 15:48:11.391] [Gateway] Worker lifecycle ready.
|
|
5946
5946
|
[2026-04-09 15:48:11.391] [Gateway] Setting up .gx_mirror watcher...
|
|
5947
5947
|
[2026-04-09 15:48:11.392] [Gateway] .gx_mirror watcher active.
|
|
5948
|
+
[2026-04-09 16:03:37.013] === Gateway starting (Stdio Mode) ===
|
|
5949
|
+
[2026-04-09 16:03:37.030] [Gateway] Loading config from: C:\sistemas\Projetos\GenexusMCP\publish\config.json
|
|
5950
|
+
[2026-04-09 16:03:37.081] [Gateway] KB Path configured: C:\KBs\academicoLocal
|
|
5951
|
+
[2026-04-09 16:03:37.084] [Gateway] Startup orphan-kill disabled. Existing gateway reuse is handled by the extension client.
|
|
5952
|
+
[2026-04-09 16:03:37.096] [Gateway] lease_recovered key=port=5000|kb=c:\kbs\academicolocal|program=c:\program files (x86)\genexus\genexus18|shadow=c:\sistemas\projetos\genexusmcp\.gx_mirror previousPid=37468 forced=False
|
|
5953
|
+
[2026-04-09 16:03:37.107] === Gateway starting (Stdio Mode) ===
|
|
5954
|
+
[2026-04-09 16:03:37.107] [Gateway] Starting HTTP server on port 5000...
|
|
5955
|
+
[2026-04-09 16:03:37.108] [Gateway] Initializing Worker lifecycle...
|
|
5956
|
+
[2026-04-09 16:03:37.110] [Gateway] Worker lifecycle ready.
|
|
5957
|
+
[2026-04-09 16:03:37.110] [Gateway] Setting up .gx_mirror watcher...
|
|
5958
|
+
[2026-04-09 16:03:37.111] [Gateway] .gx_mirror watcher active.
|
|
5959
|
+
[2026-04-09 16:03:37.111] [Gateway] Entering Stdio Loop...
|
|
5960
|
+
[2026-04-09 16:03:37.115] [HTTP] Starting server on 127.0.0.1:5000...
|
|
5961
|
+
[2026-04-09 16:07:57.583] === Gateway starting (Stdio Mode) ===
|
|
5962
|
+
[2026-04-09 16:07:57.598] [Gateway] Loading config from: C:\sistemas\Projetos\GenexusMCP\config.json
|
|
5963
|
+
[2026-04-09 16:07:57.645] [Gateway] KB Path configured: C:\KBs\academicoLocal
|
|
5964
|
+
[2026-04-09 16:07:57.647] [Gateway] Startup orphan-kill disabled. Existing gateway reuse is handled by the extension client.
|
|
5965
|
+
[2026-04-09 16:07:57.661] [Gateway] lease_recovered key=port=5000|kb=c:\kbs\academicolocal|program=c:\program files (x86)\genexus\genexus18|shadow=c:\sistemas\projetos\genexusmcp\.gx_mirror previousPid=9432 forced=False
|
|
5966
|
+
[2026-04-09 16:07:57.670] === Gateway starting (Stdio Mode) ===
|
|
5967
|
+
[2026-04-09 16:07:57.670] [Gateway] Starting HTTP server on port 5000...
|
|
5968
|
+
[2026-04-09 16:07:57.671] [Gateway] Initializing Worker lifecycle...
|
|
5969
|
+
[2026-04-09 16:07:57.673] [Gateway] Worker lifecycle ready.
|
|
5970
|
+
[2026-04-09 16:07:57.673] [Gateway] Setting up .gx_mirror watcher...
|
|
5971
|
+
[2026-04-09 16:07:57.674] [Gateway] .gx_mirror watcher active.
|
|
5972
|
+
[2026-04-09 16:07:57.674] [Gateway] Entering Stdio Loop...
|
|
5973
|
+
[2026-04-09 16:07:57.676] [HTTP] Starting server on 127.0.0.1:5000...
|
|
5974
|
+
[2026-04-09 16:14:43.667] === Gateway starting (Stdio Mode) ===
|
|
5975
|
+
[2026-04-09 16:14:43.684] [Gateway] Loading config from: C:\Users\2635801\.gemini\antigravity\brain\7365ac0f-28d5-4326-a546-3e37e2ba58e9\scratch_test\config.json
|
|
5976
|
+
[2026-04-09 16:14:43.733] [Gateway] KB Path configured: C:\Users\2635801\.gemini\antigravity\brain\7365ac0f-28d5-4326-a546-3e37e2ba58e9\scratch_test
|
|
5977
|
+
[2026-04-09 16:14:43.735] [Gateway] Startup orphan-kill disabled. Existing gateway reuse is handled by the extension client.
|
|
5978
|
+
[2026-04-09 16:14:43.757] === Gateway starting (Stdio Mode) ===
|
|
5979
|
+
[2026-04-09 16:14:43.758] [Gateway] Initializing Worker lifecycle...
|
|
5980
|
+
[2026-04-09 16:14:43.760] [Gateway] Worker lifecycle ready.
|
|
5981
|
+
[2026-04-09 16:14:43.760] [Gateway] Setting up .gx_mirror watcher...
|
|
5982
|
+
[2026-04-09 16:14:43.761] [Gateway] .gx_mirror watcher active.
|
|
5983
|
+
[2026-04-09 16:15:01.900] === Gateway starting (Stdio Mode) ===
|
|
5984
|
+
[2026-04-09 16:15:01.917] [Gateway] Loading config from: C:\Users\2635801\.gemini\antigravity\brain\7365ac0f-28d5-4326-a546-3e37e2ba58e9\scratch_test\config.json
|
|
5985
|
+
[2026-04-09 16:15:01.988] [Gateway] KB Path configured: C:\Users\2635801\.gemini\antigravity\brain\7365ac0f-28d5-4326-a546-3e37e2ba58e9\scratch_test
|
|
5986
|
+
[2026-04-09 16:15:01.992] [Gateway] Startup orphan-kill disabled. Existing gateway reuse is handled by the extension client.
|
|
5987
|
+
[2026-04-09 16:15:02.007] [Gateway] lease_recovered pid=62748 path=C:\Users\2635801\AppData\Local\GenexusMCP\gateway-leases\10489faf15b6f8f9dc9b091928c083f0dae05a6480f5b753d23e3767c6c7c1e0.json
|
|
5988
|
+
[2026-04-09 16:15:02.019] === Gateway starting (Stdio Mode) ===
|
|
5989
|
+
[2026-04-09 16:15:02.020] [Gateway] Starting HTTP server on port 5000...
|
|
5990
|
+
[2026-04-09 16:15:02.021] [Gateway] Initializing Worker lifecycle...
|
|
5991
|
+
[2026-04-09 16:15:02.023] [Gateway] Worker lifecycle ready.
|
|
5992
|
+
[2026-04-09 16:15:02.024] [Gateway] Setting up .gx_mirror watcher...
|
|
5993
|
+
[2026-04-09 16:15:02.024] [Gateway] .gx_mirror watcher active.
|
|
5994
|
+
[2026-04-09 16:15:02.024] [Gateway] Entering Stdio Loop...
|
|
5995
|
+
[2026-04-09 16:15:02.029] [HTTP] Starting server on 127.0.0.1:5000...
|