genexus-mcp 1.1.0 → 1.1.1
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 +101 -188
- package/{bin → cli}/run.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,192 +1,105 @@
|
|
|
1
|
-
# GeneXus 18 MCP Server (Genexus18MCP)
|
|
2
|
-
|
|
1
|
+
# GeneXus 18 MCP Server (Genexus18MCP)
|
|
2
|
+
|
|
3
3
|
[](https://lobehub.com/mcp/lennix1337-genexus18mcp)
|
|
4
4
|
|
|
5
|
-
A Model Context Protocol (MCP) server for GeneXus 18
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
npx
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
5
|
+
A high-performance Model Context Protocol (MCP) server for GeneXus 18. It integrates native GeneXus SDK access via a .NET 8 gateway and a .NET Framework 4.8 worker, exposing direct read/write/analysis operations directly to AI Agents and IDEs.
|
|
6
|
+
|
|
7
|
+
***
|
|
8
|
+
|
|
9
|
+
## 🚀 Quick Start (For AI Agents)
|
|
10
|
+
|
|
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
|
+
|
|
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:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"GeneXus": {
|
|
19
|
+
"InstallationPath": "C:\\Program Files (x86)\\GeneXus\\GeneXus18"
|
|
20
|
+
},
|
|
21
|
+
"Environment": {
|
|
22
|
+
"KBPath": "C:\\KBs\\YourKB"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Configure your AI Assistant
|
|
28
|
+
Add the `mcpServers` configuration block into your AI tool (e.g. `claude_desktop_config.json`):
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"genexus": {
|
|
33
|
+
"command": "npx",
|
|
34
|
+
"args": ["-y", "genexus-mcp"],
|
|
35
|
+
"env": {
|
|
36
|
+
"GX_CONFIG_PATH": "C:\\path\\to\\your\\config.json"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
**That's it!** The AI will automatically download the compiled Windows gateway in the background and bridge the logic directly to your local GeneXus!
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🛠️ Tool Surface (Skills)
|
|
46
|
+
*(See `GEMINI.md` for extended guidelines).* The worker natively exposes the following tools to the MCP Router:
|
|
47
|
+
|
|
48
|
+
- **Search & Discovery**: `genexus_query`, `genexus_read`, `genexus_batch_read`, `genexus_inspect`, `genexus_list_objects`, `genexus_properties`
|
|
49
|
+
- **Editing & Architecture**: `genexus_edit`, `genexus_batch_edit`, `genexus_create_object`, `genexus_refactor`, `genexus_forge`
|
|
50
|
+
- **Analysis:** `genexus_analyze`, `genexus_inject_context`, `genexus_doc`, `genexus_explain_code`, `genexus_summarize`
|
|
51
|
+
- **File System & Assets**: `genexus_asset`, `genexus_export_object`, `genexus_import_object`
|
|
52
|
+
- **History & DB**: `genexus_history`, `genexus_get_sql`, `genexus_structure`
|
|
53
|
+
- **Lifecycle & Build**: `genexus_lifecycle`, `genexus_test`, `genexus_format`
|
|
54
|
+
- **Patterns**: Smart XML generation and interpretation (e.g., WorkWithPlus PatternInstance mapping).
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 💻 Development & Building from Source
|
|
59
|
+
|
|
60
|
+
If you want to contribute, build the project yourself, or use the local **Nexus-IDE** VS Code Extension, use the classic source-based workflow.
|
|
61
|
+
|
|
62
|
+
### One-Click Build
|
|
63
|
+
1. Clone the repository to your Windows machine.
|
|
64
|
+
2. Run `.\setup.bat`.
|
|
65
|
+
* *This checks prerequisites, builds the C# components, and auto-registers the local server with Claude, Codex, Antigravity, and Cursor when detected.*
|
|
66
|
+
3. If GeneXus or your KB are not auto-detected, follow the terminal prompts.
|
|
67
|
+
|
|
68
|
+
### Nexus-IDE (VS Code)
|
|
69
|
+
The repository includes `src/nexus-ide`, a lightweight VS Code extension containing:
|
|
70
|
+
- Virtual file system using the `genexus://` scheme
|
|
71
|
+
- Dynamic KB explorer with multi-part editing (Source, Rules, Events, Variables)
|
|
72
|
+
- Built-in MCP discovery commands (tools, resources, prompts)
|
|
73
|
+
|
|
74
|
+
### Advanced Configuration
|
|
75
|
+
You can expand your local `config.json` for advanced networking or timeouts:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"Server": {
|
|
80
|
+
"HttpPort": 5000,
|
|
81
|
+
"BindAddress": "127.0.0.1",
|
|
82
|
+
"SessionIdleTimeoutMinutes": 10,
|
|
83
|
+
"WorkerIdleTimeoutMinutes": 5
|
|
84
|
+
},
|
|
85
|
+
"GeneXus": {
|
|
86
|
+
"InstallationPath": "C:\\Program Files (x86)\\GeneXus\\GeneXus18",
|
|
87
|
+
"WorkerExecutable": "worker\\GxMcp.Worker.exe"
|
|
88
|
+
},
|
|
89
|
+
"Environment": {
|
|
90
|
+
"KBPath": "C:\\KBs\\YourKB"
|
|
43
91
|
}
|
|
44
92
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
> [!TIP]
|
|
59
|
-
> **Copy-Paste to your Agent:**
|
|
60
|
-
> "Install the GeneXus MCP server in this repository.
|
|
61
|
-
> 1. Auto-detect the GeneXus 18 installation path and the local KB path.
|
|
62
|
-
> 2. Run `.\install.ps1` to build and register the server.
|
|
63
|
-
> 3. Verify the `config.json` is valid.
|
|
64
|
-
> 4. Update your own MCP configuration to include the 'genexus' server using the generated `start_mcp.bat`."
|
|
65
|
-
|
|
66
|
-
### Manual path
|
|
67
|
-
|
|
68
|
-
Notes:
|
|
69
|
-
|
|
70
|
-
- The installer updates `config.json`, builds the gateway/worker, packages `src/nexus-ide/nexus-ide.vsix`, configures Claude Desktop and Codex, and updates Antigravity plus Cursor/Cline settings when those clients are present.
|
|
71
|
-
- `setup.bat` is a thin bootstrap wrapper that launches `install.ps1` through PowerShell with `-ExecutionPolicy Bypass`.
|
|
72
|
-
- Automatic extension installation works with the editor CLIs found in `PATH` among `code`, `code-insiders`, `cursor`, `codium`, and `antigravity`. If none are present, install the generated `.vsix` manually.
|
|
73
|
-
- The desktop launcher at `publish/start_mcp.bat` exports `GX_CONFIG_PATH` and reuses the current repository gateway build when available, so local MCP clients and the extension share the repository-root `config.json`.
|
|
74
|
-
- `build.ps1` now refreshes both the publish/runtime artifacts and the debug-consumed artifacts in one pass, so `F5` and external MCP clients stop drifting onto different gateway/worker builds.
|
|
75
|
-
- The gateway now registers a local process lease keyed by `HttpPort + KBPath + InstallationPath + ShadowPath`, so duplicate launches can reuse a healthy live gateway instead of spawning another one.
|
|
76
|
-
- The worker now starts lazily on the first real command and shuts down automatically after the configured idle timeout, which prevents idle `GxMcp.Worker.exe` instances from lingering and locking the build output.
|
|
77
|
-
|
|
78
|
-
### Development build
|
|
79
|
-
|
|
80
|
-
```powershell
|
|
81
|
-
.\build.ps1
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Configuration
|
|
85
|
-
|
|
86
|
-
Edit `config.json`:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"Server": {
|
|
91
|
-
"HttpPort": 5000,
|
|
92
|
-
"BindAddress": "127.0.0.1",
|
|
93
|
-
"AllowedOrigins": [],
|
|
94
|
-
"SessionIdleTimeoutMinutes": 10,
|
|
95
|
-
"WorkerIdleTimeoutMinutes": 5
|
|
96
|
-
},
|
|
97
|
-
"GeneXus": {
|
|
98
|
-
"InstallationPath": "C:\\Program Files (x86)\\GeneXus\\GeneXus18",
|
|
99
|
-
"WorkerExecutable": "worker\\GxMcp.Worker.exe"
|
|
100
|
-
},
|
|
101
|
-
"Environment": {
|
|
102
|
-
"KBPath": "C:\\KBs\\YourKB"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Correct MCP Usage
|
|
108
|
-
|
|
109
|
-
Official transports:
|
|
110
|
-
|
|
111
|
-
- stdio MCP for desktop clients
|
|
112
|
-
- HTTP MCP at `http://127.0.0.1:5000/mcp`
|
|
113
|
-
|
|
114
|
-
HTTP MCP rules:
|
|
115
|
-
|
|
116
|
-
1. Send `initialize` first.
|
|
117
|
-
2. Include `MCP-Protocol-Version: 2025-06-18`.
|
|
118
|
-
3. Persist and reuse the returned `MCP-Session-Id`.
|
|
119
|
-
4. Use discovery methods before hardcoding assumptions: `tools/list`, `resources/list`, `resources/templates/list`, `prompts/list`.
|
|
120
|
-
5. Execute work with `tools/call`, `resources/read`, and `prompts/get`.
|
|
121
|
-
6. Use `GET /mcp` for SSE notifications when needed.
|
|
122
|
-
7. Use `DELETE /mcp` to close the session.
|
|
123
|
-
|
|
124
|
-
The gateway is MCP-only on HTTP. Use `/mcp`.
|
|
125
|
-
|
|
126
|
-
## Process Lifecycle
|
|
127
|
-
|
|
128
|
-
- Gateway reuse is controlled by a local lease under `%LOCALAPPDATA%\\GenexusMCP\\gateway-leases`.
|
|
129
|
-
- The launcher validates the lease identity and only removes stale or dead instances for that exact identity instead of killing every gateway/worker process.
|
|
130
|
-
- The gateway stays resident by default; the worker is started on demand and is stopped after `Server.WorkerIdleTimeoutMinutes` of inactivity when there are no queued or in-flight requests.
|
|
131
|
-
|
|
132
|
-
## Tool Surface
|
|
133
|
-
|
|
134
|
-
See `GEMINI.md` for guidance. The main MCP tools are:
|
|
135
|
-
|
|
136
|
-
- `genexus_query`
|
|
137
|
-
- supports optional `typeFilter` and `domainFilter` for server-side narrowing before ranking/truncation
|
|
138
|
-
- `genexus_read`
|
|
139
|
-
- defaults to a source-first first page for MCP clients when `offset` and `limit` are omitted
|
|
140
|
-
- `genexus_batch_read`
|
|
141
|
-
- `genexus_edit`
|
|
142
|
-
- `genexus_batch_edit`
|
|
143
|
-
- `genexus_open_kb`
|
|
144
|
-
- `genexus_inspect`
|
|
145
|
-
- `genexus_analyze`
|
|
146
|
-
- `genexus_inject_context`
|
|
147
|
-
- `genexus_lifecycle`
|
|
148
|
-
- `genexus_get_sql`
|
|
149
|
-
- `genexus_test`
|
|
150
|
-
- `genexus_create_object`
|
|
151
|
-
- `genexus_export_object`
|
|
152
|
-
- `genexus_import_object`
|
|
153
|
-
- `genexus_refactor`
|
|
154
|
-
- `genexus_add_variable`
|
|
155
|
-
- `genexus_explain_code`
|
|
156
|
-
- `genexus_summarize`
|
|
157
|
-
- `genexus_forge`
|
|
158
|
-
- `genexus_format`
|
|
159
|
-
- `genexus_properties`
|
|
160
|
-
- `genexus_asset`
|
|
161
|
-
- `genexus_history`
|
|
162
|
-
- `genexus_structure`
|
|
163
|
-
- `genexus_doc`
|
|
164
|
-
|
|
165
|
-
`genexus_asset` is metadata-first by design. Use `action='read'` with `includeContent=true` only when the file is small enough to fit the MCP context budget. For larger assets, read metadata only and keep `maxBytes` explicit.
|
|
166
|
-
|
|
167
|
-
`genexus_read` and `genexus_edit` also support XML metadata parts such as `Layout`, `WebForm`, and `PatternInstance`. For WorkWithPlus-owned panels, `PatternInstance` resolves through the authoritative `WorkWithPlus{Name}` object instead of the parent WebPanel preview.
|
|
168
|
-
|
|
169
|
-
`genexus_open_kb` switches the active Knowledge Base for the current worker session. `genexus_export_object` writes an object part to a text file, and `genexus_import_object` reads a text file and applies it to the requested object part through the same write path used by `genexus_edit`.
|
|
170
|
-
|
|
171
|
-
## Architecture
|
|
172
|
-
|
|
173
|
-
```mermaid
|
|
174
|
-
graph LR
|
|
175
|
-
A[AI Client or Nexus-IDE] -->|MCP stdio or HTTP /mcp| B[Gateway .NET 8]
|
|
176
|
-
B -->|JSON-RPC over process boundary| C[Worker .NET Framework 4.8]
|
|
177
|
-
C -->|Native SDK| D[GeneXus KB]
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Runtime Lifecycle
|
|
181
|
-
|
|
182
|
-
- The gateway now writes a local lease keyed by `HttpPort + KBPath + InstallationPath + GX_SHADOW_PATH` and exits early when an identical live instance already owns that key.
|
|
183
|
-
- Nexus-IDE reuses the leased gateway instead of relying only on a port probe, and startup cleanup is now selective to the leased PID instead of broad `taskkill` sweeps.
|
|
184
|
-
- The worker is lazy: the gateway creates the worker on the first real command instead of at gateway boot.
|
|
185
|
-
- The worker shuts down automatically after `Server.WorkerIdleTimeoutMinutes` of inactivity, then starts again on the next command.
|
|
186
|
-
- Gateway lease files live under `%LOCALAPPDATA%\\GenexusMCP\\gateway-leases`.
|
|
187
|
-
|
|
188
|
-
## Current State
|
|
189
|
-
|
|
190
|
-
- The extension is MCP-first.
|
|
191
|
-
- The gateway and worker remain the production architecture.
|
|
192
|
-
- The HTTP transport is MCP-only at `/mcp`.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Process Lifecycle & Architecture
|
|
96
|
+
- **Lazy Worker Mapping:** The .NET 8 Gateway is resident, but the heavy .NET 4.8 Worker is lazy (only spins up when the first standard command is received) and automatically terminates after `Server.WorkerIdleTimeoutMinutes` of inactivity to unlock build artifacts.
|
|
97
|
+
- **Gateway Reuse**: Launching multiple local IDE instances reuses a single active gateway using a unique lease file located at `%LOCALAPPDATA%\GenexusMCP\gateway-leases`.
|
|
98
|
+
- **HTTP Mode**: Run via HTTP at `http://127.0.0.1:5000/mcp` (Supports SSE notifications alongside standard POST JSON-RPC). Protocol expects `MCP-Protocol-Version: 2025-06-18`.
|
|
99
|
+
|
|
100
|
+
```mermaid
|
|
101
|
+
graph LR
|
|
102
|
+
A[AI Client or Nexus-IDE] -->|MCP stdio or HTTP /mcp| B[Gateway .NET 8]
|
|
103
|
+
B -->|JSON-RPC over process boundary| C[Worker .NET Framework 4.8]
|
|
104
|
+
C -->|Native SDK| D[GeneXus KB]
|
|
105
|
+
```
|
package/{bin → cli}/run.js
RENAMED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genexus-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A high-performance Model Context Protocol (MCP) server for GeneXus 18",
|
|
5
5
|
"bin": {
|
|
6
|
-
"genexus-mcp": "
|
|
6
|
+
"genexus-mcp": "cli/run.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
|
-
"
|
|
9
|
+
"cli",
|
|
10
10
|
"publish"
|
|
11
11
|
],
|
|
12
12
|
"engines": {
|