Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#2,772 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

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.

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

説明

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.

主要言語
TypeScript
スター
11.1k
フォーク
1.6k
平均マージ
5時間 29分
マージ済み PR(30日)
158

環境構築

はじめの一歩

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

modelcontextprotocol/inspector のほかの issue

modelcontextprotocol/inspector の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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