[GH-ISSUE #1127] fix(cli): mcp doctor rejects its advertised help option #400

Closed
opened 2026-10-15 18:24:46 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1127

Summary

rea mcp doctor --help exits 1 with VALIDATION_ERROR rather than showing the command's usage. The parent rea mcp --help advertises both the doctor subcommand and the global --help option, and the CLI guide directs users to command help for arguments and output options.

Runtime or environment

Executed published rea-agents 6.0.0, whose release tag points to 6fee42689ae6e95a0182e0d4d0f55644e73e72be, on macOS 27.0 arm64 with Node.js 22.23.2 and npm 12.0.2. Inspected current main at 84a17d55199b1b46493aea6bf4e41029a3b200fc; the executable dispatcher and MCP doctor option parser are unchanged from the release. The main build was not executed.

Area: CLI. Interface: CLI. Earliest failure stage: request parsing or validation. Target context: not applicable; these help requests need no provider, target or client configuration.

Steps to reproduce

From an empty disposable directory, install the published package locally with npm install --no-save rea-agents@6.0.0, then execute these commands and record each process status:

./node_modules/.bin/rea mcp --help
./node_modules/.bin/rea mcp doctor --help
./node_modules/.bin/rea doctor --help

Expected behavior

The doctor's --help request should display its supported usage and options and exit 0 without running the diagnostic session, as the advertised help option and CLI guide promise. The ordinary doctor and parent MCP help requests should continue to succeed.

Actual behavior

The parent MCP help exits 0 and includes the following entries:

Commands:
  add     Register as MCP server
  doctor  Validate MCP server startup and tool listing

Global Options:
  --help  Show help

The MCP doctor help request exits 1 and writes this output to stdout, with empty stderr:

code: VALIDATION_ERROR
message: "Unknown mcp doctor option: --help"

The ordinary rea doctor --help control exits 0 and shows its usage, readiness options and global help option.

Evidence

  • Expected source: the release's executed parent help output above and the current CLI guide, which directs callers to a command's --help for arguments and output options.
  • Failure source: the package subprocess observation above; current dispatcher routing sends this request directly to MCP doctor, whose option parser rejects --help.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Open and closed issues and PRs were searched for mcp doctor with help, and related MCP doctor implementation PRs were inspected. No report covering this rejected help request was found.

Restoration check

Run the same three help requests. Each should exit 0 and show the relevant usage. MCP doctor help should describe its actual accepted output options and return without starting a server session; a genuinely unknown option should retain an actionable validation error.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: A documented command-discovery request fails, preventing users from obtaining the diagnostic command's arguments and output options through its advertised interface. The diagnostic command itself is not shown to fail by this reproduction.
  • Workaround status: available
  • Workaround basis: The CLI documentation and successful parent MCP help remain available. The latter supplies the command's purpose, while the MCP doctor source option parser lists its accepted output options.
Originally created by @coygeek on GitHub (Oct 8, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1127 ## Summary `rea mcp doctor --help` exits 1 with `VALIDATION_ERROR` rather than showing the command's usage. The parent `rea mcp --help` advertises both the doctor subcommand and the global `--help` option, and the CLI guide directs users to command help for arguments and output options. ## Runtime or environment Executed published `rea-agents` 6.0.0, whose release tag points to `6fee42689ae6e95a0182e0d4d0f55644e73e72be`, on macOS 27.0 arm64 with Node.js 22.23.2 and npm 12.0.2. Inspected current `main` at `84a17d55199b1b46493aea6bf4e41029a3b200fc`; the executable dispatcher and MCP doctor option parser are unchanged from the release. The main build was not executed. Area: CLI. Interface: CLI. Earliest failure stage: request parsing or validation. Target context: not applicable; these help requests need no provider, target or client configuration. ## Steps to reproduce From an empty disposable directory, install the published package locally with `npm install --no-save rea-agents@6.0.0`, then execute these commands and record each process status: ```sh ./node_modules/.bin/rea mcp --help ./node_modules/.bin/rea mcp doctor --help ./node_modules/.bin/rea doctor --help ``` ## Expected behavior The doctor's `--help` request should display its supported usage and options and exit 0 without running the diagnostic session, as the advertised help option and CLI guide promise. The ordinary doctor and parent MCP help requests should continue to succeed. ## Actual behavior The parent MCP help exits 0 and includes the following entries: ```text Commands: add Register as MCP server doctor Validate MCP server startup and tool listing Global Options: --help Show help ``` The MCP doctor help request exits 1 and writes this output to stdout, with empty stderr: ```text code: VALIDATION_ERROR message: "Unknown mcp doctor option: --help" ``` The ordinary `rea doctor --help` control exits 0 and shows its usage, readiness options and global help option. ## Evidence - Expected source: the release's executed parent help output above and the current [CLI guide](https://github.com/morluto/rea/blob/84a17d55199b1b46493aea6bf4e41029a3b200fc/docs/cli.md#L42-L43), which directs callers to a command's `--help` for arguments and output options. - Failure source: the package subprocess observation above; current [dispatcher routing](https://github.com/morluto/rea/blob/84a17d55199b1b46493aea6bf4e41029a3b200fc/scripts/rea.mjs#L16-L40) sends this request directly to MCP doctor, whose [option parser](https://github.com/morluto/rea/blob/84a17d55199b1b46493aea6bf4e41029a3b200fc/src/mcpDoctor.ts#L259-L293) rejects `--help`. - Evidence provenance: observed - Local verification: reproduced - Reproduction completeness: complete Open and closed issues and PRs were searched for `mcp doctor` with `help`, and related MCP doctor implementation PRs were inspected. No report covering this rejected help request was found. ## Restoration check Run the same three help requests. Each should exit 0 and show the relevant usage. MCP doctor help should describe its actual accepted output options and return without starting a server session; a genuinely unknown option should retain an actionable validation error. ## Triage assessment - Impact level: P2 - Assessment status: supported - Impact basis: A documented command-discovery request fails, preventing users from obtaining the diagnostic command's arguments and output options through its advertised interface. The diagnostic command itself is not shown to fail by this reproduction. - Workaround status: available - Workaround basis: The CLI documentation and successful parent MCP help remain available. The latter supplies the command's purpose, while the MCP doctor source option parser lists its accepted output options.
bsakaguchi 2026-10-15 18:24:46 +00:00
Author
Owner

@N0zoM1z0 commented on GitHub (Oct 9, 2026):

Fixed by a69b8337 and b7d803dd. Verified built CLI mcp --help, mcp doctor --help, and doctor --help all exit 0 with usage text; unknown options and --format --help still fail with exit 1. Main CI at 283c82f68c passed: https://github.com/morluto/rea/actions/runs/37862776952 .

<!-- gh-comment-id:6071688838 --> @N0zoM1z0 commented on GitHub (Oct 9, 2026): Fixed by a69b8337 and b7d803dd. Verified built CLI `mcp --help`, `mcp doctor --help`, and `doctor --help` all exit 0 with usage text; unknown options and `--format --help` still fail with exit 1. Main CI at 283c82f68ce49037a5e3ffdf0cada9208aef69f3 passed: https://github.com/morluto/rea/actions/runs/37862776952 .
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#400
No description provided.