part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The Inspector is the official tool for connecting to servers, viewing the traffic and exercising every feature. For your platform it serves three roles: debugging the servers you govern, debugging your own gateway (on both sides) and automating checks in CI.
--method), text or json output, stable exit codes.mcpdo: a client that keeps the connection open between commands (useful for session flows: tasks, subscriptions, elicitation).A per-server protocolEra setting: legacy (default: direct initialize, no probing, so as not to pollute the transcript or hang on silent stdio servers), auto (probes server/discover with fallback) and modern (pins 2026-07-28, fails loudly). --protocol-era flag in the CLI/TUI. The negotiated era is shown as a badge. Each feature behaves according to the era: logging (set per session vs per request), subscriptions (resources/subscribe vs subscriptions/listen with a stream status badge), tasks (tab gated by capabilities.tasks vs by the extension; tasks/result vs tasks/get), MRTR (rounds in the modal, MRTR_MAX_ROUNDS limit), Mcp-* headers and tools excluded for an invalid x-mcp-header, error taxonomy (-32020/-32021/-32022), cancellation (closing the stream vs a notification), sessions (DELETE vs nothing). There are composable test servers with per-scenario configurations in the repository.
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
mcp-inspector --cli https://api.example.com/mcp --transport http --method tools/call --tool-name get_weather --tool-arg city=Madrid --format json
mcp-inspector --cli --config ./mcp.json --server myserver --method resources/read --uri file:///x
Methods: initialize (probe), tools/list (--strict for schema portability), tools/call (--tool-arg k=v with schema-based coercion, or --tool-args-json), resources/*, prompts/*, logging/setLevel (legacy only), skills/list|get (--verify, --require-digests), servers/* (catalogue without connecting; servers/add|edit|remove). --app-info detects MCP Apps without invoking the tool.
Exit codes: 0 ok; 1 usage/error; 2 no app; 3 requires auth; 4 unreachable; 5 tool error or not found; 6 non-portable schema (--strict); 7 non-conformant skill; 8 incomplete verification; 9 skill without digests. On failure, a JSON line on stderr with code, message, status, url.
Authorisation in scripts: --stored-auth-only (never interactive; CI) and --use-stored-auth (reuses tokens from the web Inspector). Without a TTY, it fails fast with auth_required. It honours HTTPS_PROXY/NO_PROXY.
It runs commands and stores secrets: servers/show redacts env, sensitive headers and OAuth secrets, but not credentials embedded in URLs or args. It has its own threat model page.
protocolEra: modern and with legacy to validate both north-facing sides; point it at each governed server to compare what the Inspector sees with what your gateway sees.tools/list --strict --format json against each approved server and a diff of the catalogue; skills/list --verify --require-digests if you govern skills; --stored-auth-only.1. What is the Inspector's default era, and why?
A debugging tool must not probe on its own.
2. Which exit code does the CLI return if tools/call returns isError: true?
5 covers tool error and tool not found.
3. Which flag guarantees that the CLI never starts interactive OAuth in CI?
It uses tokens from the store or fails with auth_required.