Skip to content

Missing @JsonIgnoreProperties(ignoreUnknown = true) on capability sub-records #766

Description

@maxisbey

Bug description

The top-level ClientCapabilities and ServerCapabilities records have @JsonIgnoreProperties(ignoreUnknown = true), but their nested sub-records do not. Since the ObjectMapper is constructed with default settings (FAIL_ON_UNKNOWN_PROPERTIES = true), any unknown field on a capability sub-object causes a deserialization failure.

This already caused a real breakage when the elicitation capability gained form and url fields (#724, fixed in #731), but the systemic issue remains — the next spec addition to any capability sub-object will break older SDK versions again.

Affected records

In McpSchema.java:

Record Line Has annotation?
ClientCapabilities 383 Yes
RootCapabilities 397 Yes
Sampling 410 No
Elicitation 437 No
Elicitation.Form 443 No
Elicitation.Url 450 No
ServerCapabilities 535 Yes
CompletionCapabilities 548 No
LoggingCapabilities 555 No
PromptCapabilities 565 No
ResourceCapabilities 576 No
ToolCapabilities 587 No

Spec reference

The spec schema explicitly states capabilities are not a closed set:

"Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities."

ClientCapabilities in schema.json — additionalProperties: false is never set on any capability object or sub-object. Several sub-capabilities (sampling, elicitation, completions, logging) explicitly set additionalProperties: true.

Expected behavior

Unknown fields on capability sub-objects should be silently ignored, matching the behavior of the top-level ClientCapabilities and ServerCapabilities records.

Related

AI Disclaimer

Activity

  1. DevasiaThomas commented on Jan 29, 2026

    @DevasiaThomas

    Thank you @maxisbey for raising this. My team and I are the ones's that experienced the real breakage 🙂. Appreciate the group's attention to this. Thanks!

    We got folks using all kinds of clients that are on the latest protocol spec, but some Java based MCP servers ( a few owned by us) are on older versions.

  2. added
    P1Significant bug affecting many users, highly requested feature
    bugSomething isn't working
    on Feb 20, 2026
  3. added theissue type on Feb 20, 2026
  4. lux999 commented on Mar 4, 2026

    @lux999

    Thank you @maxisbey for raising this!

    My team hit this exact issue after upgrading to fastmcp 2.14.5 — ClientCapabilities.Sampling is a real blocker for us. Would love to see this land soon!

  5. added a commit that references this issue on Mar 4, 2026
    37a9f3a
  6. Soumyadeep009 commented on Mar 6, 2026

    @Soumyadeep009

    @maxisbey I am thinking of making the ObjectMapper not fail on unknown properties. So this would apply globally. Is this okay @chemicL @tzolov ? @rameshreddy-adutla 's fix applies annotation on each field that is affected, but is prone to failure to future fields with missed annotations.

  7. maxisbey commented on Mar 9, 2026

    @maxisbey
    Author

    That's what we do in the Python SDK (and is also done in the Typescript SDK), we just mark all extra fields as ignored so it won't error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Significant bug affecting many users, highly requested featurebugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions