You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 767c512
Browse filesBrowse the repository at this point in the historyBrowse files
Fix MCP server 500 error on unknown client capability fields (#26008)
* Use dedicated ObjectMapper for MCP protocol deserialization
The global Graylog ObjectMapper (with SnakeCaseStrategy and custom
modules) was being used to deserialize MCP SDK protocol types, which
bypassed the SDK's @JsonIgnoreProperties(ignoreUnknown = true)
annotations. This caused 500 errors when clients sent forward-compatible
capability fields like capabilities.sampling.tools.
Introduce a plain ObjectMapper qualified with @McpProtocolObjectMapper
for deserializing McpSchema.* types, while keeping the global mapper for
serializing Graylog domain objects in tool results.
Fixes: #25956
Co-Authored-By: Claude Opus 4.6 <[EMAIL_ADDRESS_REDACTED]>
* Disable FAIL_ON_UNKNOWN_PROPERTIES on the MCP protocol ObjectMapper
The MCP Java SDK has a known bug (modelcontextprotocol/java-sdk#766)
where capability sub-records like ClientCapabilities.Sampling lack
@JsonIgnoreProperties(ignoreUnknown = true). As a temporary workaround
we explicitly disable FAIL_ON_UNKNOWN_PROPERTIES to tolerate
forward-compatible fields from newer MCP clients.
Co-Authored-By: Claude Opus 4.6 <[EMAIL_ADDRESS_REDACTED]>
* Add regression test for unknown MCP client capability fields
Verifies that the protocol ObjectMapper tolerates forward-compatible
fields like capabilities.sampling.tools that the SDK's empty Sampling
record doesn't declare.
Regression test for #25956
Co-Authored-By: Claude Opus 4.6 <[EMAIL_ADDRESS_REDACTED]>
* Qualifier annotation for the ObjectMapper used to deserialize MCP protocol messages.
31
+
* This mapper is a plain ObjectMapper configured with FAIL_ON_UNKNOWN_PROPERTIES=false,
32
+
* unlike the global Graylog ObjectMapper which adds SnakeCaseStrategy and custom modules
33
+
* that interfere with the MCP SDK's own Jackson annotations.
34
+
*
35
+
* Workaround for <a href="https://github.com/modelcontextprotocol/java-sdk/issues/766">java-sdk#766</a>.
36
+
* Remove once the SDK adds @JsonIgnoreProperties(ignoreUnknown=true) to its capability records.
// Version negotiation: https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle#version-negotiation
@@ -130,7 +133,7 @@ public Optional<McpSchema.Result> handle(PermissionHelper permissionHelper, McpS
0 commit comments