modelcontextprotocol / modelcontextprotocol/python-sdk
`auth` specification in `ClientSessionGroup`
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 24.3k
- 分支
- 4k
- 平均合併
- 1 天 1 小時
- 30 天內合併 PR
- 31
描述
Description
It would be nice for the ClientSessionGroup to be OAuth compatible by allowing us to specify the OAuth httpx.Auth provider when passing in the ServerParameters rather than passing the bearer tokens manually via the headers field. This will allow us to do the OAuth token exchange flow straight from the ClientSessionGroup.
References
Here is the singleton ClientSession example of an OAuth flow: https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py
It would be nice to have an example of a ClientSessionGroup using that same flow.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先從 ClientSessionGroup 及其對 ServerParameters 的處理著手,然後將其與 examples/clients/simple-auth-client/mcp_simple_auth_client/main.py 中參照的 singleton OAuth 流程進行比較。確認應如何提供 OAuth httpx.Auth provider,並新增一個使用相同流程的 ClientSessionGroup 範例。完成的標準是該 group 支援此 provider,而不需要手動傳遞 bearer token,且範例能夠展示這一點。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api, authentication
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 活躍
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100