CLI: method-specific flags given to another method are silently ignored (--cursor / --tool-arg on tools/list, …)

オープン 初心者向け
#3,073 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
nodejs, typescript
領域
cli

調査の方向性

フラグは、インスペクターの --cli モードにおけるCLI引数処理で解析されます。そこでは --load-scenario と --advertise-apps が、非互換なフラグを使用法エラーとして既に拒否しています。まずそこから始めて、既存のメソッドとフラグの対応を検証している箇所を探してください。--cursor、--tool-arg、その他のメソッド固有のフラグが、それらが適用されるメソッド名を含むメッセージとともに失敗するように、同様のチェックを追加してください。tools/list --cursor abc がそのメッセージとともにゼロ以外の終了コードで終了し、有効な組み合わせが引き続き実行されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Which version line?

v2 — current (@modelcontextprotocol/inspector@latest)

Which client?

CLI

Inspector version

2.17.0 (main @ 2069a1a, built from source)

Node version

v22.23.5

Operating system (and browser, for the web client)

Linux

Transport

stdio

MCP server under inspection

Minimal echo server (probe-echo.mjs), SDK 2.4.0:

import * as z from "zod/v4";
import { McpServer } from "@modelcontextprotocol/server";
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
const server = new McpServer({ name: "probe-echo", version: "1.0.0" });
server.registerTool("echo_raw", { description: "Echo raw arguments", inputSchema: z.object({}).passthrough() },
  async (args) => ({ content: [{ type: "text", text: JSON.stringify(args) }] }));
server.registerPrompt("echo_prompt", { description: "Echo", argsSchema: { a: z.string().optional(), b: z.string().optional() } },
  async (args) => ({ messages: [{ role: "user", content: { type: "text", text: JSON.stringify(args) } }] }));
await server.connect(new StdioServerTransport());
Steps to reproduce
mcp-inspector --cli node probe-echo.mjs --method tools/list --cursor abc     # exit 0, full list
mcp-inspector --cli node probe-echo.mjs --method tools/list --tool-arg a=1  # exit 0
Expected behavior

A usage error naming the methods the flag applies to. The CLI already follows this rule elsewhere: --advertise-apps and --strict are rejected where they would be ignored (the code comment: an invocation "cannot accept the flag and ignore it"), and --load-scenario rejects --tool-name / --tool-arg because they "would be silently overridden".

Actual behavior

Exit 0; the flag has no effect. This matters most for --cursor: tools/list, resources/list and prompts/list take a cursor in MCP, so a script paging with --cursor appears to work but gets the same page every time.

Logs, errors, or screenshots

Suggested fix: a table from each method-specific flag (--tool-name, --tool-arg, --tool-args-json, --tool-metadata, --prompt-name, --prompt-args, --uri, --cursor, --event-name, --event-arg, --log-level) to the methods that use it, rejecting any other combination. Alternatively, support --cursor on the */list methods.

Already prototyped a fix?

No response

Before you submit
  • I searched existing issues and this is not a duplicate.
  • This is not a security vulnerability report (those go through the private advisory process).
主要言語
TypeScript
スター
11.3k
フォーク
1.6k
平均マージ
2時間 28分
マージ済み PR(30日)
111

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/inspector のほかの issue

modelcontextprotocol/inspector の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。