Title: Missing `@JsonIgnoreProperties(ignoreUnknown = true)` on capability sub-records · Issue #766 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: Missing `@JsonIgnoreProperties(ignoreUnknown = true)` on capability sub-records · Issue #766 · modelcontextprotocol/java-sdk
X Title: Missing `@JsonIgnoreProperties(ignoreUnknown = true)` on capability sub-records · Issue #766 · modelcontextprotocol/java-sdk
Description: 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_U...
Open Graph Description: Bug description The top-level ClientCapabilities and ServerCapabilities records have @JsonIgnoreProperties(ignoreUnknown = true), but their nested sub-records do not. Since the ObjectMapper is cons...
X Description: Bug description The top-level ClientCapabilities and ServerCapabilities records have @JsonIgnoreProperties(ignoreUnknown = true), but their nested sub-records do not. Since the ObjectMapper is cons...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/766
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing `@JsonIgnoreProperties(ignoreUnknown = true)` on capability sub-records","articleBody":"### Bug description\n\nThe 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.\n\nThis 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.\n\n### Affected records\n\nIn [`McpSchema.java`](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java):\n\n| Record | Line | Has annotation? |\n|---|---|---|\n| `ClientCapabilities` | [383](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L383) | Yes |\n| `RootCapabilities` | [397](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L397) | Yes |\n| `Sampling` | [410](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L410) | **No** |\n| `Elicitation` | [437](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L437) | **No** |\n| `Elicitation.Form` | [443](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L443) | **No** |\n| `Elicitation.Url` | [450](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L450) | **No** |\n| `ServerCapabilities` | [535](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L535) | Yes |\n| `CompletionCapabilities` | [548](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L548) | **No** |\n| `LoggingCapabilities` | [555](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L555) | **No** |\n| `PromptCapabilities` | [565](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L565) | **No** |\n| `ResourceCapabilities` | [576](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L576) | **No** |\n| `ToolCapabilities` | [587](https://github.com/modelcontextprotocol/java-sdk/blob/0a8cb1e038559ba197c9fe60bec19f4bf054ed63/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L587) | **No** |\n\n### Spec reference\n\nThe spec schema explicitly states capabilities are not a closed set:\n\n\u003e \"Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.\"\n\n[`ClientCapabilities` in schema.json](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/eafd0068e92293feb12e99b650a0f37bac4267c1/schema/2025-06-18/schema.json#L302) — `additionalProperties: false` is never set on any capability object or sub-object. Several sub-capabilities (`sampling`, `elicitation`, `completions`, `logging`) explicitly set `additionalProperties: true`.\n\n### Expected behavior\n\nUnknown fields on capability sub-objects should be silently ignored, matching the behavior of the top-level `ClientCapabilities` and `ServerCapabilities` records.\n\n### Related\n\n- #734 — reports the same issue for `ToolCapabilities` specifically\n- #724 / #731 — the elicitation breakage that was fixed by adding fields, not by adding the annotation\n\n\u003csub\u003e[AI Disclaimer](https://gist.github.com/maxisbey/6123d132484e4c533eab519a2800693d)\u003c/sub\u003e","author":{"url":"https://github.com/maxisbey","@type":"Person","name":"maxisbey"},"datePublished":"2026-01-29T16:47:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/766/java-sdk/issues/766"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7f180979-463f-68d0-596e-ab1472a2c8b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABA2:2B3156:D72F9A:1217AAA:6A5BA06E |
| html-safe-nonce | 29459b8e3a71c6a41f5534b759c24c8580456c08032f78690e323db861e03988 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkEyOjJCMzE1NjpENzJGOUE6MTIxN0FBQTo2QTVCQTA2RSIsInZpc2l0b3JfaWQiOiIxODkxMzY0NjU2NzUwNzY0MTQyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c3d80a6f3794baf1d779f01dc765bcfb306b28efcc5343e3c1ceb405c1e465fa |
| hovercard-subject-tag | issue:3871632803 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/766/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c74fcecc724ba33684e143285e5e697d40b8aa015de35b05c2c65c9fd1faaf61/modelcontextprotocol/java-sdk/issues/766 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c74fcecc724ba33684e143285e5e697d40b8aa015de35b05c2c65c9fd1faaf61/modelcontextprotocol/java-sdk/issues/766 |
| og:image:alt | Bug description The top-level ClientCapabilities and ServerCapabilities records have @JsonIgnoreProperties(ignoreUnknown = true), but their nested sub-records do not. Since the ObjectMapper is cons... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maxisbey |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width