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

CLI and mcpdo JSON error envelopes drop the structured Retry-After data from a 429

Chiusa
#2,772 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@cliffhall ci sta già lavorando.

Dal 25/10/2026.

  • #2795 di @cliffhall — integrata

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, cli, testing

Direzione di ricerca

Start in core/cli/error-handler.ts and read how it builds the shared JSON error envelope, then trace AnnotatedRateLimitData in core/mcp/rateLimit.ts. Follow each CLI's output path and add or update tests for both clients, including parsed, malformed, and missing Retry-After values. Done means both envelopes preserve the structured data consistently and the issue's open decision about a dedicated code and exit code is resolved.

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

Descrizione

enhancement v2

Found during the v2.12.0 release smoke (#2764), while verifying #2442 / PR #2737.

Problem

#2737 annotates a throttled request's error with structured rate-limit data on error.data (AnnotatedRateLimitData in core/mcp/rateLimit.ts: method, retryAfter, retryAfterMs). That is so "any consumer that wants a countdown or JSON output" can act on it. The CLIs' JSON error envelopes drop it, so a script driving them can only scrape the prose message:

# one-shot CLI, tools/list answered with 429 + Retry-After: 30
{"error":{"code":"error","message":"Rate limited by the server (HTTP 429) on tools/list. The server asked to retry after 30s. Error POSTing to endpoint: slow down","cause":"Error POSTing to endpoint: slow down","status":429}}

# mcpdo, same server
{"error":{"code":"error","message":"Rate limited by the server (HTTP 429) on tools/list. The server asked to retry after 30s. Error POSTing to endpoint: slow down"}}

The envelope is built in core/cli/error-handler.ts, which both CLIs share (#2461).

Expected

When the error carries rate-limit data, the envelope adds the structured fields alongside the existing ones, for example:

{"error":{"code":"rate_limited","message":"…","status":429,"method":"tools/list","retryAfter":"30","retryAfterMs":30000}}
  • retryAfter is the header as sent, which AnnotatedRateLimitData already preserves verbatim for a malformed value.
  • retryAfterMs is present only when the header parsed.
  • A missing header omits both fields rather than emitting null, or emits null consistently, whichever the envelope's existing conventions favor.
  • Whether a dedicated code (and exit code) is worth adding for rate limiting is part of this issue to decide. The current "error" / exit 1 is the fallback.

Both CLIs need tests, since the envelope is shared but each client's output path is separate.

Lingua principale
TypeScript
Stelle
11.1k
Fork
1.6k
Merge medio
4h 56m
PR unite (30g)
155

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.