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

未关闭 适合新手
#3,133 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
67/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
cli

调研方向

Issue 指出了单次运行 CLI 的方法验证和针对各方法的 flag 检查,但没有提到文件或测试。先追踪 --method 支持在哪里检查,以及 --uri 和 --event-name 等 flag 在哪里验证;然后找到相关的 CLI 测试。当不支持的方法会先被报告为不受支持,再出现方法专属 flag 错误,并且现有的退出行为得以保留时,工作即告完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
11.4k
派生
1.6k
平均合并
2 小时 27 分钟
30 天内合并 PR
121

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/inspector 的其他 Issue

查看 modelcontextprotocol/inspector 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。