Skip to content

InitializeRequest doesn't accept non-empty Elicitation, violating 2025-11-25 spec #724

Description

@overheadhunter

Bug description
An initialize request with "capabilities":{"elicitation":{"form":{}}} causes this error:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "form" (class io.modelcontextprotocol.spec.McpSchema$ClientCapabilities$Elicitation), not marked as ignorable (0 known properties: ])
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 72] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeRequest["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ClientCapabilities["elicitation"]->io.modelcontextprotocol.spec.McpSchema$ClientCapabilities$Elicitation["form"])

This violates the 2025-11-25 spec.

Environment
N/A

Steps to reproduce
run test shown below

Expected behavior
test succeeds

Minimal Complete Reproducible example

@Test
void testParseInitializeRequest() throws IOException {
	String serialized = """
			{"protocolVersion":"2024-11-05","capabilities":{"elicitation":{"form":{}}},"clientInfo":{"name":"test-client","version":"1.0.0"},"_meta":{"metaKey":"metaValue"}}
			""";

	McpSchema.InitializeRequest deserialized = JSON_MAPPER.readValue(serialized, McpSchema.InitializeRequest.class);

	McpSchema.ClientCapabilities capabilities = McpSchema.ClientCapabilities.builder()
			.elicitation()
			.build();
	McpSchema.Implementation clientInfo = new McpSchema.Implementation("test-client", "1.0.0");
	Map<String, Object> meta = Map.of("metaKey", "metaValue");
	McpSchema.InitializeRequest expected = new McpSchema.InitializeRequest(ProtocolVersions.MCP_2024_11_05,
			capabilities, clientInfo, meta);
	assertThat(deserialized).isEqualTo(expected);
}

Activity

  1. added a commit that references this issue on Dec 13, 2025
    ceb2348
  2. fansanelli commented on Dec 15, 2025

    @fansanelli

    Hello,
    I don't know if it may help to have a scenario, but I experienced this error after trying in VSCode the McpStatelessAsyncServer through HTTP protocol.
    Cheers

  3. overheadhunter commented on Dec 15, 2025

    @overheadhunter
    Author

    Same for me, VSCode appears to be using the new spec already, but servers using this SDK can't handle it.

    In my case I was trying to include the SonarQube MCP server.

  4. fansanelli commented on Dec 17, 2025

    @fansanelli

    I know that maybe the proper fix is to implement the newer spec, but in the meantime this problem is blocking. Any chance to get the fix upstream?

  5. nquinquenel commented on Dec 17, 2025

    @nquinquenel
    Contributor

    @overheadhunter SQ MCP Server developer here - I'll provide a fix for our next version, the JSON mapper should not fail on unknown properties.

  6. added a commit that references this issue on Dec 20, 2025
    df05e73
  7. rhtnr commented on Dec 20, 2025

    @rhtnr
    Contributor

    I've opened a PR to address this: #731

  8. overheadhunter commented on Dec 20, 2025

    @overheadhunter
    Author

    I've opened a PR to address this: #731

    do you want to add your changes to the existing PR? there has been some activity on it already.

  9. rhtnr commented on Dec 20, 2025

    @rhtnr
    Contributor

    I had missed your original PR. I'm not sure if I can merge mine to your PR, I will let maintainers decide

  10. khobiziilyes commented on Dec 30, 2025

    @khobiziilyes

    Can you get this fixed :) as its a huge blocker of our daily workflow. Thank you for the great work tool tho!

    @overheadhunter @nquinquenel

  11. overheadhunter commented on Jan 7, 2026

    @overheadhunter
    Author

    I'm not sure if I can merge mine to your PR, I will let maintainers decide

    @rhtnr You can create a PR against this branch: https://github.com/overheadhunter/mcp-java-sdk/tree/fix-724. The combined changes should then show up on PR #725

  12. added a commit that references this issue on Jan 7, 2026
    214546c
  13. rhtnr commented on Jan 8, 2026

    @rhtnr
    Contributor

    @overheadhunter
    I've opened a PR against your branch with additional field modeling for form and url: overheadhunter#1

    This combines your @JsonIgnoreProperties approach with explicit field support, giving us both future-proofing and proper parsing/serialization of the spec fields.

  14. devxb commented on Jan 8, 2026

    @devxb

    I resolved this issue by using a servlet filter. (on spring-ai)

    dependency: spring-ai-starter-mcp-server-webmvc:1.1.2

    spring-projects/spring-ai#5133 (comment)

  15. added a commit that references this issue on Jan 8, 2026
    806048e
  16. added a commit that references this issue on Jan 8, 2026
    e7901da
  17. added a commit that references this issue on Jan 8, 2026
    a2a81cd
  18. afucher commented on Jan 14, 2026

    @afucher

    In which version this fix will be released?
    nvm, github does not show the minor release with the fix in the main page of the project

  19. added a commit that references this issue on Mar 4, 2026
  20. added a commit that references this issue on Jun 25, 2026
    7f007e3
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions