René's URL Explorer Experiment


Title: feat(auth): specify OIDC application_type during dynamic client registration (SEP-837) by stefanoamorelli · Pull Request #2784 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: feat(auth): specify OIDC application_type during dynamic client registration (SEP-837) by stefanoamorelli · Pull Request #2784 · modelcontextprotocol/python-sdk

X Title: feat(auth): specify OIDC application_type during dynamic client registration (SEP-837) by stefanoamorelli · Pull Request #2784 · modelcontextprotocol/python-sdk

Description: Adds an application_type field to OAuthClientMetadata and sends it during OAuth Dynamic Client Registration, inferring the value from the client's redirect URIs when the caller does not set one. Closes #2783. Motivation and Context SEP-837 requires MCP clients to send an application_type during OIDC Dynamic Client Registration. Omitting it defaults the client to "web", which conflicts with the loopback redirect URIs (localhost, 127.0.0.1, ::1) that native clients (CLI and desktop apps) use, so the server can reject the registration. Currently OAuthClientMetadata has no such field and create_client_registration_request never sends one, so the client hits that default. This PR adds the field and infers a value from the redirect URIs at registration time: loopback and private-use schemes register as "native", a remote https host as "web", and a mix is left unset for the authorization server to decide. An explicit value is always sent as-is, and non-OIDC servers ignore the parameter. This follows the spec's guidance 1 and mirrors the approach already merged in the Go SDK (modelcontextprotocol/go-sdk#904) and Rust SDK (modelcontextprotocol/rust-sdk#883). How Has This Been Tested? The full suite passes locally with 100% coverage (./scripts/test); ruff, ruff format, and pyright are clean. New unit tests cover the application_type model field, the redirect-URI inference (loopback, IPv4/IPv6 loopback, private-use scheme, remote host, and ambiguous mixes), and that create_client_registration_request sends the inferred type, preserves an explicit one, and omits an ambiguous one. The auth interaction suite's registration snapshot was updated to include application_type: "native" for its loopback redirect. The conformance suite already covers SEP-837 (src/seps/sep-837.yaml), so conformance.yml exercises this against the SDK. Breaking Changes None. application_type is optional and defaults to None; existing callers are unaffected, and registration requests only gain a parameter that OIDC servers expect and non-OIDC servers ignore. Types of changes New feature (non-breaking change which adds functionality) 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 The registration failure SEP-837 describes is already surfaced by handle_registration_response as an OAuthRegistrationError, so no new error handling was needed; this PR only ensures the client declares the correct type up front.

Open Graph Description: Adds an application_type field to OAuthClientMetadata and sends it during OAuth Dynamic Client Registration, inferring the value from the client's redirect URIs when the caller does not set one...

X Description: Adds an application_type field to OAuthClientMetadata and sends it during OAuth Dynamic Client Registration, inferring the value from the client's redirect URIs when the caller does not set...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ab8afe65-a19b-b23b-3e5c-3061a1493546
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD83E:3A479:1BBE641:2526960:6A59858F
html-safe-nonce60d7c0822bfc1233933df80b670c6a6bd67b64b97b9fca662dd858af25cb07d3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODNFOjNBNDc5OjFCQkU2NDE6MjUyNjk2MDo2QTU5ODU4RiIsInZpc2l0b3JfaWQiOiIyOTYxNjE1ODA1MDg4NzQxMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac679e98f5f78056f0f7096418d329342d39037424d806b595d72a972ecadcb55f
hovercard-subject-tagpull_request:3809735719
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/2784/files
twitter:imagehttps://avatars.githubusercontent.com/u/10986064?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10986064?s=400&v=4
og:image:altAdds an application_type field to OAuthClientMetadata and sends it during OAuth Dynamic Client Registration, inferring the value from the client's redirect URIs when the caller does not set one...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5
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
release624bb50a7497aa346bef8cc3743af408a9ea10ca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2784%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%2F2784%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/2784/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2784/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 301 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
stefanoamorellihttps://github.com/stefanoamorelli
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
stefanoamorelli:sep-837-oidc-dcr-application-typehttps://github.com/stefanoamorelli/mcp-python-sdk/tree/sep-837-oidc-dcr-application-type
Conversation 2 https://github.com/modelcontextprotocol/python-sdk/pull/2784
Commits 1 https://github.com/modelcontextprotocol/python-sdk/pull/2784/commits
Checks 27 https://github.com/modelcontextprotocol/python-sdk/pull/2784/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/2784/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files
feat(auth): specify OIDC application_type during dynamic client registration (SEP-837) https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#top
Show all changes 1 commit https://github.com/modelcontextprotocol/python-sdk/pull/2784/files
ecad2fb feat(auth): send OIDC application_type during registration (SEP-837) stefanoamorelli Jun 5, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2784/commits/ecad2fbbdd5a2150fa7a5e6d0bbc9d2307268592
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2784/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files
utils.py https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
auth.py https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-01350058961f3196e3373d707e2178962377dc9a85f481ade94e8f05e4701c8d
test_auth.py https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
test_flow.py https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-2a572c9bff06790dc0655966553e6d8cc41877f4dacaf5f561bb04bf0f91ad61
test_auth.py https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-5ddab42b5e747af834ca9c9c4523711195c3cba445840bf6d89302b346bf7097
src/mcp/client/auth/utils.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
View file https://github.com/stefanoamorelli/mcp-python-sdk/blob/ecad2fbbdd5a2150fa7a5e6d0bbc9d2307268592/src/mcp/client/auth/utils.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2784/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-1aed3def34492fb7eafa6e7aee6e9cc9973171b28c9574dc5c5b288a09878996
src/mcp/shared/auth.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-01350058961f3196e3373d707e2178962377dc9a85f481ade94e8f05e4701c8d
View file https://github.com/stefanoamorelli/mcp-python-sdk/blob/ecad2fbbdd5a2150fa7a5e6d0bbc9d2307268592/src/mcp/shared/auth.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2784/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-01350058961f3196e3373d707e2178962377dc9a85f481ade94e8f05e4701c8d
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-01350058961f3196e3373d707e2178962377dc9a85f481ade94e8f05e4701c8d
tests/client/test_auth.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
View file https://github.com/stefanoamorelli/mcp-python-sdk/blob/ecad2fbbdd5a2150fa7a5e6d0bbc9d2307268592/tests/client/test_auth.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2784/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-f083d075f463e8b1ecfa6b931c33288c3d09b00ee3af3e5f74df16b7e75c3ab1
tests/interaction/auth/test_flow.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-2a572c9bff06790dc0655966553e6d8cc41877f4dacaf5f561bb04bf0f91ad61
View file https://github.com/stefanoamorelli/mcp-python-sdk/blob/ecad2fbbdd5a2150fa7a5e6d0bbc9d2307268592/tests/interaction/auth/test_flow.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2784/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-2a572c9bff06790dc0655966553e6d8cc41877f4dacaf5f561bb04bf0f91ad61
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-2a572c9bff06790dc0655966553e6d8cc41877f4dacaf5f561bb04bf0f91ad61
tests/shared/test_auth.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-5ddab42b5e747af834ca9c9c4523711195c3cba445840bf6d89302b346bf7097
View file https://github.com/stefanoamorelli/mcp-python-sdk/blob/ecad2fbbdd5a2150fa7a5e6d0bbc9d2307268592/tests/shared/test_auth.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2784/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2784/files#diff-5ddab42b5e747af834ca9c9c4523711195c3cba445840bf6d89302b346bf7097
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2784/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.