Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonSchema not accessible #36

Closed
patwlan opened this issue Mar 9, 2025 · 1 comment
Closed

JsonSchema not accessible #36

patwlan opened this issue Mar 9, 2025 · 1 comment

Comments

@patwlan
Copy link

patwlan commented Mar 9, 2025

Bug description
The JsonSchema class is not accessible outside of its package. It would seem that
https://github.com/modelcontextprotocol/java-sdk/blob/main/mcp/src/main/java/io/modelcontextprotocol/spec/McpSchema.java#L670 needs to be made public.

Environment
Using the Mcp Client:
implementation(platform("io.modelcontextprotocol.sdk:mcp-bom:0.7.0"))
implementation("io.modelcontextprotocol.sdk:mcp")

Expected behavior
The JsonSchema should be accessible.

Minimal Complete Reproducible example
I am currently working on integrating MCP in our kotlin AI Agent Framework
https://github.com/eclipse-lmos/arc/blob/main/arc-mcp/src/main/kotlin/McpTools.kt.
Currently when trying to access the field tool.inputSchema it cannot compile.
I can set this up so that the error can be reproduced, if that helps.

Thanks a lot! And great work!

tzolov added a commit that referenced this issue Mar 10, 2025
Resolves #36

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov closed this as completed in 4eff00c Mar 10, 2025
@tzolov
Copy link
Contributor

tzolov commented Mar 10, 2025

@patwlan thanks for catching this. It should be resolved by #4eff00c
Looking forward to check the kotlin AI Agent Framework.

tzolov added a commit that referenced this issue Mar 17, 2025
* feat(mcp):  relax MCP Schema JSON deserialization constraints

- Add @JsonIgnoreProperties(ignoreUnknown = true) annotation to all record
classes in McpSchema to make JSON deserialization more robust by ignoring
unknown properties.
- Make the JsonSchema record public

Resolves #36

This improves compatibility with third-party implementations like Cursor that are not MCP Schema compliant.

Signed-off-by: Christian Tzolov <[email protected]>
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

No branches or pull requests

2 participants