modelcontextprotocol/java-sdk

Javadocs?

Opened this issue · 4 comments

Cazra commented

Are there Javadocs for Spring MCP somewhere? I see a lot of code examples, but can't find any detailed documentation about the classes used in the examples.

Cazra commented

I can't seem to find the docs I'm looking for through that. What should I be selecting, for example, if I want to lookup the class documentation for mcp-core/src/main/java/io/modelcontextprotocol/client/McpSyncClient.java?

Cazra commented

I've also tried building the javadocs from source using mvn javadoc:javadoc, but I get errors from doing that.

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Java SDK MCP Parent 0.15.0-SNAPSHOT:
[INFO] 
[INFO] Java SDK MCP Parent ................................ SUCCESS [ 36.789 s]
[INFO] Java SDK MCP BOM ................................... SUCCESS [  0.077 s]
[INFO] Java MCP SDK JSON Support .......................... FAILURE [  8.819 s]
[INFO] Java MCP SDK JSON Jackson .......................... SKIPPED
[INFO] Java MCP SDK Core .................................. SKIPPED
[INFO] Java MCP SDK ....................................... SKIPPED
[INFO] Tests for the Java MCP SDK ......................... SKIPPED
[INFO] WebFlux transports ................................. SKIPPED
[INFO] Spring Web MVC transports .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  57.010 s
[INFO] Finished at: 2025-10-03T12:22:46-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.12.0:javadoc (default-cli) on project mcp-json: An error has occurred in Javadoc report generation: 
[ERROR] Exit code: 1
[ERROR] /home/helix/Downloads/spring-mcp/java-sdk/mcp-json/src/main/java/io/modelcontextprotocol/json/TypeRef.java:12: error: malformed HTML
[ERROR]  * Usage: TypeRef<List<Foo>> ref = new TypeRef<>(){};
[ERROR]                  ^
[ERROR] /home/helix/Downloads/spring-mcp/java-sdk/mcp-json/src/main/java/io/modelcontextprotocol/json/TypeRef.java:12: error: unknown tag: Foo
[ERROR]  * Usage: TypeRef<List<Foo>> ref = new TypeRef<>(){};
[ERROR]                       ^
[ERROR] /home/helix/Downloads/spring-mcp/java-sdk/mcp-json/src/main/java/io/modelcontextprotocol/json/TypeRef.java:12: error: malformed HTML
[ERROR]  * Usage: TypeRef<List<Foo>> ref = new TypeRef<>(){};
[ERROR]                                               ^
[ERROR] /home/helix/Downloads/spring-mcp/java-sdk/mcp-json/src/main/java/io/modelcontextprotocol/json/TypeRef.java:14: warning: no @param for <T>
[ERROR] public abstract class TypeRef<T> {
[ERROR]                 ^
[ERROR] /home/helix/Downloads/spring-mcp/java-sdk/mcp-json/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java:26: warning: no comment
[ERROR] 		public static ValidationResponse asValid(String jsonStructuredOutput) {
[ERROR] 		                                 ^
[ERROR] /home/helix/Downloads/spring-mcp/java-sdk/mcp-json/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java:30: warning: no comment
[ERROR] 		public static ValidationResponse asInvalid(String message) {
[ERROR] 		                                 ^
[ERROR] 3 errors
[ERROR] 3 warnings
[ERROR] Command line was: /home/helix/Downloads/jdk-21.0.4/bin/javadoc -J-Duser.language= -J-Duser.country= @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '/home/helix/Downloads/spring-mcp/java-sdk/mcp-json/target/reports/apidocs' dir.
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :mcp-json```

Well, looks like the JavaDocs for the io.modelcontextprotocol.sdk libraries are empty (jar exists but doesn't have JavaDocs):
https://repo1.maven.org/maven2/io/modelcontextprotocol/sdk/mcp-core/0.14.0/

So we will have to get the maintainers to fix the generation of those.