Skip to content

fix(cli): reject missing mcp add option values - #7996

Merged
morluto merged 6 commits into
morluto:mainfrom
STDquantum:fix/7609-mcp-add-missing-option-value
Nov 4, 2026
Merged

morluto merged 6 commits into
morluto:mainfrom
STDquantum:fix/7609-mcp-add-missing-option-value

Conversation

@STDquantum

@STDquantum STDquantum commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #7609. Reject missing values for --agent, --command, and -c before Incur can silently proceed with default registration.

Problem and expected behavior

Incur 0.6.1 ignores a trailing valued option and can consume the next option token as its value. Calls such as mcp add --agent, mcp add --command, and mcp add --command --agent amp can therefore report success without the requested selector or launcher. Empty equals forms, including -c=, must also fail validation.

Change and scope

Adds a CLI-boundary check for absent values, option-shaped tokens in value positions, and empty equals forms. The guard returns a structured validation error before registration. A valid Amp registration control remains covered. This is an ordinary CLI parser fix; no maintainer scope decision is applicable.

PR #7453 handles surplus positional arguments, and the closed #7919 handles discovery requests reaching registration; neither addresses missing option values.

Contract and boundary impact

  • Semantic owner and earliest changed stage: CLI raw-token validation before Incur's built-in mcp add parser.
  • Contribution scope fit and linked maintainer decision: Existing CLI boundary; not applicable.
  • CLI and MCP/tool-catalog contract: Missing values return VALIDATION_ERROR on agent or command; no MCP schema or catalog change.
  • Provider, bridge, target-format, or platform compatibility: No provider change.
  • Evidence, artifact, provenance, or reconstruction contract: Not applicable.
  • Target selection, authority, upstream behavior, and cleanup details: Invalid input is rejected before registration; valid registration behavior remains delegated to Incur.
  • Generated metadata, package, or installation impact: None expected.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/cli/mcpAddOptionValidation.test.ts covers trailing long and short options, empty --agent= and -c=, an option swallowed as a value, and valid Amp registration in an isolated home.
  • Base reproduction or other evidence: Issue [Bug] MCP registration ignores missing values for --agent and --command #7609 records successful registration with absent values. Incur 0.6.1's parser consumes a following token as the value without checking whether it is another option; the new guard runs first.
  • User-visible CLI/MCP output: Missing values return VALIDATION_ERROR and identify the missing field; no runtime output captured in this task.
  • Remaining proof gaps: Focused test not run here; no real client registration was performed.
  • Boundary/lifecycle regressions: Covers CLI argument admission and checks the valid registration control. No process lifecycle change.

Validation performed

  • git diff --check origin/main...fix/7609-mcp-add-missing-option-value — passed.
  • Focused test — not run.

Compatibility, safety, and release

  • Breaking changes or migration steps: None; incomplete option forms now fail instead of proceeding with defaults.
  • Real Hopper/Ghidra, browser, or OS coverage: Not applicable.
  • Package or release metadata impact: None expected.
  • Security, privacy, process, or containment review: Prevents malformed registration requests from unexpectedly writing client configuration.

Author readiness

Human owner: @STDquantum

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved; no additional maintainer decision applies.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs and generated metadata need no updates for this CLI fix.
  • User-visible CLI output has not been captured in this task.
  • I checked the reviewed diff for secrets, unrelated cleanup, and unsupported claims.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable defect was established.

Summary

Adds early checks for missing mcp add option values before registration.

  • The CLI rejects incomplete MCP add options before registration.

Reviews (3) · Last reviewed commit: "chore: keep main formatting out of merge..." · Reviewed by Greptile

@STDquantum
STDquantum marked this pull request as ready for review October 29, 2026 05:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T07:52:01.865416Z
We couldn’t complete this review. Comment @codex review to try again.
c8c9bd2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@STDquantum
STDquantum marked this pull request as draft October 29, 2026 07:37
@STDquantum
STDquantum marked this pull request as ready for review October 29, 2026 07:51
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto
morluto merged commit 094ec5e into morluto:main Nov 4, 2026
42 checks passed
@STDquantum
STDquantum deleted the fix/7609-mcp-add-missing-option-value branch November 6, 2026 07:39
@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MCP registration ignores missing values for --agent and --command

2 participants