Skip to content

Conversation

@rhtnr
Copy link

@rhtnr rhtnr commented Dec 20, 2025

Summary

Fixes #724

Updates the Elicitation record in McpSchema.java to support form and url fields as specified in the 2025-11-25 MCP specification.

Changes

  • Added nested Form and Url records to Elicitation with proper Jackson annotations
  • Added no-arg constructor for backward compatibility with existing code
  • Added elicitation(boolean form, boolean url) builder method for explicit control
  • Added 7 comprehensive tests covering deserialization, serialization, and backward compatibility

Backward Compatibility

This change is fully backward compatible:

Scenario Before After
Deserialize {"elicitation":{}} ✅ Works ✅ Works
Deserialize {"elicitation":{"form":{}}} ❌ Fails ✅ Works
Deserialize {"elicitation":{"form":{},"url":{}}} ❌ Fails ✅ Works
builder().elicitation().build() ✅ Works ✅ Works
Serialize empty elicitation {} {}

Test plan

  • All 7 new tests pass
  • All 82 existing tests pass
  • Verified deserialization of spec-compliant JSON with form/url fields
  • Verified backward compatibility with empty elicitation object

…1-25 spec

Update the ClientCapabilities.Elicitation record to accept optional "form"
and "url" fields as defined in the MCP 2025-11-25 specification.

Previously, deserializing an InitializeRequest with
`{"capabilities":{"elicitation":{"form":{}}}}` would fail with
UnrecognizedPropertyException because the Elicitation record was empty.

Changes:
- Add nested Form and Url marker records to Elicitation
- Add no-arg constructor for backward compatibility (serializes to {})
- Add elicitation(boolean form, boolean url) builder method
- Add comprehensive tests for deserialization and serialization

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant