Releases: modelcontextprotocol/java-sdk
Releases · modelcontextprotocol/java-sdk
v0.17.2
v0.17.1
Bug fix release:
Full Changelog: v0.17.0...v0.17.1
v0.17.0
What's Changed
- Fix experimental client capabilities tests by @Kehrlann in #670
- Fix typo in test name by @mingo1996 in #661
- Client transports: make #protocolVersions() configurable by @Kehrlann in #669
- chore: Spring 5 compatibility by @He-Pin in #649
- Fix the baseUrl is configured with a trailing slash #645 by @leehaut in #646
- WebMvcSseServerTransportProvider: do not include session ID in SSE event by @Kehrlann in #677
- refactor: use builder pattern for CallToolResult and simplify lambda expressions in tests by @codeboyzhou in #652
- Basic version negotiation capabilities by @Kehrlann in #684
- Revert "WebClientStreamableHttpTransport: use Spring-5 compatible met…hods (#649)" by @tzolov in #696
New Contributors
- @mingo1996 made their first contribution in #661
Full Changelog: v0.16.0...v0.17.0
v0.16.0
What's Changed
- feat: enhance error handling with custom error code preservation by @tzolov in #653
- Bump json-schema-validator from 1.5.7 to 2.0.0 by @uarlouski in #660
- fix: JSONRPCResponse JavaDoc by @vorburger in #657
- fix(docs): Remove broken @see link in McpServer.java Javadoc by @hbsjz-swl in #614
- feat(schema): support Object type for progressToken by @tzolov in #663
New Contributors
- @uarlouski made their first contribution in #660
- @vorburger made their first contribution in #657
- @hbsjz-swl made their first contribution in #614
Full Changelog: v0.15.0...v0.16.0
v0.15.0
What's Changed
- define explicitely that values should always be included in code completions by @sdelamo in #601
- fix remove name when using @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) by @sdelamo in #600
- refactor: change int to Integer for optional numeric fields by @tzolov in #604
- fix: allow additional properties by default per JSON Schema spec by @tzolov in #617
- Close McpTransportSession on transport close by @Kehrlann in #632
- Fix: McpAsyncClient#listTools prevent infinite recursion by @leehaut in #631
- chore: standardize client/server implementation names and version by @tzolov in #642
- Update dependencies minor versions to fix build on JDK 25 by @bedrin in #640
- Support o.s.h.HttpHeaders from both 6.x and 7.x Spring branches by @bedrin in #639
New Contributors
Full Changelog: v0.14.1...v0.15.0
v0.14.1
Full Changelog: v0.14.0...v0.14.1
v0.14.0
What's Changed
- refactor: Improve resource template management and API consistency by @tzolov @pascalconfluent #576
- fix: handle resource not found according to spec by @sdelamo in #567
- feat: add optional lastModified field to Annotations record by @tzolov in #568
- fix: typo MCP_SESSION_ID, keep consistent style with other identifiers by @JunJieLiu51520 in #564
- refactor: improve MCP server resilience and error handling by @tzolov in #579
- fix: when using JsonTypeInfo.DEDUCTION don’t add include by @sdelamo in #587
- Client: handle server responses with Content-Length: 0 by @Kehrlann in #588
- fix: Handle non-compliant notification responses by @tzolov in #589
- feat(client): add client tool output schema validation and caching by @pantanurag555 @tzolov @chemicL @Kehrlann #302
New Contributors
- @JunJieLiu51520 made their first contribution in #564
Full Changelog: v0.13.1...v0.14.0
v0.13.1
Full Changelog: v0.13.0...v0.13.1
v0.13.0
Release Notes
🚀 Major Features & Enhancements
Protocol Version Support
- Added MCP protocol version 2025-06-18 support for streamable-http and stateless transports (#558)
- Set MCP_2025_06_18 as upper supported protocol version
- Updated LATEST_PROTOCOL_VERSION constant to reflect new upper bound
Module Restructuring
-
Extracted
mcp-coremodule (#557) -⚠️ BREAKING CHANGE- Created new
mcp-coremodule free of Jackson dependencies mcpmodule now serves as an umbrella module bringing togethermcp-json-jackson2andmcp-core- Classes are now in different JARs, which may affect classpath dependencies
- Created new
-
Jackson decoupling (#543) - Related to (#557)
- Abstract away Jackson usage with SPI interfaces
Creates two modules, mcp-json and mcp-json-jackson. It removes the com.fasterxml.jackson.core:jackson-databind and com.networknt:json-schema-validator dependencies from the mcp (now mcp-core) module. The mcp-core (mcp previously) module now only depends on com.fasterxml.jackson.core:jackson-annotations.
To use Jackson, you have to add mcp-jackson to your dependencies in addition to mcp-core. I added the dependency mcp-jackson to both mcp-spring-mvc and mcp-spring-webflux to avoid a breaking change in those modules.
- Abstract away Jackson usage with SPI interfaces
Enhanced Tool Output Support
- Support for array-type structured content in tools (#551) -
⚠️ BREAKING CHANGE- Changed
CallToolResult.structuredContenttype fromMap<String,Object>toObject - Now supports both objects and arrays as structured content output
- Updated JsonSchemaValidator to validate any Object type
- Deprecated CallToolResult constructors in favor of builder pattern
- Aligns with MCP specification requirements for array-type output schemas
- Changed
🐛 Bug Fixes
Session Management
- Fixed LifecycleInitializer error recovery (#549)
- Initializer can now recover from errors during
doInitialize(e.g., HTTP errors) - Prevents getting stuck in error state and allows subsequent initialization calls to work
- Particularly beneficial for OAuth2 token fetch scenarios
- Initializer can now recover from errors during
Serialization Improvements
- Added JsonInclude annotation to notification records (#552)
- Enhanced proper JSON serialization for
ResourcesUpdatedNotificationandLoggingMessageNotification - Excludes absent (null/Optional.empty()) fields from serialized output
- Ensures consistent serialization behavior across all notification types
- Enhanced proper JSON serialization for
Test Infrastructure
- Standardized test parameterization (#556)
- Replaced @valuesource with @MethodSource for parameterized tests
- Added consistent
clientsForTesting()methods - Removed hardcoded Spring-related labels from framework-agnostic mcp-test module
- Minor breaking change: moved utility classes from
io.modelcontextprotocol.utilstoio.modelcontextprotocol.util
⚠️ Breaking Changes Summary
-
Module Structure Changes (#557 and #543))
- Classes previously in
mcpare now inmcp-core.mcpmodule now serves as an umbrella module bringing togethermcp-json-jackson2andmcp-core. - May require classpath adjustments
- Classes previously in
-
Tool Result API Changes (#551)
CallToolResult.structuredContent()now returnsObjectinstead ofMap<String,Object>- Requires explicit casting when accessing map-like content:
((Map<String,Object>) result.structuredContent()).get("key") - Deprecated constructors - use builder pattern instead
- Custom
JsonSchemaValidatorimplementations need signature updates
-
Package Name Changes (#556)
- Utility classes moved from
io.modelcontextprotocol.utilstoio.modelcontextprotocol.util
- Utility classes moved from
📝 Migration Guide
For Tool Result Changes
// Before
result.structuredContent().get("key")
// After
((Map<String,Object>) result.structuredContent()).get("key")
// Use builder pattern instead of deprecated constructors
CallToolResult.builder()
.content(content)
.isError(isError)
.structuredContent(structuredContent)
.build()For Module Dependencies
Ensure your dependencies account for the new module structure:
mcp-corefor Jackson-free core functionalitymcpcontinues to work as umbrella module with Jackson support
New Contributors
- @sdelamo made their first contribution in #557
- @graemerocher made their first contribution in #543
- @valuesource made their first contribution in #556
Full Changelog: v0.12.1...v0.13.0
v0.12.1
Release Notes
- Skip structured output validation for error tool results (#540) - ensures that when a tool handler returns an error result, the structured
output schema validation is skipped, preventing validation failures on error responses that don't conform to the expected output schema. - Add null check for response ID to prevent memory leaks (#509) - The missing null check could lead to memory leaks as pending requests
would never be completed when responses lack session IDs. This fix ensures proper handling of such cases with appropriate error logging.
Full Changelog: v0.12.0...v0.12.1