Labsco
lennix1337 logo

Genexus MCP

β˜… 20

from lennix1337

GeneXus 18 MCP server for Claude, Cursor, and AI agents β€” read, edit, analyze KB objects (transactions, web panels, procedures, SDTs) over the Model Context Protocol.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

GeneXus MCP Server β€” GeneXus 18 for Claude, Cursor, and AI Agents

npm downloads

MCP Badge

ΒΏHablΓ‘s espaΓ±ol? β†’ GuΓ­a de inicio en espaΓ±ol Fala portuguΓͺs? β†’ Guia de inΓ­cio em portuguΓͺs Stuck? β†’ Troubleshooting guide


GeneXus MCP Server lets AI agents β€” Claude Desktop, Claude Code, Cursor, Antigravity, and any MCP-compatible client β€” read, edit, analyze, and refactor objects inside a GeneXus 18 Knowledge Base. It talks to the native GeneXus SDK, so the agent works with the real KB, not a copy or a parsed approximation.

In practice: you point the MCP at your KB, then ask your AI assistant things like "list all transactions with attribute CustomerId", "add a rule to the Order transaction that validates the total", or "refactor this procedure to use the new SDT" β€” and it does it.


What can I ask the AI?

Once installed, here's what unlocks. Try these as your first prompts:

Exploration

  • "List all objects of type Procedure in the KB."
  • "Show me the source of the procedure CalculateInvoiceTotal."
  • "Find all transactions that reference the attribute CustomerId."

Editing

  • "Add a rule to the Order transaction: error('Total must be positive') if Total < 0."
  • "Add a new attribute CreatedAt of type DateTime to the Customer transaction."
  • "Rename the variable &qty to &quantity in procedure CreateOrder."

WorkWithPlus pattern editing (full structural + theming control)

  • "In WorkWithPlusOrder, add a 'Duplicate' button to the transaction view alongside Save/Cancel/Delete."
  • "Group the Customer transaction attributes into a 'Contact Info' section with theme class GroupTelaResp."
  • "On the WorkWithPlusInvoice list, add a new ordering by InvoiceDate descending."
  • "Style the Save button on WorkWithPlusOrder with buttonClass='btn ButtonGreen' and apply BigTitle to the form header."
  • "Remove the Export action from the Selection grid of WorkWithPlusReport."
  • "Read the Documentation part of the transaction Customer and rewrite it in markdown."

Analysis

  • "Explain what the procedure ProcessShipment does, step by step."
  • "What SQL does the query in WebPanel CustomerList generate?"
  • "Summarize the structure of the Sales module."

Build & lifecycle

  • "Build the KB and report any errors."
  • "Run the unit tests and show me which failed."

The agent picks the right tool from the 30+ tools the MCP exposes (read, edit, refactor, analyze, build, layout automation, history, SQL preview, etc.). The full tool list is in Tool Surface below.


Supported AI clients

Auto-detected and auto-configured by the installer:

ClientAuto-configNotes
Claude Desktopβœ…Restart required after install
Claude Code (CLI)βœ…Reload session
Cursorβœ…Restart required
Antigravityβœ…Restart required; detected even before its MCP config exists
Gemini CLIβœ…β€”
OpenCode (CLI)βœ…Reads opencode.json / opencode.jsonc
Codex CLIβœ…Writes ~/.codex/config.toml
VS Code / VS Code Insidersβœ…Native MCP (User/mcp.json); restart required
OpenCode DesktopDetect-onlyReported as installed; add the server from the app's settings
Any MCP clientManualUse the JSON snippet printed by init

Run npx genexus-mcp clients at any time to see which agents are installed, which have genexus registered, and whether any point at a stale gateway exe. To (re)register specific ones: npx genexus-mcp clients add --clients antigravity,vscode.


Tool Surface

The worker exposes these tool families to the MCP router. (Detailed schemas in GEMINI.md.)

  • Search & Discovery β€” genexus_query, genexus_read, genexus_inspect, genexus_list_objects, genexus_properties
  • Editing & Architecture β€” genexus_edit, genexus_create_object, genexus_delete_object, genexus_refactor, genexus_forge, genexus_add_variable
  • Analysis β€” genexus_analyze (modes: linter, navigation, hierarchy, impact, data_context, ui_context, pattern_metadata, summary, explain), genexus_inject_context, genexus_doc, genexus_search_source
  • File System & Assets β€” genexus_asset, genexus_export_object, genexus_import_object
  • History & DB β€” genexus_history, genexus_sql (action=ddl or action=navigation), genexus_structure
  • Lifecycle & Build β€” genexus_lifecycle, genexus_test, genexus_format
  • Native Layout SDK β€” genexus_layout (get_tree, find_controls, set_property, rename_printblock, add_printblock, get_preview, …)
  • KB pool (v2.3.0+) β€” genexus_kb (list, open, close, set_default) for multi-KB parallel work
  • WorkWithPlus pattern editing β€” full read/write of PatternInstance and PatternVirtual parts via genexus_read / genexus_edit. Supports the entire pattern XML surface: containers (<table>, groups), controls (<textBlock>, <errorViewer>, <attribute>, <gridAttribute>, <filterAttribute>), actions (<standardAction>, <userAction>), grids, orders, rules, and event blocks. Both Transaction and Selection views are addressable independently (XPath /instance/transaction/... vs /instance/level/selection/...).
  • Documentation & Help parts β€” Documentation (rich text / markdown) and Help (HTML) are now first-class write targets via genexus_edit (fixed in v2.4.4 β€” both parts had a silent no-op bug previously).
  • Theme classes & styling β€” apply real ThemeClass values (themeClass, buttonClass, groupThemeClass, cellThemeClass, etc) so generated screens use the KB's design system. Discover the available classes with genexus_list_objects --typeFilter ThemeClass --nameFilter <Button|TextBlock|Title> and apply them in the pattern XML.

Multi-KB (v2.3.0+): every non-meta tool takes an optional kb argument (alias or absolute path). The gateway can hold up to Server.MaxOpenKbs (default 3) KBs open at once, each in its own Worker process β€” calls to different KBs run truly in parallel. See Advanced Configuration for the KBs[] schema.

Edit modes (genexus_edit): full (whole-part replacement, default), patch (Replace/Insert_After/Append over a context anchor β€” works on source code AND pattern XML), ops (typed semantic ops like set_attribute, add_rule for source-bearing parts).

Pattern XML auto-reconcile: WorkWithPlus encodes IDE rendering order in a per-parent childrenOrderedList attribute. The MCP now rebuilds (and creates if missing) every list from the actual XML child order on each write β€” callers only describe where an element goes in the tree and the MCP makes the IDE render it there. The response includes a childrenOrderedListReconciliation block listing each (re)written parent plus any structural elements that couldn't be inferred safely.

Safe by default: all write tools accept dryRun: true (returns a preview without mutating the KB) and idempotencyKey (safe retries; concurrent calls coalesce, results cached 15 min).


WorkWithPlus pattern editing β€” what you can actually do

WorkWithPlus patterns are XML documents that drive Transaction-and-Selection screens. The MCP exposes the entire surface so an agent can design or restructure a screen without opening the IDE:

CapabilityTool / patternStatus
Read PatternInstance / PatternVirtual XMLgenexus_read --part PatternInstanceβœ…
Replace whole pattern (mode: full)genexus_edit --mode full --part PatternInstanceβœ… verified live
Find/replace text-style patches (mode: patch)genexus_edit --mode patch --part PatternInstance --operation Replaceβœ… verified live
Add / remove / reorder structural elements (textBlock, attribute, standardAction, table-as-group, order, filterAttribute, gridAttribute, eventBlock…)XML edit + auto-reconcileβœ… verified live
Theme classes (themeClass, buttonClass, groupThemeClass, cellThemeClass, format="HTML")XML attribute on the elementβœ… verified live
Reorganize Transaction view (form layout, action row)edit under /instance/transaction/...βœ… verified live
Reorganize Selection view (list/grid, filters, orders)edit under /instance/level/selection/...βœ… verified live
Auto-rebuild childrenOrderedList from XML orderdone implicitly on every write; report under childrenOrderedListReconciliationβœ… verified live

Recommended workflow for a screen redesign:

  1. genexus_list_objects --typeFilter ThemeClass --nameFilter Button β€” discover the actual button classes available in this KB (ButtonGreen, ButtonBlue, ButtonRed, etc β€” names vary per KB).
  2. genexus_read --name WorkWithPlus<Object> --part PatternInstance β€” get the current XML.
  3. Edit the XML in memory (LLM): wrap attributes in a <table isGroup="True" title="…" groupThemeClass="GroupTelaResp">, reorder buttons, add a new <standardAction>, attach buttonClass="btn ButtonGreen", etc.
  4. genexus_edit --mode full --part PatternInstance --content "<new xml>" β€” the MCP rewrites the part, reconciles childrenOrderedList on every container, and verifies the round-trip.
  5. Read back to confirm; refresh the GeneXus IDE to see the result.

Custom buttons use <userAction>, not <standardAction>. Trn_Enter / Trn_Cancel / Trn_Delete are the only registered standard actions on a WorkWithPlus transaction; any custom button (Duplicate, Audit, Export, etc.) must be a <userAction caption="…" name="…" buttonClass="btn ButtonGreen" confirm="False" />. The MCP's reconciler treats <userAction> as a peer of <standardAction> (same typeCode 17/18 by context), so they coexist in the same TableActions row and the IDE renders them side-by-side.

Things to know (orientation, not gotchas):

  • WorkWithPlus normalizes some attributes after every save. Certain fields are bound to the underlying transaction (e.g., title on top-level groups derives from the transaction's friendly name). When "Apply this pattern on save" is enabled on the WorkWithPlus object, the engine recomputes those fields β€” same behavior whether you edit in the IDE or via MCP. To make a hard override stick, toggle that flag via MCP:
    { "tool": "genexus_properties",
      "arguments": { "action": "set", "name": "WorkWithPlus<Object>",
                     "propertyName": "SDPlus_Editor_Apply_On_Save", "value": "False" } }
    Accepts "True" | "False" | "Default" (Default inherits the KB-level setting). Set back to "Default" to re-enable engine recomputation. Validated live in this repo.
  • Structural safety is enforced by the SDK. If you submit XML that violates pattern invariants (e.g., a <transaction> without a <level>, or a <standardAction> whose name isn't a registered action), the SDK rejects the save and the MCP returns the exact error so you can fix the input. The KB never ends up half-written.
  • The IDE Pattern preview is a structural mockup, not a styled render. Theme CSS (buttonClass, themeClass, fonts, colors) is resolved at runtime, not in the preview canvas β€” so even after a successful MCP write the preview pane will look generic. To verify styling: open the element in the IDE tree and check the right-hand Properties panel (the applied classes show there), or hit Run / Live Editing to see the real CSS. This is GeneXus IDE behavior, independent of how the pattern was edited.

AXI CLI (for agents and automation)

The genexus-mcp command itself is also an agent-facing CLI with token-optimized output:

genexus-mcp status               # gateway/worker state
genexus-mcp doctor --mcp-smoke   # health check + protocol probe
genexus-mcp tools list           # list available tools
genexus-mcp config show          # current resolved config
genexus-mcp layout status        # native layout automation state

Global flags: --format toon|json|text Β· --fields f1,f2,... Β· --limit N Β· --query <text> Β· --quiet Β· --no-color.

Full contract: docs/axi_cli_contract.md. Best-practices playbook: docs/llm_cli_mcp_playbook.md.


Development & building from source

Want to contribute or run a local dev build?

  1. Clone this repo on Windows.
  2. Run .\setup.bat β€” checks prerequisites, builds the C# components, and auto-registers the local build with detected AI clients.
  3. If GeneXus or your KB aren't auto-detected, follow the prompts.

Bundled AI skills (.gemini/skills/)

This repo ships a set of agent skills under .gemini/skills/ that any MCP-compatible client with skill support (Gemini CLI, Claude Code via plugin, etc.) can load to ground its GeneXus reasoning:

SkillWhat it gives the agent
genexus-masteryThis repository's preferred MCP workflow + multi-KB usage
genexus18-guidelinesLocal engineering rules layered on top of Nexa
nexaFull GeneXus 18 reference set: every object type, command, type, property β€” imported from the official genexuslabs/genexus-skills
frontend/chameleon-controls-library58 Chameleon UI component specs
frontend/mercury-design-systemMercury tokens, bundles, theming
frontend/design-system-builderAuthoring custom design systems
frontend/ui-creatorPanel/screen generation templates

Third-party skills are Apache 2.0 (see .gemini/skills/NOTICE.md). To refresh against upstream, follow the steps in NOTICE.md.

Nexus-IDE (VS Code extension β€” optional, not auto-installed)

src/nexus-ide is a lightweight, experimental VS Code extension in the repo. The installer no longer packages or installs it β€” VS Code is wired up as a native MCP client instead (see Supported AI clients). If you want the extension, build and install it manually:

cd src/nexus-ide; npm ci; npm run compile
npx --yes @vscode/vsce package --out nexus-ide.vsix
code --install-extension nexus-ide.vsix --force

It provides a virtual filesystem (genexus:// scheme), a KB explorer with multi-part editing, and MCP discovery commands.

Automated release

  • Workflow: .github/workflows/release.yml
  • Trigger: push to main with a package.json version bump
  • Behavior: publishes to npm if version is new + creates a GitHub Release tagged v<version>
  • Required secret: NPM_TOKEN