René's URL Explorer Experiment


Title: fix(server): normalize experimental capability to {} in get_capabilities by Hamjaster · Pull Request #3255 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: fix(server): normalize experimental capability to {} in get_capabilities by Hamjaster · Pull Request #3255 · modelcontextprotocol/python-sdk

X Title: fix(server): normalize experimental capability to {} in get_capabilities by Hamjaster · Pull Request #3255 · modelcontextprotocol/python-sdk

Description: Fixes #3254 What's broken An unconfigured Server reports its experimental capability differently depending on which discovery path answers: initialize (via create_initialization_options()): experimental == {}, field present on the wire. server/discover (calls get_capabilities() directly): experimental is None, field omitted from the wire dump. That's client-visible: .get(...) works on the legacy value and raises on the modern one, and is not None checks flip meaning depending on which path answered. Same server, same lack of configuration, two different answers. Why create_initialization_options() was the only caller that normalized a missing experimental_capabilities argument to {} before handing it to get_capabilities(). get_capabilities() itself just used its own parameter default (None) whenever a caller didn't do that normalization first — and server/discover's internal handler calls get_capabilities(protocol_version=ctx.protocol_version) with nothing for experimental_capabilities, so it fell straight through to None. The fix One line: move the normalization into get_capabilities() itself, right next to the existing notification_options = notification_options or NotificationOptions() fallback that already does the same job for a sibling parameter. Now every caller gets {} unless it explicitly passes something else, regardless of which path calls it. How I checked it Ran the exact repro from the issue against both trees: # main legacy {} True modern None False # this branch legacy {} True modern {} True Added a test in tests/server/lowlevel/test_server_discover.py (the file that already exercises get_capabilities() via the discover path) asserting both create_initialization_options() and server/discover report experimental == {} for the same unconfigured server. It fails on main with assert None == {} and passes with this change. ruff format/ruff check/pyright are all clean. Ran the full tests/server/ suite (1213 tests) and it passes. I didn't run the complete coverage/strict-no-cover gate across the whole repo, but confirmed the new line is exercised (not in coverage report's missing-lines list) when running the affected test files. Type 🐛 Bug Fix Disclosure An AI coding agent helped me write this. I read the SDK's fallback pattern in get_capabilities(), picked the one-line fix that matches it, reproduced the issue's exact repro on both trees myself, and can walk through any part of this change.

Open Graph Description: Fixes #3254 What's broken An unconfigured Server reports its experimental capability differently depending on which discovery path answers: initialize (via create_initialization_options()): ex...

X Description: Fixes #3254 What's broken An unconfigured Server reports its experimental capability differently depending on which discovery path answers: initialize (via create_initialization_options())...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ff81624c-e3ff-138f-0c8f-e6efb2262f1c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9B84:E9D16:A26DB1:CDAE24:6B0129AF
html-safe-nonce54a0dc6400664433b83ca2d04a8764c7d5f117e60d1130b9fd3006bce5709e2a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qjg0OkU5RDE2OkEyNkRCMTpDREFFMjQ6NkIwMTI5QUYiLCJ2aXNpdG9yX2lkIjoiOTI2Njc0Mzc1OTg0MzU5ODU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca8756ff2111c51a2b6828f853461ed843669fe7c950f042d9e2fd20f145e1cd7
hovercard-subject-tagpull_request:4210323043
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/3255/files
twitter:imagehttps://avatars.githubusercontent.com/u/87142882?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/87142882?s=400&v=4
og:image:altFixes #3254 What's broken An unconfigured Server reports its experimental capability differently depending on which discovery path answers: initialize (via create_initialization_options()): ex...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F3255%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F3255%2Ffiles
Sign uphttps://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/3255/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues313 (313)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
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
Hamjasterhttps://github.com/Hamjaster
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
Hamjaster:fix-experimental-capability-none-vs-empty-dicthttps://github.com/Hamjaster/python-sdk/tree/fix-experimental-capability-none-vs-empty-dict
Conversation 1 https://github.com/modelcontextprotocol/python-sdk/pull/3255
Commits 1 https://github.com/modelcontextprotocol/python-sdk/pull/3255/commits
Checks 30 https://github.com/modelcontextprotocol/python-sdk/pull/3255/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/3255/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files
fix(server): normalize experimental capability to {} in get_capabilities https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#top
Show all changes 1 commit https://github.com/modelcontextprotocol/python-sdk/pull/3255/files
fc45dba fix(server): normalize experimental capability to {} in get_capabilities Hamjaster Aug 5, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/3255/commits/fc45dbad4ee831255dc7af97131aab98f3fbde18
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/3255/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files
server.py https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
test_server_discover.py https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-cdb3e450722a7944ee7a5075aea13da268ef672be1571d60c3c8af0829f21f36
src/mcp/server/lowlevel/server.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
View file https://github.com/Hamjaster/python-sdk/blob/fc45dbad4ee831255dc7af97131aab98f3fbde18/src/mcp/server/lowlevel/server.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3255/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
tests/server/lowlevel/test_server_discover.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-cdb3e450722a7944ee7a5075aea13da268ef672be1571d60c3c8af0829f21f36
View file https://github.com/Hamjaster/python-sdk/blob/fc45dbad4ee831255dc7af97131aab98f3fbde18/tests/server/lowlevel/test_server_discover.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3255/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-cdb3e450722a7944ee7a5075aea13da268ef672be1571d60c3c8af0829f21f36
https://github.com/modelcontextprotocol/python-sdk/pull/3255/files#diff-cdb3e450722a7944ee7a5075aea13da268ef672be1571d60c3c8af0829f21f36
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3255/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.