Skip to content

Java SDK annotations field mismatch with MCP Specification #618

@SurajPandurangaJannu

Description

@SurajPandurangaJannu

Bug description
According to the MCP specification, the annotations field is defined to provide additional context or metadata for tools and embedded resources.

Environment
Java SDK

Steps to reproduce
Example from the spec:
MCP Specification – Embedded Resources

{ "type": "resource", "resource": { "uri": "file:///project/src/main.rs", "mimeType": "text/x-rust", "text": "fn main() {\n println!(\"Hello world!\");\n}", "annotations": { "audience": ["user", "assistant"], "priority": 0.7, "lastModified": "2025-05-03T14:30:00Z" } } } 

However, in the Java SDK implementation, the annotations field in McpSchema.java does not match the MCP specification structure.

Observation:
The Java SDK currently defines annotations differently than the official MCP spec and Python SDK, which supports structured annotations (like audience, priority, lastModified, etc.).

McpSchema.java#L1345

Image

McpSchema.java#L1311

Image

Request:
Please confirm whether:

  1. This is a bug or missing implementation in the Java SDK that needs to align with the MCP spec, or
  2. The MCP specification itself has been updated and the Java SDK is following a newer or alternative version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions