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 摘要。