v0.11.2
Bug Fix Release
Server-Sent Events (SSE) Improvements
- Enhanced SSE Comment Handling (#467): Added proper support for SSE comment lines starting with ':' according to SSE specification
- Comment lines are now properly ignored during processing
- Added debug logging for comment line processing
- Improves compatibility with SSE streams that include comment messages
Error Handling Enhancements
- Handler Exception Support (#465): Stateless Server Handlers can now throw
McpErrorexceptions for proper RPC error responsesDefaultMcpStatelessServerHandlernow preservesMcpErrorexceptions instead of converting them toINTERNAL_ERROR- Enables handlers to send appropriate error codes (not found, validation errors, etc.) to clients
- Maintains full compatibility with MCP RPC error specification
HTTP Transport Layer
-
Streamable HTTP Session Management (#469): Fixed session reinitialization behavior to comply with MCP specification
- Servers now properly handle session termination with HTTP 404 responses
- Clients correctly detect terminated sessions and start new sessions without session IDs
- Replaced generic
McpErrorwith specificMcpTransportExceptionfor transport-layer errors - Enhanced error messages with additional context (status codes, response events)
- Breaking Change: Code catching
McpErrorfor transport errors should now catchMcpTransportException
-
HTTP Request Customization (#466): Fixed
httpRequestCustomizerusage inHttpClientStreamableHttpTransport- Resolves configuration issues with HTTP client request customization
Test Infrastructure Improvements
- Test Code Refactoring (#473): Major cleanup of integration test structure
- Extracted common test logic into abstract base classes
WebFluxSseIntegrationTestsandWebFluxStreamableIntegrationTestsnow extendAbstractMcpClientServerIntegrationTestsWebFluxStatelessIntegrationTestsandWebMvcStatelessIntegrationTestsnow extendAbstractStatelessIntegrationTests- Eliminated ~1,300+ lines of duplicated test code
- Improved maintainability through centralized, reusable test logic
- Each test class now focuses only on transport-specific setup methods
📋 Summary
This release focuses on improving the robustness and compliance of the MCP implementation with several key enhancements:
- Better SSE specification compliance with comment line handling
- Improved error handling capabilities for custom handlers
- MCP specification-compliant session management for streamable HTTP
- Significant reduction in code duplication through test refactoring
Migration Notes
- Minor Breaking Change: If your code catches
McpErrorfor transport-related errors, update to catchMcpTransportExceptioninstead - Minor Breaking Change: Error handling logic that assumes all 404/400 responses are session errors may need updates to handle the more specific error handling
All changes maintain backward compatibility except for the specific exception type changes noted above.
Full Changelog: v0.11.1...v0.11.2