gx CLI is a component of GeneXus for Agents that acts as an intermediary layer between an agentic CLI (for example, CODA CLI, Claude Code CLI, or another CLI compatible with LLMs or agents) and the GeneXus MCP Server.
You submit natural language requests to an agentic CLI, which executes gx commands, and the gx CLI handles the communication with the GeneXus MCP Server.
The GeneXus for Agents setup installs the GeneXus MCP Server and the gx CLI. The Nexa skill contains the necessary information for the gx CLI to start the MCP Server automatically.
-
No configuration required in the agentic CLI. To use the MCP Server directly, the server must be registered in each client (URL, transport, and so on). With gx CLI, the agentic CLI simply executes a terminal command —no MCP configuration is required. In fact, it works with any agentic CLI capable of running commands, even if it does not support MCP.
-
Fits the way coding agents operate. CODA CLI, Claude Code CLI, and similar agents are already built around the idea of "run a command and read its output." gx CLI allows GeneXus to behave like any other CLI tool in its toolbox (such as git or npm). Using MCP directly requires the agent to act as an MCP client and manage the connection.
-
Avoids MCP session fragility. The MCP transport relies on long-lived SSE sessions that the client must keep alive: the GET request times out after about five minutes of inactivity, and the client must implement reconnection and resume correctly. By contrast, the gx CLI performs a single request per command and then exits—there is no persistent connection to maintain.
-
Simplifies KB context resolution. The MCP Server determines the KB based on the session's cwd (through roots/list or the currentDirectory argument), using several mechanisms. On the other hand, gx CLI runs within the working directory and resolves the KB on each invocation, without requiring the agent to negotiate roots or maintain a session.
-
Keeps the agentic CLI context lightweight. If the agentic CLI connects directly to MCP, all tools and their schemas become part of the agent's tool list, consuming tokens and adding noise. When using the gx CLI, the agentic CLI sees only one thing (gx CLI) and discovers commands on demand (gx list-tools, gx --help) only when needed. This reduces context consumption and keeps the tool list cleaner.
-
Deterministic and composable. The gx CLI provides clear exit codes (0 = OK, 1 = error, 130 = interrupted) and a parseable final line (RESULT: or --json), so the agent can reliably act on the outcome of each command.
-
Real-time progress visibility. gx CLI captures the events generated during MCP Server operations (Create KB, create objects, build, etc.) and displays them directly in the console, so warnings, errors, and progress updates can be monitored as they occur. This provides better execution feedback through streaming to the agentic CLI.
-
Greater robustness for long-running operations. gx CLI was specifically designed to manage communication and session lifecycle handling with the GeneXus MCP Server, improving connection stability and providing more consistent execution during long-running processes.
The GeneXus for Agents setup automatically installs the gx CLI. To identify which gx CLI version is installed, open a terminal and run gx --version.