modelcontextprotocol / modelcontextprotocol/python-sdk

`auth` specification in `ClientSessionGroup`

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

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

auth enhancement help wanted needs decision P2
主要言語
Python
スター
24.3k
フォーク
4k
平均マージ
1日 1時間
マージ済み PR(30日)
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.

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

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

はじめの一歩

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

調査の方向性

まず ClientSessionGroup とその ServerParameters の処理を確認し、次に参照されている examples/clients/simple-auth-client/mcp_simple_auth_client/main.py の singleton OAuth フローと比較します。OAuth httpx.Auth provider をどのように渡すべきかを確認し、同じフローを使用する ClientSessionGroup の例を追加します。グループが bearer token を手動で渡さずに provider をサポートし、その例でそれが示されていれば完了です。

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

評価

技術スタック
python
領域
api, authentication
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

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

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