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

Client transports/sessions swallow the original exception; applications cannot classify 401/403/429 transport failures

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

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

評価

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

調査の方向性

Look at the client transport and session code handling HTTP requests, likely in modules like mcp/client/transports or mcp/client/session. The issue mentions SSE/streamable-HTTP transports and httpx.HTTPStatusError. Start by finding where exceptions are caught and logged, and where the stream is closed. The goal is to modify the error propagation so the original exception reaches send_request callers. Testing will involve simulating transport failures (401, 403, 429) to verify the exception is correctly delivered.

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

説明

Initial Checks
  • I confirm that I'm using the newest release of my line (verified on main and 2.2.0)
  • I confirm that I searched for my issue in the issues before opening this one (searched "exception pending request", "error classification", "McpError generic")
Release line

v2 (v1 shares the code)

Description

When a transport request fails mid-flight (HTTP 401/403/429, connection reset, etc.), the client transports log the exception and close the stream, and pending send_request callers get a generic closed-stream error. The original exception — with its status code — never reaches the application, so a host cannot distinguish "token expired, re-authorize" from "rate limited, back off" from "server gone".

Proposal, in two parts (we run both in production and can PR them):

  1. SSE/streamable-HTTP transports forward the caught exception into the read stream (instead of only logger.exception), so the session sees it.
  2. Client/shared sessions deliver that raw exception to the pending request(s) — the default message handler re-raises Exception instances — so send_request callers receive the real httpx.HTTPStatusError and can classify it.

One caveat worth discussing: httpx exceptions stringify with the request URL, which can carry credentials in query strings; our transport-side change logs only the exception type name and leaves scrubbing to the application that receives the raw exception.

Happy to be assigned and open the PR(s).

🤖 Generated with Claude Code

主要言語
Python
スター
24.3k
フォーク
4k
平均マージ
1日 16時間
マージ済み PR(30日)
25

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

modelcontextprotocol/python-sdk のほかの issue

modelcontextprotocol/python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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