Skip to content

v0.11.2

Latest
Compare
Choose a tag to compare
@tzolov tzolov released this 11 Aug 15:41
· 16 commits to main since this release

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 McpError exceptions for proper RPC error responses
    • DefaultMcpStatelessServerHandler now preserves McpError exceptions instead of converting them to INTERNAL_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 McpError with specific McpTransportException for transport-layer errors
    • Enhanced error messages with additional context (status codes, response events)
    • Breaking Change: Code catching McpError for transport errors should now catch McpTransportException
  • HTTP Request Customization (#466): Fixed httpRequestCustomizer usage in HttpClientStreamableHttpTransport

    • 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
    • WebFluxSseIntegrationTests and WebFluxStreamableIntegrationTests now extend AbstractMcpClientServerIntegrationTests
    • WebFluxStatelessIntegrationTests and WebMvcStatelessIntegrationTests now extend AbstractStatelessIntegrationTests
    • 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 McpError for transport-related errors, update to catch McpTransportException instead
  • 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