René's URL Explorer Experiment


Title: Union previously requested scopes on step-up re-authorization (SEP-2350) by Kludex · Pull Request #2931 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Union previously requested scopes on step-up re-authorization (SEP-2350) by Kludex · Pull Request #2931 · modelcontextprotocol/python-sdk

X Title: Union previously requested scopes on step-up re-authorization (SEP-2350) by Kludex · Pull Request #2931 · modelcontextprotocol/python-sdk

Description: Implements SEP-2350 (the fourth client-side item of #2902): union previously requested scopes on step-up re-authorization. What changed When a 403 insufficient_scope challenge triggers step-up re-authorization, the OAuth client previously replaced client_metadata.scope with only the newly challenged scopes, dropping the scopes granted for earlier operations. It now requests the union of the previously requested scopes and the challenged scopes. Per the spec: "Scope accumulation across operations is a client-side responsibility. Clients SHOULD compute the union of previously requested scopes and newly challenged scopes when initiating re-authorization." This lets servers stay stateless about client scope sets while clients keep their permissions. New union_scopes(previous, new) helper in utils.py — order-preserving, deduped. Unions at the 403 step-up call site in oauth2.py. Conformance Flips auth/scope-step-up green on the default leg: sep-2350-scope-union-on-reauth now reports SUCCESS (21/21). No baseline edits were needed: Default leg: scope-step-up was already removed from expected-failures.yml by #2927 (for the alpha.5 harness), so it was an unexpected failure on the pinned alpha.4 harness. It now passes, so the default leg is green again - this also resolves the pre-existing failure I flagged in #2930. 2026-07-28 leg: scope-step-up stays baselined there - it still fails for an unrelated reason ("client did not make an initial authorization request", the documented 2026 connection-lifecycle gap in client.py), not on the SEP-2350 check. Both legs pass with no stale or unexpected entries. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

Open Graph Description: Implements SEP-2350 (the fourth client-side item of #2902): union previously requested scopes on step-up re-authorization. What changed When a 403 insufficient_scope challenge triggers step-up re-a...

X Description: Implements SEP-2350 (the fourth client-side item of #2902): union previously requested scopes on step-up re-authorization. What changed When a 403 insufficient_scope challenge triggers step-up re-a...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1ed262a5-95f1-4557-4827-aa94fa799f02
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id97A6:196F0D:DF73A2:1417BEE:6A5A0B46
html-safe-nonce96232e84265de23542694190002e6768de6beb954f40ff8b640b3ea8fb293455
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0E2OjE5NkYwRDpERjczQTI6MTQxN0JFRTo2QTVBMEI0NiIsInZpc2l0b3JfaWQiOiIzNTY2OTAyNzg1NTcxNjg3MjM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacdc37aa7fe0684d41ab0496d77fb78dab2692ef6fff2db40b64cac652bf4dd7ca
hovercard-subject-tagpull_request:3904362737
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/2931/files
twitter:imagehttps://avatars.githubusercontent.com/u/7353520?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/7353520?s=400&v=4
og:image:altImplements SEP-2350 (the fourth client-side item of #2902): union previously requested scopes on step-up re-authorization. What changed When a 403 insufficient_scope challenge triggers step-up re-a...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None8c2fe7351e4e987cb8f75e2425a0b895d807779bc4c2d3c312be0a54082219f7
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
release491710c7a8eecca9d0a06bd157646f2685d8c87b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2931%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%2F2931%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/2931/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2931/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 303 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
Kludexhttps://github.com/Kludex
mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
sep-2350-scope-unionhttps://github.com/modelcontextprotocol/python-sdk/tree/sep-2350-scope-union
Conversation 3 https://github.com/modelcontextprotocol/python-sdk/pull/2931
Commits 2 https://github.com/modelcontextprotocol/python-sdk/pull/2931/commits
Checks 33 https://github.com/modelcontextprotocol/python-sdk/pull/2931/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/2931/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files
Union previously requested scopes on step-up re-authorization (SEP-2350) https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#top
Show all changes 2 commits https://github.com/modelcontextprotocol/python-sdk/pull/2931/files
87d50f9 Union previously requested scopes on step-up re-authorization (SEP-2350) Kludex Jun 20, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2931/commits/87d50f903945eeb7162778789e259c39abfcc95c
33bcb51 Fold stored token scope into step-up union (SEP-2350) Kludex Jun 20, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2931/commits/33bcb51df7895c1b976a740724228f8c8f5a39bb
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2931/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files
migration.md https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
oauth2.py https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
utils.py https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
test_auth.py https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
_requirements.py https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
test_lifecycle.py https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-d756478b61108e8553f87789d8a37a2cf6eac3760a38eeb6caf10d51256d8839
docs/migration.mdhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
View file https://github.com/modelcontextprotocol/python-sdk/blob/33bcb51df7895c1b976a740724228f8c8f5a39bb/docs/migration.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2931/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
src/mcp/client/auth/oauth2.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
View file https://github.com/modelcontextprotocol/python-sdk/blob/33bcb51df7895c1b976a740724228f8c8f5a39bb/src/mcp/client/auth/oauth2.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2931/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-b7aaf2062da175cea9a532176d6eb78b659eaadb757cc48929f0bafccfdb8d98
src/mcp/client/auth/utils.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
View file https://github.com/modelcontextprotocol/python-sdk/blob/33bcb51df7895c1b976a740724228f8c8f5a39bb/src/mcp/client/auth/utils.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2931/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
tests/client/test_auth.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
View file https://github.com/modelcontextprotocol/python-sdk/blob/33bcb51df7895c1b976a740724228f8c8f5a39bb/tests/client/test_auth.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2931/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/checks?check_run_id=82499073439
claudehttps://github.com/apps/claude
Jun 20, 2026https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#r3447022133
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
33bcb51https://github.com/modelcontextprotocol/python-sdk/commit/33bcb51df7895c1b976a740724228f8c8f5a39bb
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
tests/interaction/_requirements.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
View file https://github.com/modelcontextprotocol/python-sdk/blob/33bcb51df7895c1b976a740724228f8c8f5a39bb/tests/interaction/_requirements.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2931/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
tests/interaction/auth/test_lifecycle.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-d756478b61108e8553f87789d8a37a2cf6eac3760a38eeb6caf10d51256d8839
View file https://github.com/modelcontextprotocol/python-sdk/blob/33bcb51df7895c1b976a740724228f8c8f5a39bb/tests/interaction/auth/test_lifecycle.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2931/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-d756478b61108e8553f87789d8a37a2cf6eac3760a38eeb6caf10d51256d8839
https://github.com/modelcontextprotocol/python-sdk/pull/2931/files#diff-d756478b61108e8553f87789d8a37a2cf6eac3760a38eeb6caf10d51256d8839
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2931/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.