Support MCP client session resumption (sessionId reuse) in Python SDK
還沒有人認領這個 Issue。
評估
研究方向
先追蹤 Python SDK 如何建立及管理用戶端工作階段,然後檢視連結的 C# SDK issue,以了解工作階段恢復的脈絡。完成後應包括一種受支援的方式來重新使用先前簽發的 sessionId、獨立於用戶端生命週期恢復工作階段,以及記錄相關行為。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- Python
- 星號
- 24.3k
- 分支
- 4k
- 平均合併
- 1 天 16 小時
- 30 天內合併 PR
- 25
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
modelcontextprotocol/python-sdk 的其他 Issue
-
v1 v2
難度 2/5 1-3 小時 新手友好度 70/100
modelcontextprotocol/python-sdk#3578 · 1 則留言 ·
-
v1 v2
難度 2/5 1-3 小時 新手友好度 65/100
modelcontextprotocol/python-sdk#3573 · 2 則留言 ·
-
v2
難度 2/5 1-3 小時 新手友好度 75/100
modelcontextprotocol/python-sdk#3566 ·
-
v1 v2
難度 2/5 1-3 小時 新手友好度 85/100
modelcontextprotocol/python-sdk#3546 · 5 則留言 ·
-
v1 v2
難度 2/5 1-3 小時 新手友好度 76/100
modelcontextprotocol/python-sdk#3545 · 2 則留言 ·
查看 modelcontextprotocol/python-sdk 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
難度 2/5 1-3 小時 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 1/5 1 小時以內 新手友好度 80/100
learningequality/kolibri#15351 · 2 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
Name consistency 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
eellak/triplestore#65 · 1 則留言 ·