genexus-mcp 1.1.1 → 1.1.3

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/README.md CHANGED
@@ -10,31 +10,27 @@ A high-performance Model Context Protocol (MCP) server for GeneXus 18. It integr
10
10
 
11
11
  You **do not** need to clone this repository or install anything globally if you have Node.js installed. You can configure your AI Assistant (Claude Desktop, Cursor, RooCode, etc.) to fetch and run the server dynamically!
12
12
 
13
- ### 1. Create your Local Config
14
- Create a `config.json` inside your working directory telling the AI where your GeneXus is installed and which Knowledge Base you want to interact with:
13
+ ### 1. Zero Configuration (For Cursor, Cline & Roo)
14
+ If your AI Tool runs inside an IDE (where the Current Working Directory is your KB), you don't need to configure anything. `genexus-mcp` automatically discovers where GeneXus is installed and dynamically binds to your current Knowledge Base!
15
15
 
16
- ```json
17
- {
18
- "GeneXus": {
19
- "InstallationPath": "C:\\Program Files (x86)\\GeneXus\\GeneXus18"
20
- },
21
- "Environment": {
22
- "KBPath": "C:\\KBs\\YourKB"
23
- }
24
- }
16
+ ### 2. Guided Setup Wizard (For Claude Desktop & Antigravity)
17
+ If you are using a Global Desktop Agent, its "Current Directory" is the global `Program Files` directory, not your project. Therefore, you must generate a `config.json` file.
18
+ Open a terminal in any folder and run our **Setup Wizard**:
19
+
20
+ ```bash
21
+ npx genexus-mcp init
25
22
  ```
23
+ *The wizard will ask you for your KB folder and GeneXus path, create the configuration, and output the exact JSON snippet you must paste into your AI Assistant!*
26
24
 
27
- ### 2. Configure your AI Assistant
28
- Add the `mcpServers` configuration block into your AI tool (e.g. `claude_desktop_config.json`):
25
+ ### 3. Add to your AI Assistant
26
+ Add the `mcpServers` configuration block into your AI Tool settings.
29
27
 
30
28
  ```json
31
29
  "mcpServers": {
32
30
  "genexus": {
33
- "command": "npx",
34
- "args": ["-y", "genexus-mcp"],
35
- "env": {
36
- "GX_CONFIG_PATH": "C:\\path\\to\\your\\config.json"
37
- }
31
+ "command": "npx.cmd", // Windows requires npx.cmd
32
+ "args": ["-y", "genexus-mcp@latest"]
33
+ // "env": { "GX_CONFIG_PATH": "C:\\path\\to\\your\\config.json" } // Only if generated by 'init'!
38
34
  }
39
35
  }
40
36
  ```
package/cli/run.js CHANGED
@@ -4,15 +4,109 @@ const path = require('path');
4
4
  const fs = require('fs');
5
5
 
6
6
  const cwdConfigPath = path.join(process.cwd(), 'config.json');
7
+ const args = process.argv.slice(2);
8
+
9
+ // Interactive Setup Wizard
10
+ if (args[0] === 'init' || args[0] === 'setup') {
11
+ console.log('================================================');
12
+ console.log('šŸš€ GeneXus MCP - Zero Configuration Setup Wizard');
13
+ console.log('================================================\n');
14
+
15
+ const readline = require('readline');
16
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
17
+
18
+ let defaultGx = "C:\\Program Files (x86)\\GeneXus\\GeneXus18";
19
+ const possibleGxPaths = [
20
+ "C:\\Program Files (x86)\\GeneXus\\GeneXus18",
21
+ "C:\\Program Files (x86)\\GeneXus\\GeneXus17",
22
+ "C:\\Program Files\\GeneXus\\GeneXus18"
23
+ ];
24
+ for (const p of possibleGxPaths) {
25
+ if (fs.existsSync(path.join(p, 'genexus.exe'))) { defaultGx = p; break; }
26
+ }
27
+
28
+ rl.question('1. Enter your Knowledge Base folder path\n (Default: ' + process.cwd() + '):\n > ', (kbAnswer) => {
29
+ const finalKb = kbAnswer.trim() || process.cwd();
30
+
31
+ rl.question('\n2. Enter your GeneXus Installation path\n (Default: ' + defaultGx + '):\n > ', (gxAnswer) => {
32
+ const finalGx = gxAnswer.trim() || defaultGx;
33
+
34
+ const targetConfigPath = path.join(finalKb, 'config.json');
35
+ const defaultConfig = {
36
+ GeneXus: { InstallationPath: finalGx },
37
+ Environment: { KBPath: finalKb }
38
+ };
39
+
40
+ try {
41
+ if (!fs.existsSync(finalKb)) fs.mkdirSync(finalKb, { recursive: true });
42
+ fs.writeFileSync(targetConfigPath, JSON.stringify(defaultConfig, null, 2));
43
+ 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`);
49
+ } catch (err) {
50
+ console.error('\nāŒ Failed to save configuration: ' + err.message);
51
+ }
52
+ rl.close();
53
+ process.exit(0);
54
+ });
55
+ });
56
+ return; // Stop execution
57
+ }
7
58
 
8
59
  // Check if config.json exists in CWD. If so, bind it to GX_CONFIG_PATH.
9
60
  if (fs.existsSync(cwdConfigPath)) {
10
61
  process.env.GX_CONFIG_PATH = cwdConfigPath;
11
62
  } else if (!process.env.GX_CONFIG_PATH) {
12
- console.error('[genexus-mcp] ERROR: No config.json found in the current directory!');
13
- console.error('[genexus-mcp] Please create a config.json file here with at least the KBPath and GeneXus InstallationPath.');
14
- console.error('[genexus-mcp] Or specify the path via the GX_CONFIG_PATH environment variable.');
15
- process.exit(1);
63
+ const possibleGxPaths = [
64
+ "C:\\Program Files (x86)\\GeneXus\\GeneXus18",
65
+ "C:\\Program Files (x86)\\GeneXus\\GeneXus17",
66
+ "C:\\Program Files (x86)\\GeneXus\\GeneXus16",
67
+ "C:\\Program Files\\GeneXus\\GeneXus18",
68
+ "C:\\Program Files\\GeneXus\\GeneXus17"
69
+ ];
70
+
71
+ let foundGxPath = null;
72
+ for (const p of possibleGxPaths) {
73
+ if (fs.existsSync(path.join(p, 'genexus.exe'))) {
74
+ foundGxPath = p;
75
+ break;
76
+ }
77
+ }
78
+
79
+ if (foundGxPath) {
80
+ // Smart Safety: Only auto-generate config if CWD actually looks like a GeneXus KB!
81
+ // Desktop Agents like Claude or Antigravity often execute in their Program Files.
82
+ const filesInCwd = fs.readdirSync(process.cwd());
83
+ const isActuallyAKB = filesInCwd.some(f => f.toLowerCase().endsWith('.gxw') || f.toLowerCase() === 'knowledgebase.connection');
84
+
85
+ if (isActuallyAKB) {
86
+ console.error(`[genexus-mcp] Auto-discovered GeneXus at: ${foundGxPath}`);
87
+ console.error(`[genexus-mcp] Generating default config.json for KB at: ${process.cwd()}`);
88
+
89
+ const defaultConfig = {
90
+ GeneXus: { InstallationPath: foundGxPath },
91
+ Environment: { KBPath: process.cwd() }
92
+ };
93
+
94
+ fs.writeFileSync(cwdConfigPath, JSON.stringify(defaultConfig, null, 2));
95
+ process.env.GX_CONFIG_PATH = cwdConfigPath;
96
+ } else {
97
+ console.error('[genexus-mcp] ERROR: Zero-Config failed. The current executing directory is NOT a GeneXus Knowledge Base.');
98
+ console.error(`[genexus-mcp] CWD: ${process.cwd()}`);
99
+ console.error('\n[!!] Fix this issue by running the interactive setup wizard:');
100
+ console.error(' npx genexus-mcp init\n');
101
+ process.exit(1);
102
+ }
103
+ } else {
104
+ console.error('[genexus-mcp] ERROR: No config.json found in the current directory!');
105
+ console.error('[genexus-mcp] Auto-discovery for GeneXus installation failed.');
106
+ console.error('\n[!!] Fix this issue by running the interactive setup wizard:');
107
+ console.error(' npx genexus-mcp init\n');
108
+ process.exit(1);
109
+ }
16
110
  }
17
111
 
18
112
  // Locate the bundled .NET executable inside the publish folder
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
- {
2
- "name": "genexus-mcp",
3
- "version": "1.1.1",
4
- "description": "A high-performance Model Context Protocol (MCP) server for GeneXus 18",
5
- "bin": {
6
- "genexus-mcp": "cli/run.js"
7
- },
8
- "files": [
9
- "cli",
10
- "publish"
11
- ],
12
- "engines": {
13
- "node": ">=18.0.0"
14
- },
15
- "author": "lennix1337",
16
- "license": "MIT",
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/lennix1337/Genexus18MCP.git"
20
- },
21
- "bugs": {
22
- "url": "https://github.com/lennix1337/Genexus18MCP/issues"
23
- },
24
- "homepage": "https://github.com/lennix1337/Genexus18MCP#readme"
25
- }
1
+ {
2
+ "name": "genexus-mcp",
3
+ "version": "1.1.3",
4
+ "description": "A high-performance Model Context Protocol (MCP) server for GeneXus 18",
5
+ "bin": {
6
+ "genexus-mcp": "cli/run.js"
7
+ },
8
+ "files": [
9
+ "cli",
10
+ "publish"
11
+ ],
12
+ "engines": {
13
+ "node": ">=18.0.0"
14
+ },
15
+ "author": "lennix1337",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/lennix1337/Genexus18MCP.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/lennix1337/Genexus18MCP/issues"
23
+ },
24
+ "homepage": "https://github.com/lennix1337/Genexus18MCP#readme"
25
+ }
@@ -5936,3 +5936,12 @@
5936
5936
  [2026-04-01 15:07:49.469] [HTTP] Received tools/list (ID: 1) - Body: {"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{"progressToken":0}}}
5937
5937
  [2026-04-01 15:07:49.470] [HTTP] Serializing response for 1...
5938
5938
  [2026-04-01 15:07:49.470] [HTTP] Sending 14100 bytes to 1
5939
+ [2026-04-09 15:48:11.283] === Gateway starting (Stdio Mode) ===
5940
+ [2026-04-09 15:48:11.300] [Gateway] Loading config from: C:\Users\2635801\.gemini\antigravity\brain\7365ac0f-28d5-4326-a546-3e37e2ba58e9\scratch_test\config.json
5941
+ [2026-04-09 15:48:11.362] [Gateway] KB Path configured: C:\Users\2635801\.gemini\antigravity\brain\7365ac0f-28d5-4326-a546-3e37e2ba58e9\scratch_test
5942
+ [2026-04-09 15:48:11.365] [Gateway] Startup orphan-kill disabled. Existing gateway reuse is handled by the extension client.
5943
+ [2026-04-09 15:48:11.387] === Gateway starting (Stdio Mode) ===
5944
+ [2026-04-09 15:48:11.388] [Gateway] Initializing Worker lifecycle...
5945
+ [2026-04-09 15:48:11.391] [Gateway] Worker lifecycle ready.
5946
+ [2026-04-09 15:48:11.391] [Gateway] Setting up .gx_mirror watcher...
5947
+ [2026-04-09 15:48:11.392] [Gateway] .gx_mirror watcher active.