genexus-mcp 1.1.5 → 1.1.7

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
@@ -1,101 +1,165 @@
1
- # GeneXus 18 MCP Server (Genexus18MCP)
2
-
3
- [![MCP Badge](https://lobehub.com/badge/mcp/lennix1337-genexus18mcp?style=for-the-badge)](https://lobehub.com/mcp/lennix1337-genexus18mcp)
4
-
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. 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
-
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
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!*
24
-
25
- ### 3. Add to your AI Assistant
26
- Add the `mcpServers` configuration block into your AI Tool settings.
27
-
28
- ```json
29
- "mcpServers": {
30
- "genexus": {
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'!
34
- }
35
- }
36
- ```
37
- **That's it!** The AI will automatically download the compiled Windows gateway in the background and bridge the logic directly to your local GeneXus!
38
-
39
- ---
40
-
41
- ## 🛠️ Tool Surface (Skills)
42
- *(See `GEMINI.md` for extended guidelines).* The worker natively exposes the following tools to the MCP Router:
43
-
44
- - **Search & Discovery**: `genexus_query`, `genexus_read`, `genexus_batch_read`, `genexus_inspect`, `genexus_list_objects`, `genexus_properties`
45
- - **Editing & Architecture**: `genexus_edit`, `genexus_batch_edit`, `genexus_create_object`, `genexus_refactor`, `genexus_forge`
46
- - **Analysis:** `genexus_analyze`, `genexus_inject_context`, `genexus_doc`, `genexus_explain_code`, `genexus_summarize`
47
- - **File System & Assets**: `genexus_asset`, `genexus_export_object`, `genexus_import_object`
48
- - **History & DB**: `genexus_history`, `genexus_get_sql`, `genexus_structure`
49
- - **Lifecycle & Build**: `genexus_lifecycle`, `genexus_test`, `genexus_format`
50
- - **Patterns**: Smart XML generation and interpretation (e.g., WorkWithPlus PatternInstance mapping).
51
-
52
- ---
53
-
54
- ## 💻 Development & Building from Source
55
-
56
- If you want to contribute, build the project yourself, or use the local **Nexus-IDE** VS Code Extension, use the classic source-based workflow.
57
-
58
- ### One-Click Build
59
- 1. Clone the repository to your Windows machine.
60
- 2. Run `.\setup.bat`.
61
- * *This checks prerequisites, builds the C# components, and auto-registers the local server with Claude, Codex, Antigravity, and Cursor when detected.*
62
- 3. If GeneXus or your KB are not auto-detected, follow the terminal prompts.
63
-
64
- ### Nexus-IDE (VS Code)
65
- The repository includes `src/nexus-ide`, a lightweight VS Code extension containing:
66
- - Virtual file system using the `genexus://` scheme
67
- - Dynamic KB explorer with multi-part editing (Source, Rules, Events, Variables)
68
- - Built-in MCP discovery commands (tools, resources, prompts)
69
-
70
- ### Advanced Configuration
71
- You can expand your local `config.json` for advanced networking or timeouts:
72
-
73
- ```json
74
- {
75
- "Server": {
76
- "HttpPort": 5000,
77
- "BindAddress": "127.0.0.1",
78
- "SessionIdleTimeoutMinutes": 10,
79
- "WorkerIdleTimeoutMinutes": 5
80
- },
81
- "GeneXus": {
82
- "InstallationPath": "C:\\Program Files (x86)\\GeneXus\\GeneXus18",
83
- "WorkerExecutable": "worker\\GxMcp.Worker.exe"
84
- },
85
- "Environment": {
86
- "KBPath": "C:\\KBs\\YourKB"
87
- }
88
- }
89
- ```
90
-
91
- ### Process Lifecycle & Architecture
92
- - **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.
93
- - **Gateway Reuse**: Launching multiple local IDE instances reuses a single active gateway using a unique lease file located at `%LOCALAPPDATA%\GenexusMCP\gateway-leases`.
94
- - **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`.
95
-
96
- ```mermaid
97
- graph LR
98
- A[AI Client or Nexus-IDE] -->|MCP stdio or HTTP /mcp| B[Gateway .NET 8]
99
- B -->|JSON-RPC over process boundary| C[Worker .NET Framework 4.8]
100
- C -->|Native SDK| D[GeneXus KB]
101
- ```
1
+ # GeneXus 18 MCP Server (Genexus18MCP)
2
+
3
+ [![MCP Badge](https://lobehub.com/badge/mcp/lennix1337-genexus18mcp?style=for-the-badge)](https://lobehub.com/mcp/lennix1337-genexus18mcp)
4
+
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 (Installation & Configuration)
10
+
11
+ You **do NOT** need to clone this repository, and you **do NOT** need to install anything globally via `npm i -g`. The standard Node.js `npx` runner will dynamically fetch and launch the compiled gateway for you.
12
+
13
+ ### Step 1: Configure (Non-Interactive First)
14
+
15
+ To initialize configuration in a deterministic, agent-friendly way:
16
+
17
+ ```bash
18
+ npx genexus-mcp@latest init --kb "C:\KBs\YourKB" --gx "C:\Program Files (x86)\GeneXus\GeneXus18"
19
+ ```
20
+
21
+ If you want the setup wizard prompts explicitly, run:
22
+
23
+ ```bash
24
+ npx genexus-mcp@latest init --interactive
25
+ ```
26
+
27
+ ### Step 2: Restart your AI Assistant
28
+
29
+ Once the wizard outputs `🎉 You are all set!`, simply **Restart** or **Refresh** your AI Assistant (Claude Desktop, Antigravity, Cursor, etc.). The AI will automatically spin up the server in the background and connect.
30
+
31
+ ---
32
+
33
+ ### 🤖 Auto-Installer Prompt (Copy & Paste to your AI)
34
+
35
+ If you want your AI Assistant to install and configure everything itself without you touching the terminal, copy and paste this exact prompt into your chat window:
36
+
37
+ ```markdown
38
+ Please configure your Model Context Protocol (MCP) server to connect to my GeneXus Knowledge Base by following these exact steps:
39
+
40
+ 1. Run the command `npx genexus-mcp@latest init` directly in the terminal in non-interactive mode using this configuration format (do not use interactive prompts). You must inject my raw KB path and GX path via environment variables or a direct config patch if needed, or simply let the zero-config auto-discovery handle it if we are already in the KB folder.
41
+ 2. If I haven't told you my GeneXus path or KB path, STOP and ask me for them now.
42
+ 3. Once the setup is complete, read the generated JSON block from the console output.
43
+ 4. If you use a global configuration file (like `mcp_config.json` or `claude_desktop_config.json`), insert the exact `mcpServers` block provided in the console output. Use `npx.cmd` as the command.
44
+ 5. Provide a summary of the installation and notify me when you are ready to query GeneXus!
45
+ ```
46
+
47
+ ---
48
+
49
+ ## AXI CLI Commands
50
+
51
+ The package now includes agent-facing commands optimized for shell automation:
52
+
53
+ ```bash
54
+ genexus-mcp home
55
+ genexus-mcp axi home
56
+ genexus-mcp llm help
57
+ genexus-mcp status
58
+ genexus-mcp doctor --mcp-smoke
59
+ genexus-mcp tools list
60
+ genexus-mcp config show
61
+ ```
62
+
63
+ Global AXI flags:
64
+ - `--format toon|json|text` (default for AXI commands: `toon`)
65
+ - `--fields f1,f2,...` (minimal schema by default; request extra fields explicitly)
66
+ - `--limit <n>` (for list commands)
67
+ - `--query <text>` (for `tools list`)
68
+ - `--full` (expand truncated long-form content when supported)
69
+ - `--mcp-smoke` (for `doctor`; executes protocol smoke checks)
70
+ - `--quiet` and `--no-color` (agent-safe output control)
71
+
72
+ Notes:
73
+ - Structured data/errors are emitted on `stdout`.
74
+ - Diagnostic/progress output stays on `stderr`.
75
+ - `meta.command` is always present for stable command identity in AXI outputs.
76
+ - Use `genexus-mcp <command> --help` for command-specific usage/examples.
77
+ - Output metadata includes `meta.schemaVersion` for contract stability.
78
+ - `--fields` is validated strictly per command; invalid fields return `usage_error` and exit code `2`.
79
+ - Running `genexus-mcp` without an AXI subcommand keeps the original MCP gateway launcher behavior.
80
+ - `genexus-mcp home` (`genexus-mcp axi home`) is the explicit content-first AXI entrypoint.
81
+ - `genexus-mcp llm help` returns protocol-first usage guidance for agents.
82
+ - Full LLM-facing AXI contract: [`docs/axi_cli_contract.md`](docs/axi_cli_contract.md)
83
+ - LLM usage playbook (CLI + MCP best practices): [`docs/llm_cli_mcp_playbook.md`](docs/llm_cli_mcp_playbook.md)
84
+
85
+ ---
86
+
87
+ ## 🛠️ Tool Surface (Skills)
88
+ *(See `GEMINI.md` for extended guidelines).* The worker natively exposes the following tools to the MCP Router:
89
+
90
+ - **Search & Discovery**: `genexus_query`, `genexus_read`, `genexus_batch_read`, `genexus_inspect`, `genexus_list_objects`, `genexus_properties`
91
+ - **Editing & Architecture**: `genexus_edit`, `genexus_batch_edit`, `genexus_create_object`, `genexus_refactor`, `genexus_forge`
92
+ - **Analysis:** `genexus_analyze`, `genexus_inject_context`, `genexus_doc`, `genexus_explain_code`, `genexus_summarize`
93
+ - **File System & Assets**: `genexus_asset`, `genexus_export_object`, `genexus_import_object`
94
+ - **History & DB**: `genexus_history`, `genexus_get_sql`, `genexus_structure`
95
+ - **Lifecycle & Build**: `genexus_lifecycle`, `genexus_test`, `genexus_format`
96
+ - **Patterns**: Smart XML generation and interpretation (e.g., WorkWithPlus PatternInstance mapping).
97
+
98
+ ### MCP tool response ergonomics
99
+
100
+ For `tools/call`, the gateway keeps MCP compatibility and adds lightweight response metadata:
101
+
102
+ - `meta.schemaVersion` currently `mcp-axi/1`
103
+ - `meta.tool` with the normalized tool name
104
+ - collection helpers such as `returned`, `total`, `empty`, and (when inferable) `hasMore` and `nextOffset`
105
+ - truncation signals via `meta.truncated` plus contextual `help`
106
+
107
+ For list-heavy calls (`genexus_query`, `genexus_list_objects`), optional arguments can reduce token usage:
108
+
109
+ - `fields`: explicit projection (`["name","type"]` or `"name,type"`)
110
+ - `axiCompact: true`: compact default projection
111
+
112
+ Timeout behavior for long-running MCP tools:
113
+ - Gateway may return `result.isError=true` with `status=Running` plus `operationId`/`correlationId`.
114
+ - In this case, do not fail fast. Continue with `genexus_lifecycle(action='status'|'result', target='op:<operationId>')`.
115
+
116
+ ---
117
+
118
+ ## 💻 Development & Building from Source
119
+
120
+ If you want to contribute, build the project yourself, or use the local **Nexus-IDE** VS Code Extension, use the classic source-based workflow.
121
+
122
+ ### One-Click Build
123
+ 1. Clone the repository to your Windows machine.
124
+ 2. Run `.\setup.bat`.
125
+ * *This checks prerequisites, builds the C# components, and auto-registers the local server with Claude, Codex, Antigravity, and Cursor when detected.*
126
+ 3. If GeneXus or your KB are not auto-detected, follow the terminal prompts.
127
+
128
+ ### Nexus-IDE (VS Code)
129
+ The repository includes `src/nexus-ide`, a lightweight VS Code extension containing:
130
+ - Virtual file system using the `genexus://` scheme
131
+ - Dynamic KB explorer with multi-part editing (Source, Rules, Events, Variables)
132
+ - Built-in MCP discovery commands (tools, resources, prompts)
133
+
134
+ ### Advanced Configuration
135
+ You can expand your local `config.json` for advanced networking or timeouts:
136
+
137
+ ```json
138
+ {
139
+ "Server": {
140
+ "HttpPort": 5000,
141
+ "BindAddress": "127.0.0.1",
142
+ "SessionIdleTimeoutMinutes": 10,
143
+ "WorkerIdleTimeoutMinutes": 5
144
+ },
145
+ "GeneXus": {
146
+ "InstallationPath": "C:\\Program Files (x86)\\GeneXus\\GeneXus18",
147
+ "WorkerExecutable": "worker\\GxMcp.Worker.exe"
148
+ },
149
+ "Environment": {
150
+ "KBPath": "C:\\KBs\\YourKB"
151
+ }
152
+ }
153
+ ```
154
+
155
+ ### Process Lifecycle & Architecture
156
+ - **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.
157
+ - **Gateway Reuse**: Launching multiple local IDE instances reuses a single active gateway using a unique lease file located at `%LOCALAPPDATA%\GenexusMCP\gateway-leases`.
158
+ - **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`.
159
+
160
+ ```mermaid
161
+ graph LR
162
+ A[AI Client or Nexus-IDE] -->|MCP stdio or HTTP /mcp| B[Gateway .NET 8]
163
+ B -->|JSON-RPC over process boundary| C[Worker .NET Framework 4.8]
164
+ C -->|Native SDK| D[GeneXus KB]
165
+ ```