-
Notifications
You must be signed in to change notification settings - Fork 791
Comparing changes
Open a pull request
base repository: modelcontextprotocol/java-sdk
base: v0.13.1
head repository: modelcontextprotocol/java-sdk
compare: v0.14.0
- 11 commits
- 45 files changed
- 8 contributors
Commits on Sep 18, 2025
-
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Configuration menu - View commit details
-
Copy full SHA for a0afdcd - Browse repository at this point
Copy the full SHA a0afdcdView commit details
Commits on Sep 22, 2025
-
fix: handle resource not found according to spec (#567)
see: https://modelcontextprotocol.io/specification/2025-06-18/server/resources#error-handling Resource not found should send a JSON RPC response such as: ```json { "jsonrpc": "2.0", "id": 5, "error": { "code": -32002, "message": "Resource not found", "data": { "uri": "file:///nonexistent.txt" } } } ``` This PR also changes some instances where a `McpError` was thrown instead of being passed in the reactive chain with `Mono.error` functional style
Configuration menu - View commit details
-
Copy full SHA for d327fff - Browse repository at this point
Copy the full SHA d327fffView commit details -
feat: add optional lastModified field to Annotations record with back…
Configuration menu - View commit details
-
Copy full SHA for a90b922 - Browse repository at this point
Copy the full SHA a90b922View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f16cd0 - Browse repository at this point
Copy the full SHA 7f16cd0View commit details
Commits on Sep 28, 2025
-
refactor: Improve resource template support (#576)
- Provide separation of concerns between static resources and parameterized resource templates. - Add AsyncResourceTemplateSpecification and SyncResourceTemplateSpecification for both McpServerFeatures and McpStatelessServerFeatures - Change resource template storage from List to Map to acomodate the resource read handler. - Add runtime management methods: addResourceTemplate(), removeResourceTemplate(), listResourceTemplates() - Improve error handling by using IllegalArgumentException/IllegalStateException instead of McpError - Add new interfaces (Meta, Identifier) and reorganize schema hierarchy - Enhance completion request validation with better error messages - Add ResourceTemplate.Builder for easier template construction - Update all server implementations (Async, Sync, Stateless) consistently - Add type-safe constants for reference types (PromptReference.TYPE, ResourceReference.TYPE) - Add tests for new resource template management functionality - Clean up imports and remove unused dependencies Co-authored-by: Pascal Vantrepote <pascal@confluent.io> Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Configuration menu - View commit details
-
Copy full SHA for ff98e29 - Browse repository at this point
Copy the full SHA ff98e29View commit details
Commits on Sep 30, 2025
-
refactor: improve MCP server resilience and error handling (#579)
- Replace McpError with appropriate standard exceptions (IllegalArgumentException, IllegalStateException) for validation errors - Change tool/prompt registration to replace existing items instead of rejecting duplicates with warningsi - Change addTool behavior to replace existing tools instead of throwing errors - Change addPrompt() to allow replacing existing prompts with warning instead of throwing error - Make removal operations idempotent - log warnings instead of throwing errors for non-existent items - Change removePrompt() to log warning instead of throwing error for non-existent prompts - Change removeTool() to gracefully handle non-existent tools with warnings instead of errors - Add listTools() and listPrompts() methods to all server variants (async, sync, stateless) - Add listTools() method to all server classes for tool enumeration - Add listPrompts() method to all server implementations for retrieving registered prompts - Improve error construction using McpError.builder() pattern for protocol-specific errors - Update error handling in session classes to properly propagate McpError JSON-RPC errors - Use proper error codes (INVALID_PARAMS) for prompt not found scenarios - Update tests to reflect new lenient behavior for duplicate registrations and removals - Add aggregateExceptionMessages() utility method utility to aggregate the exception chains - Update McpServerSession and McpStreamableServerSession to use the aggregated errors in the json-rpc-error data section This change makes the MCP server APIs more resilient and user-friendly by using appropriate exception types, supporting item replacement, and providing listing capabilities while maintaining backward compatibility. Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Configuration menu - View commit details
-
Copy full SHA for c1cde20 - Browse repository at this point
Copy the full SHA c1cde20View commit details -
fix: when using JsonTypeInfo.DEDUCTION don’t add include (#587)
From the JSonTypeInfo Javadocs: > If deduction is being used annotation properties visible, property and include are ignored. This is causing issues with serialization downstream.
Configuration menu - View commit details
-
Copy full SHA for 12292ab - Browse repository at this point
Copy the full SHA 12292abView commit details
Commits on Oct 1, 2025
-
Client: handle server responses with Content-Length: 0
- When the client sends `notification/initalized`, servers must respond with HTTP 202 and an empty body. We checked for the absence of a Content-Type header to verify whether the body was empty. - However, some servers will send an empty body with a Content-Type header, and that header may have an unsupported, default type such as `text/html` or `text/plain`. - Now we we also use the Content-Length header to check for an empty body. This header is optional in HTTP/2, so we do not make it our primary mechanism for detecting empty bodies. - As part of this PR, we also move hard-coded HTTP header names to the HttpHeaders interface. While they are not defined by the MCP spec, they are used by it and are core to implementing the protocol. Therefore, they have their place in a core interface. - Fixes #582 Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
Configuration menu - View commit details
-
Copy full SHA for 080098e - Browse repository at this point
Copy the full SHA 080098eView commit details -
fix: Handle non-compliant notification responses (#589)
Ensure warnings are logged for all non-compliant responses to JSON-RPC notifications, including empty responses. Empty responses now display as "[empty]" in log messages for better clarity. Resolves #586 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Configuration menu - View commit details
-
Copy full SHA for 3f7578b - Browse repository at this point
Copy the full SHA 3f7578bView commit details -
feat(client): add client tool output schema validation and caching (#302
) - Add JSON schema validation for tool call results against output schemas - Implement automatic tool output schema caching during initialization - Add `enableCallToolSchemaCaching` configuration option to enable/disable schema caching - Add `JsonSchemaValidator` integration to McpClient builder APIs - Introduce post-initialization hook mechanism for performing operations after successful client initialization - Cache tool output schemas during `listTools` operations when caching is enabled - Validate tool results against cached schemas in `callTool` operations - Return error CallToolResult when validation fails - Add test coverage - Convert validateToolResult from Mono to synchronous method - Throw IllegalArgumentException on validation errors Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com> Co-authored-by: Anurag Pant <pantanurag555@github> Co-authored-by: Christian Tzolov <christian.tzolov@broadcom.com> Co-authored-by: Daniel Garnier-Moiroux <git@garnier.wf> Co-authored-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Configuration menu - View commit details
-
Copy full SHA for 8e11fa8 - Browse repository at this point
Copy the full SHA 8e11fa8View commit details -
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Configuration menu - View commit details
-
Copy full SHA for 23b81e1 - Browse repository at this point
Copy the full SHA 23b81e1View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.13.1...v0.14.0