René's URL Explorer Experiment


Title: SEP-2207: Refresh token guidance by wdawson · Pull Request #2039 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: SEP-2207: Refresh token guidance by wdawson · Pull Request #2039 · modelcontextprotocol/python-sdk

X Title: SEP-2207: Refresh token guidance by wdawson · Pull Request #2039 · modelcontextprotocol/python-sdk

Description: Implement OIDC-flavored refresh token guidance (SEP-2207) in the Python SDK client. Motivation and Context MCP clients interacting with OIDC-flavored Authorization Servers often don't receive refresh tokens because they aren't requesting offline_access. This leads to poor UX (frequent re-authentication). SEP-2207 provides guidance for how MCP clients should handle this. The Python SDK's default OAuthClientMetadata already includes refresh_token in grant_types, but the client was not augmenting authorization request scopes with offline_access when the Authorization Server advertises support for it. This change brings the Python SDK in line with the TypeScript SDK's implementation. How Has This Been Tested? 10 unit tests covering all edge cases for offline_access scope augmentation in get_client_metadata_scopes 2 end-to-end auth flow tests verifying the authorization request includes (or excludes) offline_access and prompt=consent based on AS metadata Breaking Changes None. This is additive behavior. Clients that previously did not request offline_access will now request it automatically when the AS advertises it in scopes_supported and the client supports the refresh_token grant. Authorization Servers that don't recognize offline_access will simply ignore it per OAuth 2.1. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context get_client_metadata_scopes() now accepts client_grant_types and appends offline_access to the selected scopes when the AS metadata advertises it in scopes_supported and the client includes refresh_token in its grant_types. The authorization request includes prompt=consent when offline_access is in the scope, per the OIDC Core spec. This matches the TypeScript SDK's behavior. The 403 insufficient_scope handler now also passes AS metadata and client grant types to get_client_metadata_scopes, fixing a pre-existing omission.

Open Graph Description: Implement OIDC-flavored refresh token guidance (SEP-2207) in the Python SDK client. Motivation and Context MCP clients interacting with OIDC-flavored Authorization Servers often don't receive r...

X Description: Implement OIDC-flavored refresh token guidance (SEP-2207) in the Python SDK client. Motivation and Context MCP clients interacting with OIDC-flavored Authorization Servers often don't recei...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a69f845b-00b1-8aa5-3b7a-c325be226860
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEA24:8CD90:2A5A61F:3C6A41D:6A5902C0
html-safe-nonce78e6812121e0fac7f7accecc97b426cf09e5b86f05e6f584fdee5af16f34874e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTI0OjhDRDkwOjJBNUE2MUY6M0M2QTQxRDo2QTU5MDJDMCIsInZpc2l0b3JfaWQiOiI2MDU0NTkyMDA4NTYzNTI0Mjg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac55247e96f26421ea2b1ffb33023e5be6d1d67498be45e08c3cad7d65ef9aa0be
hovercard-subject-tagpull_request:3273814234
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/2039/files
twitter:imagehttps://avatars.githubusercontent.com/u/132961?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/132961?s=400&v=4
og:image:altImplement OIDC-flavored refresh token guidance (SEP-2207) in the Python SDK client. Motivation and Context MCP clients interacting with OIDC-flavored Authorization Servers often don't receive r...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
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
release9842457e8d7e3b2e1635a63af28da35614845510
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2039%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F2039%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/2039/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 23.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 255 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 291 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 6 https://github.com/modelcontextprotocol/python-sdk/security
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
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 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
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
ArcadeAI:feat/sep-2207https://github.com/ArcadeAI/mcp-python-sdk/tree/feat/sep-2207
Conversation 5 https://github.com/modelcontextprotocol/python-sdk/pull/2039
Commits 5 https://github.com/modelcontextprotocol/python-sdk/pull/2039/commits
Checks 26 https://github.com/modelcontextprotocol/python-sdk/pull/2039/checks
Files changed 3 https://github.com/modelcontextprotocol/python-sdk/pull/2039/files
SEP-2207: Refresh token guidance https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#top
Show all changes 5 commits https://github.com/modelcontextprotocol/python-sdk/pull/2039/files
1367184 feat: implement refresh token guidance sep-2207 wdawson Feb 11, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2039/commits/136718460eaac9e719e65b5e14e764fe9da7d8aa
ba50af6 fix: lint wdawson Feb 11, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2039/commits/ba50af6122e23668b66d5f2159b25decdb720338
15e06ce Merge branch 'main' into feat/sep-2207 wdawson Mar 11, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2039/commits/15e06ce3705399adb6cc008853e7758cb7a07f19
e3e98e5 Merge branch 'main' into feat/sep-2207 wdawson Mar 13, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2039/commits/e3e98e53d0c6be0e0060f1cfc116915f165699ca
0d8a893 Merge branch 'main' into feat/sep-2207 wdawson Mar 30, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2039/commits/0d8a8934ebe0630519e6fe773b7414170a5f455a
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2039/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files
oauth2.py https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
utils.py https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
test_auth.py https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
src/mcp/client/auth/oauth2.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
View file https://github.com/ArcadeAI/mcp-python-sdk/blob/0d8a8934ebe0630519e6fe773b7414170a5f455a/src/mcp/client/auth/oauth2.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2039/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
src/mcp/client/auth/utils.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
View file https://github.com/ArcadeAI/mcp-python-sdk/blob/0d8a8934ebe0630519e6fe773b7414170a5f455a/src/mcp/client/auth/utils.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2039/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
https://github.com/modelcontextprotocol/python-sdk/pull/2039/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2039/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2039/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.