René's URL Explorer Experiment


Title: Send SEP-2243 Mcp-Method/Mcp-Name headers from the StreamableHTTP client by vidigoat · Pull Request #2730 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Send SEP-2243 Mcp-Method/Mcp-Name headers from the StreamableHTTP client by vidigoat · Pull Request #2730 · modelcontextprotocol/python-sdk

X Title: Send SEP-2243 Mcp-Method/Mcp-Name headers from the StreamableHTTP client by vidigoat · Pull Request #2730 · modelcontextprotocol/python-sdk

Description: Summary Fixes #2715. Per SEP-2243 (accepted — see the draft changelog), the Streamable HTTP transport requires Mcp-Method and Mcp-Name headers on POST requests so servers/intermediaries can route without parsing the JSON-RPC body. The Python client did not send them. Changes _set_mcp_request_headers() sets, for outgoing POST messages: Mcp-Method: the JSON-RPC method — for requests and notifications Mcp-Name: params.name (tools/prompts) or, when absent, params.uri (resources) responses/errors (no method) get neither header _encode_mcp_header_value() applies the SEP-2243 value-encoding rules to Mcp-Name: safe printable-ASCII values pass through; non-ASCII, control characters, or significant leading/trailing whitespace are wrapped as =?base64??= (matching the spec's examples). The encoding is not just spec-compliance — without it, a tool name/URI containing non-ASCII raises UnicodeEncodeError and breaks the request, and a value containing CR/LF is a header-injection vector. Verified both: café now sends as =?base64?Y2Fmw6k=?= and is accepted by httpx; "a\r\nEvil: 1" is base64-wrapped. The broader x-mcp-header custom-header part of SEP-2243 is intentionally out of scope here (separate feature); this PR covers the Mcp-Method/Mcp-Name requirement from #2715. Tests test_set_mcp_request_headers — request with name, with uri, no params, non-string name, notification, response, error, and a non-ASCII name (end-to-end encoding). test_encode_mcp_header_value — passthrough + each base64 trigger (non-ASCII, whitespace, control char, sentinel collision), using SEP-2243's own example values. Full tests/shared/test_streamable_http.py passes (76 tests); ruff and pyright clean. uv run --frozen pytest tests/shared/test_streamable_http.py Authored with the assistance of an AI coding assistant; reviewed and verified by me.

Open Graph Description: Summary Fixes #2715. Per SEP-2243 (accepted — see the draft changelog), the Streamable HTTP transport requires Mcp-Method and Mcp-Name headers on POST requests so servers/intermediaries can route w...

X Description: Summary Fixes #2715. Per SEP-2243 (accepted — see the draft changelog), the Streamable HTTP transport requires Mcp-Method and Mcp-Name headers on POST requests so servers/intermediaries can route w...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:deda1f9c-df61-628e-6484-fc534b1c4879
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE6D0:2053C6:C6DA5E:11D48EE:6A5A0222
html-safe-nonce8a881ff34acdbd8f8aa26752826f2fed06d99c834de2c76c83d5d0e6c91acacb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkQwOjIwNTNDNjpDNkRBNUU6MTFENDhFRTo2QTVBMDIyMiIsInZpc2l0b3JfaWQiOiI0NDQyMTUzODY3MzkxODAwNjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6e8bf6e1be3acef543a76ea47cb36870edd817bcbb9ee533e378adc69390e672
hovercard-subject-tagpull_request:3773854519
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/2730/files
twitter:imagehttps://avatars.githubusercontent.com/u/219086731?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/219086731?s=400&v=4
og:image:altSummary Fixes #2715. Per SEP-2243 (accepted — see the draft changelog), the Streamable HTTP transport requires Mcp-Method and Mcp-Name headers on POST requests so servers/intermediaries can route w...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4d3f961cfc83a4348ee5be7691cf4ae3515aab3ef5200c13a7e41b048125fb61
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
releaseac4d28603af300ac851b62521abb878ab5d3319a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2730%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%2F2730%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/2730/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2730/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
vidigoathttps://github.com/vidigoat
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
vidigoat:fix/sep-2243-mcp-post-headershttps://github.com/vidigoat/python-sdk/tree/fix/sep-2243-mcp-post-headers
Conversation 2 https://github.com/modelcontextprotocol/python-sdk/pull/2730
Commits 1 https://github.com/modelcontextprotocol/python-sdk/pull/2730/commits
Checks 29 https://github.com/modelcontextprotocol/python-sdk/pull/2730/checks
Files changed 2 https://github.com/modelcontextprotocol/python-sdk/pull/2730/files
Send SEP-2243 Mcp-Method/Mcp-Name headers from the StreamableHTTP client https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#top
Show all changes 1 commit https://github.com/modelcontextprotocol/python-sdk/pull/2730/files
b72f110 Send SEP-2243 Mcp-Method/Mcp-Name headers from the StreamableHTTP client vidigoat May 30, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2730/commits/b72f1103b63eca6004a88836d2c05566185cea96
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2730/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files
streamable_http.py https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
test_streamable_http.py https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-57d1f3c64af36960aa61b1d77387fb6201b90fbc2f3d606bf2761315ce618cc5
src/mcp/client/streamable_http.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
View file https://github.com/vidigoat/python-sdk/blob/b72f1103b63eca6004a88836d2c05566185cea96/src/mcp/client/streamable_http.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2730/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
tests/shared/test_streamable_http.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-57d1f3c64af36960aa61b1d77387fb6201b90fbc2f3d606bf2761315ce618cc5
View file https://github.com/vidigoat/python-sdk/blob/b72f1103b63eca6004a88836d2c05566185cea96/tests/shared/test_streamable_http.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2730/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-57d1f3c64af36960aa61b1d77387fb6201b90fbc2f3d606bf2761315ce618cc5
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-57d1f3c64af36960aa61b1d77387fb6201b90fbc2f3d606bf2761315ce618cc5
https://github.com/modelcontextprotocol/python-sdk/pull/2730/files#diff-57d1f3c64af36960aa61b1d77387fb6201b90fbc2f3d606bf2761315ce618cc5
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2730/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.