Mcp-core has compile-time dependency on mcp-json
Opened this issue · 1 comments
mcp-core project has a compile-time dependency on mcp-json due to the location of these three classes:
/mcp-json/src/main/java/io/modelcontextprotocol/json/McpJsonMapper.java
/mcp-json/src/main/java/io/modelcontextprotocol/json/TypeRef.java
/mcp-json/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java
I would argue that since these classes are required at all times, it doesn't make sense for them to be in a separate jar...as mcp-core jar is useless without mcp-json jar also present.
I would suggest moving these three classes (at least) back to mcp-core (e.g. in package io.modelcontextprotocol.sdk.util or io.modelcontextprotocol.sdk.json. This would allow a clear separation between mapper and schema validator interfaces (in core) and their implementation (default or other).
May I add another finding that is related to this issue?
Due to the specific bnd-maven-plugin configuration in mcp-core, the class files from mcp-json are assembled into the mcp-core jar. The situation you describe is therefore already evident, albeit in a very unexpected way.