Repository navigation
fix(cli): prevent mcp discovery from registering clients - #7919
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; the previous format-parsing finding is fixed and no new blocking issue was found. SummaryThe PR stops
No new actionable issues or security concerns were found. Review conclusions are based on source checks; no runtime tests were run. Whether another PR supersedes this one could not be checked because GitHub access required authentication. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Normalized CLI arguments] --> B{mcp add discovery?}
B -->|Schema| C[Parse shared output controls]
C --> D[Write schema or output-control error]
D --> E[Exit without registration]
B -->|Version| F[Write version without registration]
B -->|Help, manifest, or ordinary command| G[Existing Incur dispatch]
Reviews (2) · Last reviewed commit: "fix(cli): use shared output parsing for ..." · Reviewed by Greptile |
Summary
Related to #7580.
rea mcp add --agent amp --schema --jsonpreviously registered the server while the caller requested discovery. It now reportsSCHEMA_UNAVAILABLEwithout changing client settings;--versionreturns the version without registering. This stops the unintended writes but does not provide the requested schema.Problem and expected behavior
Incur dispatches its MCP registration builtin before its schema and version handling. Discovery must not apply configuration changes.
Change and scope
Use REA's existing Incur builtin argument split to recognize discovery before dispatch. Return an explicit unsupported-schema error, formatted using the shared CLI output parser, and preserve help and manifest precedence. CSV/TSV are rejected as unable to represent the error document. Ordinary registration remains owned by Incur. The similar optional Incur skills installer is disabled by REA. PR #7453 addresses the separate surplus-positional issue #7375.
Contract and boundary impact
mcp addexplicitly fail withSCHEMA_UNAVAILABLErather than registering; userea mcp add --helpto inspect options.Expected effects:
Evidence and regression coverage
--schema --jsonreturns codeSCHEMA_UNAVAILABLEand directs users tomcp add --help.Validation performed
npm run build:cachedwith Node 24.22.1 — passed.npm run test:focused -- tests/boundary/cli/mcpAddDiscovery.test.tswith Node 24.22.1 — passed.npm run test:focused -- tests/boundary/cli/cliOutput.test.tswith Node 24.22.1 — passed (64 tests).npm run check:fastandnpm run lint— blocked by duplicate imports already present on the base revision intests/boundary/mcp/serverUnknownsMcp.test.ts(lines 2–3 and 31–32).Compatibility, safety, and release
Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.