#1723·python-sdk

`auth` specification in `ClientSessionGroup`

Author: erwang01Created Dec 4, 2025Updated Sep 17, 2026
LabelsauthenhancementP2help wantedneeds decision

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.

Source: modelcontextprotocol/python-sdk