René's URL Explorer Experiment


Title: Streamable HTTP server never returns the spec-mandated 405 for GET requests it won't serve as SSE (406/400 instead) — breaks client SSE-probe fallback · Issue #3102 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Streamable HTTP server never returns the spec-mandated 405 for GET requests it won't serve as SSE (406/400 instead) — breaks client SSE-probe fallback · Issue #3102 · modelcontextprotocol/python-sdk

X Title: Streamable HTTP server never returns the spec-mandated 405 for GET requests it won't serve as SSE (406/400 instead) — breaks client SSE-probe fallback · Issue #3102 · modelcontextprotocol/python-sdk

Description: Summary The streamable-HTTP server transport never answers a GET it won't serve with 405 Method Not Allowed, even though the spec makes 405 the required signal: The server MUST either return Content-Type: text/event-stream in response to...

Open Graph Description: Summary The streamable-HTTP server transport never answers a GET it won't serve with 405 Method Not Allowed, even though the spec makes 405 the required signal: The server MUST either return Conten...

X Description: Summary The streamable-HTTP server transport never answers a GET it won't serve with 405 Method Not Allowed, even though the spec makes 405 the required signal: The server MUST either return Co...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3102

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Streamable HTTP server never returns the spec-mandated 405 for GET requests it won't serve as SSE (406/400 instead) — breaks client SSE-probe fallback","articleBody":"## Summary\n\nThe streamable-HTTP **server** transport never answers a GET it won't serve with **405 Method Not Allowed**, even though the spec makes 405 the required signal:\n\n> *The server MUST either return `Content-Type: text/event-stream` in response to this HTTP GET, or else return HTTP 405 Method Not Allowed, indicating that the server does not offer an SSE stream at this endpoint.*\n> — [Streamable HTTP § Listening for Messages from the Server](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#listening-for-messages-from-the-server)\n\nInstead, a GET that can't be served yields:\n\n| Pre-session `GET /mcp` with… | Server response |\n|---|---|\n| `Accept: */*`, `Accept: application/json`, or no Accept | **406 Not Acceptable** (`_handle_get_request` → `_check_accept_headers`, which does literal prefix matching so `*/*` is not honored) |\n| `Accept: text/event-stream` (stateful server, no `mcp-session-id`) | **400 Bad Request: Missing session ID** (`_validate_session`) |\n\nSo in stateful mode there is **no request shape** for which a pre-session GET returns 405. (405 *is* used elsewhere: DELETE without a session and unsupported methods.)\n\n## Why it matters — real interop break\n\nSeveral client transports probe with exactly this GET **before** `initialize` to ask \"do you offer a standalone SSE stream?\", and treat **only 405** as the graceful \"no SSE — fall through to POST\" signal (e.g. the TypeScript SDK's `_startOrAuthSse` explicitly special-cases 405). Any other status is a transport error, so against a stock python-SDK server the connection aborts before `initialize` is ever sent.\n\nWe hit this in production between two independently-built agents: the client authenticated successfully, then its GET probe got 406 (its relay sent `Accept: */*`), the transport threw, and the handshake never reached `initialize` — surfacing as \"server doesn't respond to MCP protocol\" while the server looked perfectly healthy to every python-SDK client (which only GETs *after* initialize, with a session id). We've deployed a workaround (a small ASGI shim returning 405 + `Allow: POST` for session-less GETs on the MCP path), but every stock python-SDK deployment presumably reproduces this.\n\n## Repro (mcp 1.28.1, stateful StreamableHTTP server)\n\n```bash\ncurl -i -X GET http://localhost:8000/mcp -H 'Accept: */*'                 # → 406, expected 405\ncurl -i -X GET http://localhost:8000/mcp -H 'Accept: text/event-stream'  # → 400, expected 405 (no session yet)\n```\n\n## Suggested behavior\n\nFor a GET the server cannot serve as an SSE stream, respond **405 with an `Allow` header** per the spec quote above — at minimum for the pre-session case (no `mcp-session-id`), where returning 400 makes the spec'd client probe impossible to satisfy. Separately (or as part of this), `_check_accept_headers` honoring `*/*` / `text/*` per RFC 9110 §12.5.1 would remove the 406 arm for wildcard clients.\n\n## Related\n\n- #2349 covers the POST-side strict dual-Accept requirement; this issue is about the GET/405 contract, which is distinct.\n- #1641 raised wildcard-Accept non-compliance and is closed, but on 1.28.1 `_check_accept_headers` still does literal prefix matching, and the GET path 406s wildcard clients.\n\nHappy to provide full header traces or a PR if the maintainers agree on the intended shape.","author":{"url":"https://github.com/fgranata","@type":"Person","name":"fgranata"},"datePublished":"2026-07-16T11:26:42Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3102"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c6123748-5ea2-7cc6-76ae-9a267a9153ad
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D52:2ADD62:86B78A:B46268:6B00B388
html-safe-nonce516cda1305b952961cc50da4690c30056d8f78bd6d84cb5e06a45b8889ea91e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDUyOjJBREQ2Mjo4NkI3OEE6QjQ2MjY4OjZCMDBCMzg4IiwidmlzaXRvcl9pZCI6IjExOTAzODI0OTQ2MjU2MDg1ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac267c19598052f761855f7d1fee0700da831543fb055b6cc2e2cd2da73ee4727f
hovercard-subject-tagissue:4901517161
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3102/issue_layout
twitter:imagehttps://opengraph.githubassets.com/552a3ce3a9c6f108895f32d79d33498eb1eee507bae784f8f2cb44613b50ef3a/modelcontextprotocol/python-sdk/issues/3102
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/552a3ce3a9c6f108895f32d79d33498eb1eee507bae784f8f2cb44613b50ef3a/modelcontextprotocol/python-sdk/issues/3102
og:image:altSummary The streamable-HTTP server transport never answers a GET it won't serve with 405 Method Not Allowed, even though the spec makes 405 the required signal: The server MUST either return Conten...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefgranata
hostnamegithub.com
expected-hostnamegithub.com
None1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5429cbfc6aca8c7b9a086a3c8f47400346f38cc9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3102#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3102
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%2Fissues%2F3102
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3102
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3102
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3102
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues308 (308)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
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3102
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3102
Streamable HTTP server never returns the spec-mandated 405 for GET requests it won't serve as SSE (406/400 instead) — breaks client SSE-probe fallbackhttps://github.com/modelcontextprotocol/python-sdk/issues/3102#top
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
needs confirmationNeeds confirmation that the PR is actually required or needed.https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
v1Affects the v1.x maintenance linehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
v2Affects the v2 line (2.x on main)https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
https://github.com/fgranata
fgranatahttps://github.com/fgranata
on Jul 16, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issue-4901517161
Streamable HTTP § Listening for Messages from the Serverhttps://modelcontextprotocol.io/specification/2025-06-18/basic/transports#listening-for-messages-from-the-server
Streamable HTTP transport rejects Accept: text/event-stream without application/json #2349https://github.com/modelcontextprotocol/python-sdk/issues/2349
MCP Server won't work with wildcard in "Accept" header and therefore is non‑compliant with HTTP spec #1641https://github.com/modelcontextprotocol/python-sdk/issues/1641
https://github.com/dosvk
dosvkhttps://github.com/dosvk
on Jul 18, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issuecomment-5009342670
#439https://github.com/modelcontextprotocol/python-sdk/pull/439
#440https://github.com/modelcontextprotocol/python-sdk/pull/440
@fgranatahttps://github.com/fgranata
MCP Server won't work with wildcard in "Accept" header and therefore is non‑compliant with HTTP spec #1641https://github.com/modelcontextprotocol/python-sdk/issues/1641
https://github.com/fgranata
fgranatahttps://github.com/fgranata
on Jul 20, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issuecomment-5020010048
@dosvkhttps://github.com/dosvk
https://github.com/dosvk
dosvkhttps://github.com/dosvk
on Jul 20, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issuecomment-5027725132
@fgranatahttps://github.com/fgranata
#3129https://github.com/modelcontextprotocol/python-sdk/pull/3129
dosvkhttps://github.com/dosvk
on Aug 6, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#event-29086793896
fix: return 405 for pre-session GET the server won't serve as SSEhttps://github.com/dosvk/python-sdk/commit/ed897fa072708d99675372115744fc9d57af71a7
https://docs.github.com/articles/closing-issues-via-commit-messages
ed897fahttps://github.com/dosvk/python-sdk/commit/ed897fa072708d99675372115744fc9d57af71a7
https://github.com/dosvk
dosvkhttps://github.com/dosvk
on Aug 6, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issuecomment-5209040600
@fgranatahttps://github.com/fgranata
#3129https://github.com/modelcontextprotocol/python-sdk/pull/3129
https://github.com/fgranata
fgranatahttps://github.com/fgranata
on Aug 7, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issuecomment-5215622213
#3129https://github.com/modelcontextprotocol/python-sdk/pull/3129
#3129 (comment)https://github.com/modelcontextprotocol/python-sdk/pull/3129#issuecomment-5215479733
#3129https://github.com/modelcontextprotocol/python-sdk/pull/3129
maxisbeyhttps://github.com/maxisbey
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
needs confirmationNeeds confirmation that the PR is actually required or needed.https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
v1Affects the v1.x maintenance linehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
v2Affects the v2 line (2.x on main)https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
on Aug 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#event-29453905652
https://github.com/Kludex
Kludexhttps://github.com/Kludex
on Oct 16, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#issuecomment-6214363449
#2474https://github.com/modelcontextprotocol/python-sdk/issues/2474
Kludexhttps://github.com/Kludex
not plannedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 16, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3102#event-33439256405
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3102
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3102
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
needs confirmationNeeds confirmation that the PR is actually required or needed.https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
v1Affects the v1.x maintenance linehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
v2Affects the v2 line (2.x on main)https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
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.