gx Docs

MCP

Connect the gx MCP server to Claude Code, Cursor, Codex, and other MCP clients.

The MCP server ships with the CLI as a local stdio binary. It shells out to the CLI, so repo state stays on your machine. It exposes one tool: gx_review.

Install

curl -fsSL https://download.gx.run/install.sh | sh
export ANTHROPIC_API_KEY=...   # or OPENAI_API_KEY — the review calls a model

Register with your agent

gx init registers the server automatically with agent CLIs found on your PATH (Claude Code, Cursor, Codex) and reports something like MCP ok: Claude Code, Cursor.

Most clients load MCP servers at startup — restart the client or open a new chat after registering.

To register by hand, the stdio shape is:

{
  "mcpServers": {
    "gx": {
      "command": "/Users/you/.local/bin/gx-mcp",
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-...",
        "GX_BINARY": "/Users/you/.local/bin/gx"
      }
    }
  }
}

Put the model key in that env block. An MCP server is spawned by your editor, not from a shell, so it inherits whatever environment the editor was launched with — which is usually not the one in your profile. A key that is missing there means no reviewer runs, and the tool says so.

GX_BINARY is optional; the server finds the CLI in ~/.local/bin or on PATH without it.

gx_review

ParameterTypeMeaning
promptstringoptional intent, e.g. "fix the auth timeout" — passed as the positional argument, and the reviewer holds the diff against it
scopeenumfocused lens: architecture, security, performance, onboarding, docs, dependencies, testing, maintainability
focusstringlimit review to files under this path prefix
deepbooleanfull-spectrum review with more local and indexed context
verbosebooleaninclude repo facts, docs, and changed files
repobooleanreview the whole repository instead of the current change
cwdstringrepository working directory (defaults to the MCP server process cwd)

Runs gx review --no-comment --client mcp, so an agent asking for review context never comments on a pull request. Posting a comment stays a deliberate act of the CLI, where a human typed the command.

There is no fast parameter, and there was one. Its description told the caller to use it "for interactive reviews someone is waiting on" — which is every review arriving through MCP, so agents selected it essentially always. What it selected was a review with no verification pass, which is the pass that decides what blocks a ship. --fast still exists on the CLI, where a human choosing it knows the trade.

The tool is read-only and never initializes a repository. May run up to 5 minutes. A no-ship verdict is a successful tool call, not an error — the verdict lives in the report's final Verdict: / Next: lines, with the blocking and advisory lanes and a FIX PLAN above them. See the CLI reference for what those mean.

Saving is plain Git, not MCP calls: git add and git commit through the installed hooks. There is no gx commit verb and nothing to publish.

AGENTS.md instructions

gx init offers to append these instructions to your repo's AGENTS.md. If you skipped that step, add them manually:

# Agents

Version control: plain Git. Once `gx init` installs the hooks, gx records each commit as a reviewable revision automatically — there is no gx save verb.

Default flow:
- Run `git add` to stage the files for this revision.
- Run `git commit -m "..."` to save. A gx hook records the commit as a reviewable revision.
- Run plain `git push`. There is no gx save or push verb, and nothing is uploaded anywhere.
- Open PRs with `gh pr create` (or the GitHub UI).
- To amend, use `git commit --amend` and preserve the `gx-revision:` trailer in the message.

For AI review, run the `gx_review` MCP tool (or the `gx review` CLI) on the current change.

On this page