This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 2277ae7a fix(mcp-server): ignore unknown properties during
deserialisation
2277ae7a is described below
commit 2277ae7aa8d9520e2f6d7a26c45af69eb758a0ad
Author: Robert Munteanu <[email protected]>
AuthorDate: Tue Jan 13 13:30:01 2026 +0100
fix(mcp-server): ignore unknown properties during deserialisation
Workaround for upstream issue
https://github.com/modelcontextprotocol/java-sdk/issues/724 . This
appears with MCP clients implementing the 2025-11-25 version of the spec
which supports more
properties for the 'elicitation' object.
For now, we ignore unknown properties since there is no release of the MCP
Java SDK that contains
the fix.
---
.../org/apache/sling/mcp/server/impl/McpJsonMapperProvider.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
a/mcp-server/src/main/java/org/apache/sling/mcp/server/impl/McpJsonMapperProvider.java
b/mcp-server/src/main/java/org/apache/sling/mcp/server/impl/McpJsonMapperProvider.java
index 74bece17..5df93df3 100644
---
a/mcp-server/src/main/java/org/apache/sling/mcp/server/impl/McpJsonMapperProvider.java
+++
b/mcp-server/src/main/java/org/apache/sling/mcp/server/impl/McpJsonMapperProvider.java
@@ -27,6 +27,8 @@ import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
+import static
com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
+
@Component
public class McpJsonMapperProvider {
@@ -34,7 +36,10 @@ public class McpJsonMapperProvider {
@Activate
public void activate(BundleContext bundleContext) {
- McpJsonMapper jsonMapper = new JacksonMcpJsonMapper(new
ObjectMapper());
+ ObjectMapper objectMapper = new ObjectMapper();
+ // work around
https://github.com/modelcontextprotocol/java-sdk/issues/724
+ objectMapper.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
+ McpJsonMapper jsonMapper = new JacksonMcpJsonMapper(objectMapper);
serviceRegistration =
bundleContext.registerService(McpJsonMapper.class, jsonMapper, null);
}