Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CLI: OAuth denials and other non-usage failures exit 1 with code "error", the same as a usage error

Aperta
#2,842 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript

Direzione di ricerca

Start with core/cli/error-handler.ts and trace classifyError plus the CLI exit code definitions. Check how OAuth callback and token endpoint errors, callback timeouts, and FetchTargetError reach the handler. The issue is done when protocol failures have distinct machine-readable outcomes and exit codes while genuine usage errors still return the usage code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug v2
Which version line?

v2 — current (@modelcontextprotocol/inspector@latest)

Which client?

CLI

Inspector version

2.13.0 (v2/main @ d7f6cee4, built from source)

Node version

v22.23.4

Operating system (and browser, for the web client)

Linux (Debian)

Transport

Streamable HTTP

MCP server under inspection

The repo's own OAuth test server: node test-servers/build/server-composable.js --config test-servers/configs/oauth-revocation-http.json (Streamable HTTP on :8083, DCR + refresh + revocation).

Steps to reproduce
  1. Start the OAuth test server above.
  2. mcp-inspector --cli http://127.0.0.1:8083/mcp --transport http --method tools/list (interactive OAuth).
  3. Decline at the authorization server, so the callback carries error=access_denied.
Expected behavior

A distinct, machine-readable outcome for an OAuth protocol error — e.g. code oauth_error with exit 3 (AUTH_REQUIRED), and error / error_description as separate envelope fields — so a script or CI job can tell "the authorization server said no" from "the command line is wrong".

Actual behavior

{"error":{"code":"error","message":"<error_description>"}} and exit 1, which EXIT_CODES defines as USAGE.

The catch-all at the end of classifyError (core/cli/error-handler.ts) returns EXIT_CODES.USAGE / "error" for anything not matched earlier, so OAuth callback errors, OAuth callback timeouts and fetch-guard refusals (FetchTargetError) all exit 1 with the same code as a mistyped flag.

Logs, errors, or screenshots

Suggested: classify OAuth callback / token-endpoint protocol errors as oauth_error (exit 3), FetchTargetError as fetch_refused, the callback timeout as its own code, and keep exit 1 for genuine usage errors only.

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).
Lingua principale
TypeScript
Stelle
11.2k
Fork
1.6k
Merge medio
4h 55m
PR unite (30g)
151

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/inspector

Tutte le issue di modelcontextprotocol/inspector

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.