René's URL Explorer Experiment


Title: streamable_http client call_tool hangs when receiving invalid JSONRPCMessage · Issue #1144 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: streamable_http client call_tool hangs when receiving invalid JSONRPCMessage · Issue #1144 · modelcontextprotocol/python-sdk

X Title: streamable_http client call_tool hangs when receiving invalid JSONRPCMessage · Issue #1144 · modelcontextprotocol/python-sdk

Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description Issue Description: Dur...

Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...

X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"streamable_http client call_tool hangs when receiving invalid JSONRPCMessage","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\nIssue Description:\nDuring testing, we encountered a critical issue in the Server-Sent Events (SSE) handling mechanism:\n\n1. Problem Trigger:\nTo some reason, the `_handle_sse_event` method received a truncated `sse.data` payload, causing:\nA JSON parsing exception `message = JSONRPCMessage.model_validate_json(sse.data)`\nThen the exception handle sent the exc and returned false\n2. Current Behavior Gap:\nDespite the failed processing:\n·No error propagation to the client occurs\n·No cleanup/retry mechanism is triggered\n·The client remains stuck in a perpetual wait state for a tool_call result until timeout\n3. Critical Impact: The server has already completed the tool_call workflow and moved to the final /done state, creating a state desynchronization between client and server\n4. Root Cause Hypothesis:\nIt appears that the client failed to detect the reception of invalid responses. The `await read_stream_writer.send(exc)` did not work during exception handling\n\nOr maybe I missed some configs such as the retry mechanism or other error handling methods?\n\n### Example Code\n\n```Python\nasync def _handle_sse_event(\n    self,\n    sse: ServerSentEvent,\n    read_stream_writer: StreamWriter,\n    original_request_id: RequestId | None = None,\n    resumption_callback: Callable[[str], Awaitable[None]] | None = None,\n    is_initialization: bool = False,\n) -\u003e bool:\n    \"\"\"Handle an SSE event, returning True if the response is complete.\"\"\"\n    if sse.event == \"message\":\n        try:\n            message = JSONRPCMessage.model_validate_json(sse.data) ##### threw the exception\n            logger.debug(f\"SSE message: {message}\")\n\n            # Extract protocol version from initialization response\n            if is_initialization:\n                self._maybe_extract_protocol_version_from_message(message)\n\n            # If this is a response and we have original_request_id, replace it\n            if original_request_id is not None and isinstance(message.root, JSONRPCResponse | JSONRPCError):\n                message.root.id = original_request_id\n\n            session_message = SessionMessage(message)\n            await read_stream_writer.send(session_message)\n\n            # Call resumption token callback if we have an ID\n            if sse.id and resumption_callback:\n                await resumption_callback(sse.id)\n\n            # If this is a response or error return True indicating completion\n            # Otherwise, return False to continue listening\n            return isinstance(message.root, JSONRPCResponse | JSONRPCError)\n\n        except Exception as exc:\n            ##### handled exception but client did not receive ######\n            logger.exception(\"Error parsing SSE message\")\n            await read_stream_writer.send(exc)\n            return False\n    else:\n        logger.warning(f\"Unknown SSE event: {sse.event}\")\n        return False\n```\n\n### Python \u0026 MCP Python SDK\n\n```Text\npython == 3.12\nSDK == 1.11.0\n```","author":{"url":"https://github.com/Nuclear2","@type":"Person","name":"Nuclear2"},"datePublished":"2025-07-15T02:32:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/1144/python-sdk/issues/1144"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3acdecf9-cdb0-4c31-c415-58e6d6b50227
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAE26:DD39B:1383FB3:1BE3BFC:6A634668
html-safe-nonceb12d7203300155149c18c7a672fc8bbe9a408e2528cf3c38c7812377ee58080b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTI2OkREMzlCOjEzODNGQjM6MUJFM0JGQzo2QTYzNDY2OCIsInZpc2l0b3JfaWQiOiI1NTAzMTM2NjY3NTI3MjM1MTc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1b6da07afb900046e2d562c55b624365d2e1e88eb6366b83249bf2dd238b2806
hovercard-subject-tagissue:3230553155
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/1144/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1f19f6d85a7691932289f6819dd18f15bd7b4929a394140985114ef183b68aa6/modelcontextprotocol/python-sdk/issues/1144
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1f19f6d85a7691932289f6819dd18f15bd7b4929a394140985114ef183b68aa6/modelcontextprotocol/python-sdk/issues/1144
og:image:altInitial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameNuclear2
hostnamegithub.com
expected-hostnamegithub.com
None59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94
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
release990295d92a4cc7b63fbbd83a046217cd7d77d49c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/1144#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F1144
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2Fissues%2F1144
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1144
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1144
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1144
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/issues/1144
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.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 270 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 321 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
#2005https://github.com/modelcontextprotocol/python-sdk/pull/2005
streamable_http client call_tool hangs when receiving invalid JSONRPCMessagehttps://github.com/modelcontextprotocol/python-sdk/issues/1144#top
#2005https://github.com/modelcontextprotocol/python-sdk/pull/2005
P1Significant bug affecting many users, highly requested featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P1%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
ready for workEnough information for someone to start working onhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
HTTP Transport Edge Caseshttps://github.com/modelcontextprotocol/python-sdk/milestone/18
https://github.com/Nuclear2
Nuclear2https://github.com/Nuclear2
on Jul 15, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1144#issue-3230553155
https://github.com/modelcontextprotocol/python-sdk/issueshttps://github.com/modelcontextprotocol/python-sdk/issues
P1Significant bug affecting many users, highly requested featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P1%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
ready for workEnough information for someone to start working onhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
HTTP Transport Edge CasesNo due datehttps://github.com/modelcontextprotocol/python-sdk/milestone/18
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.