modelcontextprotocol / modelcontextprotocol/python-sdk
docs: clarify when Client(raise_exceptions=True) actually raises
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 24.3k
- フォーク
- 4k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 31
説明
Description
Client exposes raise_exceptions: bool = False with a code TODO asking when raise_exceptions=True actually raises:
https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/client.py (around the raise_exceptions field)
What's missing
There is no clear user-facing documentation of:
- Which failure modes are affected (in-process server exceptions vs transport/protocol errors)
- How this interacts with
ExceptionGroupwrapping fromasync with Client(...) - Recommended patterns vs catching
MCPErrorinside the context manager (asdocs/troubleshooting.mdalready teaches)
Proposed work
- Trace current behavior on
mainfor in-memory and HTTP clients - Document the real semantics in
docs/client/and/ordocs/troubleshooting.md - Add a small docs_src example and/or regression test if behavior is surprising
- Only change runtime behavior if docs reveal a clear bug; prefer docs-first
Related
- TODO(Marcelo) on
Client.raise_exceptionsinsrc/mcp/client/client.py - #1401 ClientSession Error Handling (different surface; has an open PR)
- troubleshooting ExceptionGroup guidance
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
src/mcp/client/client.py の raise_exceptions TODO から始め、インメモリクライアントと HTTP クライアントの現在の挙動を、async with Client(...) における ExceptionGroup の処理も含めて追跡します。これを docs/troubleshooting.md のガイダンスと比較し、確認できたセマンティクスを docs/client/ および/または docs/troubleshooting.md にドキュメント化します。ユーザーが影響を受ける失敗を特定し、推奨されるパターンとコンテキストマネージャー内で MCPError を捕捉する方法のどちらかを選択できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 72/100