handle BrokenResourceError gracefully#237
handle BrokenResourceError gracefully#237lingster wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/python-sdk:mainfrom
Conversation
dsp-ant
left a comment
There was a problem hiding this comment.
If the stream is rendered unusable as indicated by a BrokenResourceError, we should handle this appropriately. I don't think ignoring is the right appraoch. We likely want to close the connection at this point. Clients should graefully restart the process.
There was a problem hiding this comment.
Thank you for your contribution to the MCP Python SDK!
Your PR addresses a valid issue with handling BrokenResourceError in the stdio transport. However, as there has been no activity on this PR for over 2 months, I'm closing it at this time.
We appreciate your effort in identifying and attempting to fix this issue. If you decide to refresh this PR with the suggested improvements, please feel free to reopen it or submit a new one.
Improved Error handling when a BrokenResourceError occurs
Motivation and Context
With my mcp server, I occasionally get this error which renders my claude session unusable.
How Has This Been Tested?
Tested my mcp server with Claude Desktop
Breaking Changes
No breaking changes
Types of changes
Checklist
Additional context