Fix uncaught exception in MCP server
Motivation and Context
This fixes an uncaught exception in the MCP server
How Has This Been Tested?
Via unit tests and locally.
Breaking Changes
None.
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
Checklist
- [x] I have read the MCP Documentation
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed
Additional context
@johnw188
So to clarify, currently this is blocking from using the streamable-http transport inside clients such as Windsurf or Claude Desktop correct?
Hmm, this shouldn't be blocking any clients, it is just adding error handling for a previously unhandled exception. Have you observed issues with this PR in certain clients?
@bruno-oliveira This shouldn't be blocking anyone, but it does fix a huge security issue with remote servers. Currently anyone can lock up a server just by sending a bad payload https://github.com/modelcontextprotocol/python-sdk/issues/820
I'm a bit baffled that a security issue like this is still open