René's URL Explorer Experiment


Title: Stateless mode drops HTTP responses for long-running tool calls · Issue #1886 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Stateless mode drops HTTP responses for long-running tool calls · Issue #1886 · modelcontextprotocol/python-sdk

X Title: Stateless mode drops HTTP responses for long-running tool calls · Issue #1886 · modelcontextprotocol/python-sdk

Description: Description When using StreamableHTTPSessionManager with stateless=True and json_response=True, HTTP responses for long-running tool calls (2-5+ minutes) are never sent back to the client. The client receives an empty response immediatel...

Open Graph Description: Description When using StreamableHTTPSessionManager with stateless=True and json_response=True, HTTP responses for long-running tool calls (2-5+ minutes) are never sent back to the client. The clie...

X Description: Description When using StreamableHTTPSessionManager with stateless=True and json_response=True, HTTP responses for long-running tool calls (2-5+ minutes) are never sent back to the client. The clie...

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

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stateless mode drops HTTP responses for long-running tool calls","articleBody":"## Description\n\nWhen using `StreamableHTTPSessionManager` with `stateless=True` and `json_response=True`, HTTP responses for long-running tool calls (2-5+ minutes) are never sent back to the client. The client receives an empty response immediately while the server continues processing.\n\n## Environment\n\n- MCP SDK: 1.25.0\n- Python: 3.13\n- Client: Claude Code 2.1.9 (MCP protocol version `2025-11-25`)\n\n## Reproduction\n\n**Server configuration:**\n```python\nsession_manager = StreamableHTTPSessionManager(\n    app=mcp, \n    json_response=True, \n    stateless=True\n)\n```\n\n**Tool that takes several minutes:**\n```python\n@mcp.call_tool()\nasync def call_tool(name: str, arguments: dict):\n    result = await long_running_operation()  # 2-5 minutes\n    return result\n```\n\n**Steps:**\n1. Connect Claude Code to the MCP server\n2. Call the long-running tool\n3. Client receives empty response immediately\n4. Server logs show tool completed successfully with valid result\n\n## Expected Behavior\n\nHTTP response should be sent after tool completes, containing the result.\n\n## Actual Behavior\n\n- Client receives empty response immediately\n- Server processes tool call successfully\n- Server generates result (logged correctly)\n- **HTTP response is never sent to client**\n\n## Log Evidence\n\n```\n12:01:55.130 - Client POST request received (mcp_protocol: 2025-11-25)\n12:01:56.080 - tool_call event logged\n12:06:50.269 - Tool result generated:\n               content_count: 1, content_types: [\"text\"]\n               ❌ NO HTTP response logged for client request\n```\n\nKey observation: Only ONE `mcp_request` logged but both `tools/list` and `tools/call` execute. Response routing appears broken for the second request.\n\n## Workaround Attempted\n\nSetting `stateless=False` causes `400 Bad Request: Missing session ID` - incompatible with Claude Code's connection pattern.\n\n## Hypothesis\n\nIn `_handle_stateless_request`, when rapid successive requests arrive from the same client, response routing fails for long-running operations. The response is generated but never correlated back to the correct HTTP connection.","author":{"url":"https://github.com/tony-nekola-silk","@type":"Person","name":"tony-nekola-silk"},"datePublished":"2026-01-16T13:35:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1886/python-sdk/issues/1886"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3039a1a9-b98e-9101-ee7e-e6dbcbea3646
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB66:3F8DBE:29221:37953:696E4751
html-safe-noncebc9f92c81c2a779950add57e58a703c93bee366f8790ebc4965a3c5ac018f5ca
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjY2OjNGOERCRToyOTIyMTozNzk1Mzo2OTZFNDc1MSIsInZpc2l0b3JfaWQiOiI2MjUzOTYwMzc4OTI5MDA2NDE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3293a9e5bdd277dee71c8b87b2c0f207a2ee6b506518dc9427a537a68cbe2033
hovercard-subject-tagissue:3822062750
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/1886/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1d81335767cc4550602a5803ee151bf4c56ec25d91249cb20e8763eb1ceff28d/modelcontextprotocol/python-sdk/issues/1886
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1d81335767cc4550602a5803ee151bf4c56ec25d91249cb20e8763eb1ceff28d/modelcontextprotocol/python-sdk/issues/1886
og:image:altDescription When using StreamableHTTPSessionManager with stateless=True and json_response=True, HTTP responses for long-running tool calls (2-5+ minutes) are never sent back to the client. The clie...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametony-nekola-silk
hostnamegithub.com
expected-hostnamegithub.com
None3d96554e55b469c47dbcd31f74dc86278872b170531e84c6ce7f3389673e01d1
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
releaseef576694863a4c791d0a5cc9d2b84384d4414bcd
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues/1886#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F1886
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F1886
Sign up https://patch-diff.githubusercontent.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://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues/1886
Reloadhttps://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues/1886
Reloadhttps://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues/1886
modelcontextprotocol https://patch-diff.githubusercontent.com/modelcontextprotocol
python-sdkhttps://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3k https://patch-diff.githubusercontent.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 21.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk
Issues 238 https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues
Pull requests 90 https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/pulls
Actions https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/actions
Projects 0 https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/security
Please reload this pagehttps://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues/1886
Insights https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/pulse
Code https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk
Issues https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues
Pull requests https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/pulls
Actions https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/actions
Projects https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/projects
Security https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/security
Insights https://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/1886
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/1886
Stateless mode drops HTTP responses for long-running tool callshttps://patch-diff.githubusercontent.com/modelcontextprotocol/python-sdk/issues/1886#top
https://github.com/tony-nekola-silk
https://github.com/tony-nekola-silk
tony-nekola-silkhttps://github.com/tony-nekola-silk
on Jan 16, 2026https://github.com/modelcontextprotocol/python-sdk/issues/1886#issue-3822062750
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.