CLI: an unsupported --method plus a method-specific flag reports the flag error, not "Unsupported method"

Open Beginner friendly
#3,133 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

The issue identifies the one-shot CLI method validation and per-method flag checks, but names no files or tests. Start by tracing where --method support is checked and where flags such as --uri and --event-name are validated; then find the relevant CLI tests. Done when unsupported methods are reported as unsupported before method-specific flag errors, with the existing exit behavior preserved.

Written by the indexing model from the issue text.

Description

bug v2

Found during the v2.18.0 release smoke (#3127), driving #3073 / PR #3081.

Problem

PR #3081 says events/stream and resources/subscribe, which the one-shot CLI does not support, "are rejected as unsupported first". That holds only when no method-specific flag is passed. Given one, the flag's error wins, and it reads as if the method existed:

$ mcp-inspector --cli node srv.mjs --method resources/subscribe --uri file:///x
--uri applies only to --method resources/read, --method resources/directory/read or --method skills/get; it has no effect with --method resources/subscribe.

$ mcp-inspector --cli … --method events/stream --event-name x
--event-name applies only to --method events/poll; it has no effect with --method events/stream.

Without the flag, the CLI correctly prints Unsupported method: resources/subscribe. Supported --cli methods: …. Every case exits 1, so scripts are unaffected; only the message misleads.

Expected

An unsupported --method is reported as unsupported before the per-method flag checks run.

Dominant language
TypeScript
Stars
11.4k
Forks
1.6k
Avg merge
2h 27m
Merged PRs (30d)
121

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/inspector

All issues in modelcontextprotocol/inspector

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.