modelcontextprotocol / modelcontextprotocol/python-sdk
Support MCP client session resumption (sessionId reuse) in Python SDK
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 24.3k
- フォーク
- 4k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 31
説明
Description
Summary
The Python MCP SDK currently appears to create a new session whenever a client is instantiated. It would be valuable to support resuming an existing MCP session using a previously issued sessionId, similar to functionality discussed and addressed in the C# SDK (see modelcontextprotocol/csharp-sdk#946).
This would enable persistent and stateful workflows in agent-based systems.
Problem
At present, there does not appear to be a documented way in the Python SDK to:
- Reuse an existing sessionId
- Resume a previously established MCP session
- Control session lifecycle independently of the client object's lifetime
Why This Is Important
- In agent-driven architectures , session continuity allows:
- More efficient orchestration
- Reduced overhead from repeated session initialization
As MCP adoption grows across SDKs (C#, TypeScript, Python), having consistent session lifecycle capabilities improves cross-language parity and developer experience.
References
https://github.com/modelcontextprotocol/csharp-sdk/issues/946
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Python SDK がクライアントセッションを作成・管理する方法を追跡し、次にセッション再開のコンテキストについて、リンク先の C# SDK issue を確認します。完了条件には、以前発行された sessionId を再利用するサポート対象の方法、クライアントのライフサイクルに依存せずにセッションを再開する方法、およびその動作のドキュメント化が含まれます。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100