René's URL Explorer Experiment


Title: Support client_credentials flow with JWT and Basic auth by pcarleton · Pull Request #1663 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Support client_credentials flow with JWT and Basic auth by pcarleton · Pull Request #1663 · modelcontextprotocol/python-sdk

X Title: Support client_credentials flow with JWT and Basic auth by pcarleton · Pull Request #1663 · modelcontextprotocol/python-sdk

Description: Summary Implements SEP-1046 OAuth client_credentials flow support with simplified providers for machine-to-machine authentication. New OAuth Providers ClientCredentialsOAuthProvider: For client_credentials grant with client_id + client_secret Supports client_secret_basic (default) and client_secret_post auth methods Sets client_info directly, bypassing dynamic client registration PrivateKeyJWTOAuthProvider: For client_credentials grant with private_key_jwt authentication (RFC 7523 Section 2.2) Takes an assertion_provider callback that receives the audience (authorization server's issuer identifier per RFC 7523bis) and returns a JWT Designed for workload identity federation (GCP, AWS IAM, Azure AD) SignedJWTParameters: Helper class for SDK-signed JWT assertions create_assertion_provider() returns a callback for use with PrivateKeyJWTOAuthProvider static_assertion_provider(): Helper for pre-built JWTs that don't need the audience parameter Deprecation RFC7523OAuthClientProvider is now deprecated with a DeprecationWarning. The original implementation incorrectly used RFC 7523 Section 2.1 (jwt-bearer authorization grant where the JWT itself is the authorization) instead of the intended Section 2.2 (private_key_jwt client authentication with grant_type=client_credentials). Use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider instead. Example Usage # Simple client credentials with client_id + secret provider = ClientCredentialsOAuthProvider( server_url="https://api.example.com", storage=my_token_storage, client_id="my-client-id", client_secret="my-client-secret", ) # Private key JWT with workload identity federation async def get_workload_identity_token(audience: str) -> str: return await fetch_token_from_identity_provider(audience=audience) provider = PrivateKeyJWTOAuthProvider( server_url="https://api.example.com", storage=my_token_storage, client_id="my-client-id", assertion_provider=get_workload_identity_token, ) # Private key JWT with SDK-signed assertions jwt_params = SignedJWTParameters( issuer="my-client-id", subject="my-client-id", signing_key=private_key_pem, ) provider = PrivateKeyJWTOAuthProvider( server_url="https://api.example.com", storage=my_token_storage, client_id="my-client-id", assertion_provider=jwt_params.create_assertion_provider(), ) Testing Unit tests with 100% coverage for new providers Conformance tests pending

Open Graph Description: Summary Implements SEP-1046 OAuth client_credentials flow support with simplified providers for machine-to-machine authentication. New OAuth Providers ClientCredentialsOAuthProvider: For client_c...

X Description: Summary Implements SEP-1046 OAuth client_credentials flow support with simplified providers for machine-to-machine authentication. New OAuth Providers ClientCredentialsOAuthProvider: For client_c...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1663

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:cfef77fa-285e-7cf1-23ec-4b2e9bbf56fc
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8B02:A194E:2868FA:38D7AC:696E51D4
html-safe-nonced6c395b277a6dc5cc82a32d51ed2d9e845712bed4617d13d8a9768c6ba8237ba
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjAyOkExOTRFOjI4NjhGQTozOEQ3QUM6Njk2RTUxRDQiLCJ2aXNpdG9yX2lkIjoiNDUxNzYxODExNzY2NTMwNTE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0bf391a4bd642e8b60be04738fbdadaa3a527d5bfa308aef69e2770bdaed315e
hovercard-subject-tagpull_request:3041730247
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/1663/files
twitter:imagehttps://avatars.githubusercontent.com/u/704663?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/704663?s=400&v=4
og:image:altSummary Implements SEP-1046 OAuth client_credentials flow support with simplified providers for machine-to-machine authentication. New OAuth Providers ClientCredentialsOAuthProvider: For client_c...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonefd6f183b765d548d18ed5f3a1ce2c0e2a4ddbde2c74596c9d55c1a08b3e5572a
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea52ed9988fadfee5477eba0f6835cc823d7d8b33
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1663%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1663%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 21.2k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 238 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 90 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects 0 https://github.com/modelcontextprotocol/python-sdk/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/modelcontextprotocol/python-sdk/security
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Code https://github.com/modelcontextprotocol/python-sdk
Issues https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Security https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
pcarletonhttps://github.com/pcarleton
mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
pcarleton/client-credentials-jwthttps://github.com/modelcontextprotocol/python-sdk/tree/pcarleton/client-credentials-jwt
Conversation 5 https://github.com/modelcontextprotocol/python-sdk/pull/1663
Commits 6 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits
Checks 21 https://github.com/modelcontextprotocol/python-sdk/pull/1663/checks
Files changed 3 https://github.com/modelcontextprotocol/python-sdk/pull/1663/files
Support client_credentials flow with JWT and Basic auth https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#top
Show all changes 6 commits https://github.com/modelcontextprotocol/python-sdk/pull/1663/files
b007b28 Add simplified OAuth providers for client credentials flows (SEP-1046) pcarleton Nov 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits/b007b281c6b5d6fc8913ec8a52b30a34ed24c83b
684eafd Fix client_credentials providers to set client_info in _initialize pcarleton Nov 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits/684eafdd327d61a99ca373f7b3bcf25a2ec97751
c22e551 Fix CI failures: formatting and coverage pcarleton Nov 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits/c22e551e7a933089a6d45ba49c94c416c401f3d7
ffcc7c7 Fix pyright errors in test_client_credentials.py pcarleton Nov 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits/ffcc7c7d54645e9210d6a8eba4617eed59c9d761
db8b270 Remove accidental test skips from test_stdio.py pcarleton Nov 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits/db8b2704d4a0c158383541305f1cff5b1f617d1f
d19c8bc Merge branch 'main' into pcarleton/client-credentials-jwt felixweinberger Nov 26, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1663/commits/d19c8bc6cdd792bd34fe587ee8e3b1583224999a
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/1663/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
client_credentials.py https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-6837d10b5e4119fce79b4c19036beeebb72e274519503c921453ce4309f8c2c9
test_client_credentials.py https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-c84aa56739a1205229f9ca6a502589d65984e9461e55324c600702a40f28986f
examples/clients/conformance-auth-client/mcp_conformance_auth_client/__init__.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
View file https://github.com/modelcontextprotocol/python-sdk/blob/d19c8bc6cdd792bd34fe587ee8e3b1583224999a/examples/clients/conformance-auth-client/mcp_conformance_auth_client/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1663/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
https://github.com/modelcontextprotocol/python-sdk/pull/1663/files#diff-355f368a67f281c06c9fea5f8c6555cc76de54649c623fa6792d9f31099c57a8
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1663/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.