8000 Comparing v0.13.1...v0.14.0 · modelcontextprotocol/java-sdk · GitHub
[go: up one dir, main page]

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: modelcontextprotocol/java-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.13.1
Choose a base ref
...
head repository: modelcontextprotocol/java-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.14.0
Choose a head ref
  • 11 commits
  • 45 files changed
  • 8 contributors

Commits on Sep 18, 2025

  1. Next development version

    Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
    tzolov committed Sep 18, 2025
    Configuration menu
    Copy the full SHA
    a0afdcd View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2025

  1. 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
    sdelamo authored Sep 22, 2025
    Configuration menu
    Copy the full SHA
    d327fff View commit details
    Browse the repository at this point in the history
  2. feat: add optional lastModified field to Annotations record with back…

    …ward compatibility (#568)
    
    Resolves #565
    
    Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
    tzolov authored Sep 22, 2025
    Configuration menu
    Copy the full SHA
    a90b922 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f16cd0 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2025

  1. 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>
    tzolov committed Sep 28, 2025
    Configuration menu
    Copy the full SHA
    ff98e29 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2025

  1. 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>
    tzolov authored Sep 30, 2025
    Configuration menu
    Copy the full SHA
    c1cde20 View commit details
    Browse the repository at this point in the history
  2. 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.
    sdelamo authored Sep 30, 2025
    Configuration menu
    Copy the full SHA
    12292ab View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2025

  1. 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>
    Kehrlann committed Oct 1, 2025
    Configuration menu
    Copy the full SHA
    080098e View commit details
    Browse the repository at this point in the history
  2. 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>
    tzolov authored Oct 1, 2025
    Configuration menu
    Copy the full SHA
    3f7578b View commit details
    Browse the repository at this point in the history
  3. 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>
    5 people committed Oct 1, 2025
    Configuration menu
    Copy the full SHA
    8e11fa8 View commit details
    Browse the repository at this point in the history
  4. Release version 0.14.0

    Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
    tzolov committed Oct 1, 2025
    Configuration menu
    Copy the full SHA
    23b81e1 View commit details
    Browse the repository at this point in the history
Loading
0