genexus-mcp 1.1.6 → 1.2.0
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 +114 -20
- package/cli/commands/axi.js +1048 -0
- package/cli/index.js +460 -0
- package/cli/lib/config.js +192 -0
- package/cli/lib/output.js +117 -0
- package/cli/run.js +11 -184
- package/cli/run.test.js +326 -0
- package/docs/llm_cli_mcp_playbook.md +129 -0
- package/package.json +30 -25
- package/publish/GxMcp.Gateway.deps.json +0 -125
- package/publish/GxMcp.Gateway.dll +0 -0
- package/publish/GxMcp.Gateway.exe +0 -0
- package/publish/GxMcp.Gateway.pdb +0 -0
- package/publish/GxMcp.Gateway.runtimeconfig.json +0 -20
- package/publish/Newtonsoft.Json.dll +0 -0
- package/publish/System.CodeDom.dll +0 -0
- package/publish/System.Management.dll +0 -0
- package/publish/System.Security.Permissions.dll +0 -0
- package/publish/System.Windows.Extensions.dll +0 -0
- package/publish/config.json +0 -19
- package/publish/gateway_debug.log +0 -5995
- package/publish/gateway_debug.prev.log +0 -5
- package/publish/gateway_panic.log +0 -16
- package/publish/runtimes/win/lib/net8.0/System.Management.dll +0 -0
- package/publish/runtimes/win/lib/net8.0/System.Windows.Extensions.dll +0 -0
- package/publish/start_mcp.bat +0 -22
- package/publish/tool_definitions.json +0 -899
- package/publish/web.config +0 -12
- package/publish/worker/DataTracing.log +0 -0
- package/publish/worker/GxMcp.Worker.exe +0 -0
- package/publish/worker/GxMcp.Worker.exe.config +0 -76
- package/publish/worker/GxMcp.Worker.pdb +0 -0
- package/publish/worker/Newtonsoft.Json.dll +0 -0
- package/publish/worker/ProcArqCandUniGra.md +0 -160
- package/publish/worker/cache/search_index.json +0 -1
- package/publish/worker/search_index.json +0 -1
- package/publish/worker/worker_debug.log +0 -84
- package/publish/worker/worker_debug.prev.log +0 -32
- package/publish/worker/worker_entlib.log +0 -123
package/README.md
CHANGED
|
@@ -6,35 +6,97 @@ A high-performance Model Context Protocol (MCP) server for GeneXus 18. It integr
|
|
|
6
6
|
|
|
7
7
|
***
|
|
8
8
|
|
|
9
|
-
## 🚀 Quick Start (
|
|
9
|
+
## 🚀 Quick Start (Installation & Configuration)
|
|
10
10
|
|
|
11
|
-
You **do
|
|
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
12
|
|
|
13
|
-
### 1
|
|
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!
|
|
13
|
+
### Step 1: Configure (Non-Interactive First)
|
|
15
14
|
|
|
16
|
-
|
|
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**:
|
|
15
|
+
To initialize configuration in a deterministic, agent-friendly way:
|
|
19
16
|
|
|
20
17
|
```bash
|
|
21
|
-
npx genexus-mcp init
|
|
18
|
+
npx genexus-mcp@latest init --kb "C:\KBs\YourKB" --gx "C:\Program Files (x86)\GeneXus\GeneXus18"
|
|
22
19
|
```
|
|
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
20
|
|
|
25
|
-
|
|
26
|
-
Add the `mcpServers` configuration block into your AI Tool settings.
|
|
21
|
+
If you want the setup wizard prompts explicitly, run:
|
|
27
22
|
|
|
28
|
-
```
|
|
29
|
-
|
|
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
|
-
}
|
|
23
|
+
```bash
|
|
24
|
+
npx genexus-mcp@latest init --interactive
|
|
36
25
|
```
|
|
37
|
-
|
|
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
|
+
genexus-mcp layout status
|
|
62
|
+
genexus-mcp layout run --action activate-layout
|
|
63
|
+
genexus-mcp layout run --action activate-tab --tab "Layout"
|
|
64
|
+
genexus-mcp layout inspect --tab "Layout"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Global AXI flags:
|
|
68
|
+
- `--format toon|json|text` (default for AXI commands: `toon`)
|
|
69
|
+
- `--fields f1,f2,...` (minimal schema by default; request extra fields explicitly)
|
|
70
|
+
- `--limit <n>` (for list commands)
|
|
71
|
+
- `--query <text>` (for `tools list`)
|
|
72
|
+
- `--full` (expand truncated long-form content when supported)
|
|
73
|
+
- `--mcp-smoke` (for `doctor`; executes protocol smoke checks)
|
|
74
|
+
- `--quiet` and `--no-color` (agent-safe output control)
|
|
75
|
+
|
|
76
|
+
Layout automation flags (`layout run`):
|
|
77
|
+
- `--action focus|activate-layout|activate-tab|send-keys|type-text|click`
|
|
78
|
+
- `--title "<window-title-fragment>"` to target a specific GeneXus window
|
|
79
|
+
- `--tab "<tab-name>"` for `activate-tab`
|
|
80
|
+
- `--keys "<sendkeys-pattern>"` for `send-keys`
|
|
81
|
+
- `--text "<text>"` for `type-text`
|
|
82
|
+
- `--x <screenX> --y <screenY>` for `click`
|
|
83
|
+
|
|
84
|
+
Layout inspection:
|
|
85
|
+
- `genexus-mcp layout inspect [--tab "<tab-name>"] [--limit N] [--full] [--title "<window-title-fragment>"]`
|
|
86
|
+
- Returns UI Automation controls with bounding rectangles (`bounds.x/y/width/height`) to support deterministic replay.
|
|
87
|
+
|
|
88
|
+
Notes:
|
|
89
|
+
- Structured data/errors are emitted on `stdout`.
|
|
90
|
+
- Diagnostic/progress output stays on `stderr`.
|
|
91
|
+
- `meta.command` is always present for stable command identity in AXI outputs.
|
|
92
|
+
- Use `genexus-mcp <command> --help` for command-specific usage/examples.
|
|
93
|
+
- Output metadata includes `meta.schemaVersion` for contract stability.
|
|
94
|
+
- `--fields` is validated strictly per command; invalid fields return `usage_error` and exit code `2`.
|
|
95
|
+
- Running `genexus-mcp` without an AXI subcommand keeps the original MCP gateway launcher behavior.
|
|
96
|
+
- `genexus-mcp home` (`genexus-mcp axi home`) is the explicit content-first AXI entrypoint.
|
|
97
|
+
- `genexus-mcp llm help` returns protocol-first usage guidance for agents.
|
|
98
|
+
- Full LLM-facing AXI contract: [`docs/axi_cli_contract.md`](docs/axi_cli_contract.md)
|
|
99
|
+
- LLM usage playbook (CLI + MCP best practices): [`docs/llm_cli_mcp_playbook.md`](docs/llm_cli_mcp_playbook.md)
|
|
38
100
|
|
|
39
101
|
---
|
|
40
102
|
|
|
@@ -46,15 +108,47 @@ Add the `mcpServers` configuration block into your AI Tool settings.
|
|
|
46
108
|
- **Analysis:** `genexus_analyze`, `genexus_inject_context`, `genexus_doc`, `genexus_explain_code`, `genexus_summarize`
|
|
47
109
|
- **File System & Assets**: `genexus_asset`, `genexus_export_object`, `genexus_import_object`
|
|
48
110
|
- **History & DB**: `genexus_history`, `genexus_get_sql`, `genexus_structure`
|
|
111
|
+
- **Native Layout SDK**: `genexus_layout` (`get_tree`, `find_controls`, `set_property`, `set_properties`, `rename_printblock`, `add_printblock`, `get_preview`, `scan_mutators`)
|
|
112
|
+
|
|
113
|
+
Layout color note:
|
|
114
|
+
- For `ForeColor`, `BackColor`, `BorderColor`, send color values as palette names (`Black`, `Blue`, `Red`, `Transparent`) or RGB token (`R; G; B|`) to avoid nested SDK wrappers.
|
|
49
115
|
- **Lifecycle & Build**: `genexus_lifecycle`, `genexus_test`, `genexus_format`
|
|
50
116
|
- **Patterns**: Smart XML generation and interpretation (e.g., WorkWithPlus PatternInstance mapping).
|
|
51
117
|
|
|
118
|
+
### MCP tool response ergonomics
|
|
119
|
+
|
|
120
|
+
For `tools/call`, the gateway keeps MCP compatibility and adds lightweight response metadata:
|
|
121
|
+
|
|
122
|
+
- `meta.schemaVersion` currently `mcp-axi/1`
|
|
123
|
+
- `meta.tool` with the normalized tool name
|
|
124
|
+
- collection helpers such as `returned`, `total`, `empty`, and (when inferable) `hasMore` and `nextOffset`
|
|
125
|
+
- truncation signals via `meta.truncated` plus contextual `help`
|
|
126
|
+
|
|
127
|
+
For list-heavy calls (`genexus_query`, `genexus_list_objects`), optional arguments can reduce token usage:
|
|
128
|
+
|
|
129
|
+
- `fields`: explicit projection (`["name","type"]` or `"name,type"`)
|
|
130
|
+
- `axiCompact: true`: compact default projection
|
|
131
|
+
|
|
132
|
+
Timeout behavior for long-running MCP tools:
|
|
133
|
+
- Gateway may return `result.isError=true` with `status=Running` plus `operationId`/`correlationId`.
|
|
134
|
+
- In this case, do not fail fast. Continue with `genexus_lifecycle(action='status'|'result', target='op:<operationId>')`.
|
|
135
|
+
|
|
52
136
|
---
|
|
53
137
|
|
|
54
138
|
## 💻 Development & Building from Source
|
|
55
139
|
|
|
56
140
|
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
141
|
|
|
142
|
+
### Automated Release (npm + GitHub)
|
|
143
|
+
- Workflow: `.github/workflows/release.yml`
|
|
144
|
+
- Trigger: `push` na `main` com mudança em `package.json`
|
|
145
|
+
- Behavior:
|
|
146
|
+
- compara a versão atual com a versão do commit anterior
|
|
147
|
+
- publica no npm apenas se a versão for nova
|
|
148
|
+
- cria GitHub Release com tag `v<version>`
|
|
149
|
+
- Required secret:
|
|
150
|
+
- `NPM_TOKEN` (token de publicação no npm com permissão para o pacote `genexus-mcp`)
|
|
151
|
+
|
|
58
152
|
### One-Click Build
|
|
59
153
|
1. Clone the repository to your Windows machine.
|
|
60
154
|
2. Run `.\setup.bat`.
|