Move mcp-json into mcp-core, add OSGi support

Co-authored-by: Luca Chang <131398524+LucaButBoring@users.noreply.github.com>
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
Scott Lewis 2026-01-28 15:43:23 -08:00 • committed by Daniel Garnier-Moiroux
commit c3b9ab09ea
2 changed files with 368 additions and 353 deletions

View file

@ -9,7 +9,7 @@ import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Function;
import io.modelcontextprotocol.json.McpJsonMapper;
import io.modelcontextprotocol.json.McpJsonDefaults;
import io.modelcontextprotocol.json.TypeRef;
import io.modelcontextprotocol.spec.McpClientTransport;
import io.modelcontextprotocol.spec.McpSchema;
@ -94,7 +94,7 @@ public class MockMcpTransport implements McpClientTransport, McpServerTransport
@Override
public <T> T unmarshalFrom(Object data, TypeRef<T> typeRef) {
return McpJsonMapper.getDefault().convertValue(data, typeRef);
return McpJsonDefaults.getDefaultMcpJsonMapper().convertValue(data, typeRef);
}
}

View file

@ -1,5 +1,6 @@
package io.modelcontextprotocol.util;
import io.modelcontextprotocol.json.McpJsonDefaults;
import io.modelcontextprotocol.json.McpJsonMapper;
public final class McpJsonMapperUtils {
@ -7,6 +8,6 @@ public final class McpJsonMapperUtils {
private McpJsonMapperUtils() {
}
public static final McpJsonMapper JSON_MAPPER = McpJsonMapper.getDefault();
public static final McpJsonMapper JSON_MAPPER = McpJsonDefaults.getDefaultMcpJsonMapper();
}