René's URL Explorer Experiment


Title: Preserve empty issuer/resource paths on AuthSettings by Kludex · Pull Request #2987 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Preserve empty issuer/resource paths on AuthSettings by Kludex · Pull Request #2987 · modelcontextprotocol/python-sdk

X Title: Preserve empty issuer/resource paths on AuthSettings by Kludex · Pull Request #2987 · modelcontextprotocol/python-sdk

Description: Summary AuthSettings.issuer_url and resource_server_url are typed AnyHttpUrl, which normalizes a path-less URL with a trailing slash before the model's config can apply. As a result the authorization server advertised issuer as https://as.example.com/ instead of https://as.example.com in its metadata — inconsistent with the exact string comparison RFC 8414 / RFC 9207 require for issuer matching. This applies url_preserve_empty_path=True to AuthSettings, the same fix #2925 made for the metadata models (OAuthMetadata, ProtectedResourceMetadata, OAuthClientMetadata). A string issuer_url/resource_server_url now keeps its canonical form end to end (config → build_metadata → served metadata). Why Surfaced while testing a real OAuth flow end to end: a client that discovers the issuer over the wire and uses it for issuer comparison (or as a token audience) saw .../ while the deployer's own constant had no slash, breaking the exact-match comparison the RFCs mandate. Behavior change Passing a string issuer/resource keeps the empty path (no trailing slash). Passing an already-built AnyHttpUrl object still normalizes at construction (unchanged) — pass a string to get the preserved form. Documented in docs/migration.md alongside the existing trailing-slash entry. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

Open Graph Description: Summary AuthSettings.issuer_url and resource_server_url are typed AnyHttpUrl, which normalizes a path-less URL with a trailing slash before the model's config can apply. As a result the authori...

X Description: Summary AuthSettings.issuer_url and resource_server_url are typed AnyHttpUrl, which normalizes a path-less URL with a trailing slash before the model's config can apply. As a result the aut...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:65ba3b2a-7fcb-0337-a5ac-248f47735ca5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB5EC:175F4A:1AADC78:260411D:6A5A3B02
html-safe-nonce644f01f15b8ec35d925a17eb93dd904f30e8e8c6f3781380466338a656ff88d7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUVDOjE3NUY0QToxQUFEQzc4OjI2MDQxMUQ6NkE1QTNCMDIiLCJ2aXNpdG9yX2lkIjoiMjE1OTEyMDUyODY2NTM2MTE1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac32cb865cc41dc6779b229ae2f551eaec7a0f61105eff7f90fdb645769c9fcc42
hovercard-subject-tagpull_request:3941282911
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/2987/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:altSummary AuthSettings.issuer_url and resource_server_url are typed AnyHttpUrl, which normalizes a path-less URL with a trailing slash before the model's config can apply. As a result the authori...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None19c67ad7579d2401ff06e88a32ef45460fbb40fab3191c7f7582d5e166f326fc
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
releasee618485bff22dab2ef1ffb4e34e4e6626688df69
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2987%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%2F2987%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/2987/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2987/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
auth-settings-preserve-empty-pathhttps://github.com/modelcontextprotocol/python-sdk/tree/auth-settings-preserve-empty-path
Conversation 2 https://github.com/modelcontextprotocol/python-sdk/pull/2987
Commits 1 https://github.com/modelcontextprotocol/python-sdk/pull/2987/commits
Checks 35 https://github.com/modelcontextprotocol/python-sdk/pull/2987/checks
Files changed 3 https://github.com/modelcontextprotocol/python-sdk/pull/2987/files
Preserve empty issuer/resource paths on AuthSettings https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#top
Show all changes 1 commit https://github.com/modelcontextprotocol/python-sdk/pull/2987/files
92fae82 Preserve empty issuer/resource paths on AuthSettings Kludex Jun 26, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2987/commits/92fae82469b6fce2f7c669c69a186256a9df8d70
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2987/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files
migration.md https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
settings.py https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-ed6123a6a50ac222dad0c2887aa3186d37bbc67f7a2105d4a06320638a75fd25
test_routes.py https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
docs/migration.mdhttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
View file https://github.com/modelcontextprotocol/python-sdk/blob/92fae82469b6fce2f7c669c69a186256a9df8d70/docs/migration.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2987/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
src/mcp/server/auth/settings.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-ed6123a6a50ac222dad0c2887aa3186d37bbc67f7a2105d4a06320638a75fd25
View file https://github.com/modelcontextprotocol/python-sdk/blob/92fae82469b6fce2f7c669c69a186256a9df8d70/src/mcp/server/auth/settings.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2987/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-ed6123a6a50ac222dad0c2887aa3186d37bbc67f7a2105d4a06320638a75fd25
https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-ed6123a6a50ac222dad0c2887aa3186d37bbc67f7a2105d4a06320638a75fd25
tests/server/auth/test_routes.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
View file https://github.com/modelcontextprotocol/python-sdk/blob/92fae82469b6fce2f7c669c69a186256a9df8d70/tests/server/auth/test_routes.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2987/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
https://github.com/modelcontextprotocol/python-sdk/pull/2987/checks?check_run_id=83629892255
claudehttps://github.com/apps/claude
Jun 26, 2026https://github.com/modelcontextprotocol/python-sdk/pull/2987/files#r3480502209
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#2925https://github.com/modelcontextprotocol/python-sdk/pull/2925
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2987/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2987/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.