Repository navigation
fix(cli): reject surplus MCP registration arguments - #7453
Ha1baraA11 wants to merge 7 commits into
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The reviewed changes appear safe to merge, with no new blocking issue established. SummaryAdds an early check for extra
No new actionable findings were established. The previous threads were unnumbered, so they have no numbered ledger entries. Ha1baraA11 manually resolved the earlier help-text thread without an explanatory reply. Tests were not run during this review; dependencies were not installed. GitHub replacement status could not be checked because authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CLI arguments] --> B{Output controls valid?}
B -->|No| C[Report output error]
B -->|Yes| D{Extra mcp add arguments?}
D -->|Yes| E[Report positional error and exit]
D -->|No| F[Existing discovery and registration checks]
F --> G[Register selected clients when requested]
Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
Hey @Ha1baraA11, thanks for putting this together, the fix looks useful. What's left: it has merge conflicts with main in |
…n-20261106 # Conflicts: # src/cli.ts
|
Closing this PR because the underlying issue was resolved by merged PR #9057, which addresses the same MCP registration argument validation. Thanks for reviewing and testing this contribution. |
Summary
rea mcp addrejects unexpected positional arguments before writing client configuration.Related to #7375
Problem and expected behavior
mcp addroute, which reaches the settings writer without rejecting its unbound positional tail.docs/cli.mdalready requires surplus positionals to be rejected before execution; checking the built-in route at the outer CLI boundary restores that documented behavior without changing valid registration.Change and scope
mcp addpositional tail before Incur dispatches registration, returning a nonzero CLI error when extra arguments are present.Contract and boundary impact
src/cli/strictPositionals.ts, before Incur dispatches built-inmcp addto its Amp settings writer;src/cli.tssupplies the configured CLI name for the diagnostic.mcp add; no MCP tool schema, server protocol, or generated catalog changes.node --versioncommand is not executed.docs/public/product-catalog.json), package, or installation impact: none.Evidence and regression coverage
tests/boundary/cli/mcpAddPositionals.test.ts,rejects surplus positional arguments to built-in MCP registration before writing configuration; it checks the JSON error, absence of a settings file for the rejected call, and the expected settings entry for a valid control.expect(invalid.exitCode).toBe(1)with actual 0.{"code":"UNKNOWN","message":"Unexpected positional arguments: \"extra\". Use 'rea mcp add --help' for the declared argument shape."}.Validation performed
node scripts/run-exact-tests.mjs -t '^rejects surplus positional arguments to built-in MCP registration before writing configuration$' --reporter verbose tests/boundary/cli/mcpAddPositionals.test.ts— 1 passed.npx --yes [email protected] [email protected] -- npm ci— passed.npx --yes [email protected] [email protected] -- npm run test:focused -- src/ghidra/GhidraInstallation.test.ts— 113 passed.npx --yes [email protected] [email protected] -- npm run check:fast— passed.Compatibility, safety, and release
node --versionas test configuration data and does not start that command or an external MCP client.Author readiness
Human owner: @Ha1baraA11
Before merge
type(scope): outcome.