René's URL Explorer Experiment


Title: streamable HTTP: integer and string request ids with the same text share one response stream; a string id can displace the GET stream · Issue #3786 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: streamable HTTP: integer and string request ids with the same text share one response stream; a string id can displace the GET stream · Issue #3786 · modelcontextprotocol/python-sdk

X Title: streamable HTTP: integer and string request ids with the same text share one response stream; a string id can displace the GET stream · Issue #3786 · modelcontextprotocol/python-sdk

Description: Summary StreamableHTTPServerTransport keys its per-request response streams by str(request_id). JSON-RPC and MCP allow a request id to be an integer or a string, and an integer 77 and a string "77" are different ids. After str() they map...

Open Graph Description: Summary StreamableHTTPServerTransport keys its per-request response streams by str(request_id). JSON-RPC and MCP allow a request id to be an integer or a string, and an integer 77 and a string "77"...

X Description: Summary StreamableHTTPServerTransport keys its per-request response streams by str(request_id). JSON-RPC and MCP allow a request id to be an integer or a string, and an integer 77 and a string &quo...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"streamable HTTP: integer and string request ids with the same text share one response stream; a string id can displace the GET stream","articleBody":"### Summary\n\n`StreamableHTTPServerTransport` keys its per-request response streams by `str(request_id)`. JSON-RPC and MCP allow a request id to be an integer **or** a string, and an integer `77` and a string `\"77\"` are different ids. After `str()` they map to the same key, so two valid, distinct in-flight requests on one session share one response stream.\n\nThe same string namespace holds the standalone GET stream's sentinel key, `GET_STREAM_KEY = \"_GET_stream\"`. A request whose id is the string `\"_GET_stream\"` replaces the GET stream's registration.\n\nThis is distinct from #3060 / #2655 / #3137, which cover a client **reusing the same id**. Here the ids are different under the spec and still collide.\n\n### Where\n\n`src/mcp/server/streamable_http.py` on v1.30.0 and v2.3.0 (latest at time of writing):\n- v2.3.0: `request_id = str(message.id)` (~:642), `target_request_id = str(message.id)` (~:1066), `target_request_id = str(related_request_id)` (~:1083), and `GET_STREAM_KEY = \"_GET_stream\"` (:62);\n- v1.30.0: the same sites at ~:599, ~:1063 and ~:1076, and :63.\n\n### Reproduction\n\nUse the stateful streamable HTTP server, unmodified SDK, a real TCP client, and one protocol session.\n\n1. Send two concurrent requests with ids `77` (integer) and `\"77\"` (string), each to a slow tool.\n2. Cancel only the integer `77` (`notifications/cancelled` with `requestId: 77`).\n3. **Observed:** the HTTP stream of the **string** `\"77\"` request receives integer `77`'s cancellation response. The string request's own handler was not cancelled, but its response is lost or misdelivered.\n4. **Sentinel variant:** with a GET stream open, send a request with id `\"_GET_stream\"`. Its POST registration replaces the GET stream's. The next server notification is lost, and a second GET is accepted (200) instead of being refused (409).\n\n**Matrix (JSON and SSE response modes × normal completion and cancellation × 7 id patterns):**\n- All 12 collision cells misroute: integer/string in both orders, plus the zero case `0` and `\"0\"`.\n- All 16 controls deliver correctly: integer-only, string-only, distinct mixed ids, and strings that cannot collide.\n\n### Expected\n\nResponses route to the request with the exact same typed id. A string id never displaces the GET stream.\n\n### Proposed fix\n\nDerive the internal stream key with one stateless, injective request-id-to-key helper, used at all three conversion sites, and keep a separate namespace for the GET sentinel. Wire ids stay unchanged.\n\nPublic `close_sse_stream(request_id)` should keep accepting the raw request id. A private helper should close by derived key. Replacing `str()` with `json.dumps()` alone looks like a fix, but it breaks raw-id `close_sse_stream` for string ids.\n\n","author":{"url":"https://github.com/WingedGuardian","@type":"Person","name":"WingedGuardian"},"datePublished":"2026-10-29T19:43:17Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3786"}

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:820ff421-4b65-c344-dd68-3902540051ce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB13C:C2718:CBCE:1096A:6B00B72C
html-safe-nonce9c966fe1f55553c0198ef75e94fa5e18bb43e7cc365b6fb08f7917f333d4542d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTNDOkMyNzE4OkNCQ0U6MTA5NkE6NkIwMEI3MkMiLCJ2aXNpdG9yX2lkIjoiNTUzMDYxOTE3MTEyNzIxMTgyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac24b0e07a0b6dfd9ad05fcc2b34ed3686c2014d3dcf472acb1e446bdfe90a9bc8
hovercard-subject-tagissue:6107244472
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/3786/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e73ad5e8c65d96d7bf24ff1f9059fb0c54b81a245da30084fd7e137e710f36f1/modelcontextprotocol/python-sdk/issues/3786
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e73ad5e8c65d96d7bf24ff1f9059fb0c54b81a245da30084fd7e137e710f36f1/modelcontextprotocol/python-sdk/issues/3786
og:image:altSummary StreamableHTTPServerTransport keys its per-request response streams by str(request_id). JSON-RPC and MCP allow a request id to be an integer or a string, and an integer 77 and a string "77"...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameWingedGuardian
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-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3786#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3786
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%2F3786
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/3786
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3786
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3786
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/3786
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3786
streamable HTTP: integer and string request ids with the same text share one response stream; a string id can displace the GET streamhttps://github.com/modelcontextprotocol/python-sdk/issues/3786#top
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%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/WingedGuardian
WingedGuardianhttps://github.com/WingedGuardian
on Oct 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3786#issue-6107244472
#3060https://github.com/modelcontextprotocol/python-sdk/issues/3060
#2655https://github.com/modelcontextprotocol/python-sdk/issues/2655
#3137https://github.com/modelcontextprotocol/python-sdk/issues/3137
claudehttps://github.com/apps/claude
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
v2Affects the v2 line (2.x on main)https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
v1Affects the v1.x maintenance linehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
on Oct 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3786#event-34630327143
https://github.com/Ben-Home
Ben-Homehttps://github.com/Ben-Home
on Oct 30, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3786#issuecomment-6522376165
https://github.com/uhuihytddfguijl
uhuihytddfguijlhttps://github.com/uhuihytddfguijl
on Oct 31, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3786#issuecomment-6543486410
https://github.com/WingedGuardian
WingedGuardianhttps://github.com/WingedGuardian
on Oct 31, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3786#issuecomment-6544430568
https://github.com/ashirimi1019
ashirimi1019https://github.com/ashirimi1019
on Nov 2, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3786#issuecomment-6590624510
d7845c0https://github.com/modelcontextprotocol/python-sdk/commit/d7845c073a2b9ba5ab2817ecf93d3e45ef24cd14
#3807https://github.com/modelcontextprotocol/python-sdk/issues/3807
#3432https://github.com/modelcontextprotocol/python-sdk/issues/3432
https://github.com/ashirimi1019/mcp-faultline/blob/main/docs/upstream/patches/0002-Key-Streamable-HTTP-response-streams-by-the-typed-re.patchhttps://github.com/ashirimi1019/mcp-faultline/blob/main/docs/upstream/patches/0002-Key-Streamable-HTTP-response-streams-by-the-typed-re.patch
https://github.com/ashirimi1019/mcp-faultline/actions/runs/41533686584https://github.com/ashirimi1019/mcp-faultline/actions/runs/41533686584
#3192https://github.com/modelcontextprotocol/python-sdk/pull/3192
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3786
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3786
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%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.