From 2acab9b3af2af37d482b6d0d68795286bfe03e2f Mon Sep 17 00:00:00 2001 From: Zalan Meggyesi Date: Wed, 2 Jul 2025 09:12:25 +0200 Subject: [PATCH 1/4] chore(tests): fix a typo It was disturbing my sense of aesthetics --- mcp-test/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp-test/pom.xml b/mcp-test/pom.xml index f24d9fab2..a17b2baaf 100644 --- a/mcp-test/pom.xml +++ b/mcp-test/pom.xml @@ -11,7 +11,7 @@ mcp-test jar Tests for the Java MCP SDK - Provides some shared test fasilities for the MCP Java SDK + Provides some shared test facilities for the MCP Java SDK https://github.com/modelcontextprotocol/java-sdk @@ -94,4 +94,4 @@ - \ No newline at end of file + From d4df4028b5df782b2c58dd5f567d8fe508b58759 Mon Sep 17 00:00:00 2001 From: Zalan Meggyesi Date: Wed, 2 Jul 2025 09:12:37 +0200 Subject: [PATCH 2/4] feat(server): add ability to retrieve server instructions --- .../io/modelcontextprotocol/server/McpAsyncServer.java | 10 ++++++++++ .../io/modelcontextprotocol/server/McpSyncServer.java | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java b/mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java index 02ad955b9..bde0da13b 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java +++ b/mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java @@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.util.annotation.Nullable; /** * The Model Context Protocol (MCP) server implementation that provides asynchronous @@ -236,6 +237,15 @@ public McpSchema.Implementation getServerInfo() { return this.serverInfo; } + /** + * Get the server instructions if available + * @return The preset instructions for communication with the server + */ + @Nullable + public String getInstructions() { + return this.instructions; + } + /** * Gracefully closes the server, allowing any in-progress operations to complete. * @return A Mono that completes when the server has been closed diff --git a/mcp/src/main/java/io/modelcontextprotocol/server/McpSyncServer.java b/mcp/src/main/java/io/modelcontextprotocol/server/McpSyncServer.java index 91f8d9e4c..dd9cbb567 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/server/McpSyncServer.java +++ b/mcp/src/main/java/io/modelcontextprotocol/server/McpSyncServer.java @@ -7,6 +7,7 @@ import io.modelcontextprotocol.spec.McpSchema; import io.modelcontextprotocol.spec.McpSchema.LoggingMessageNotification; import io.modelcontextprotocol.util.Assert; +import reactor.util.annotation.Nullable; /** * A synchronous implementation of the Model Context Protocol (MCP) server that wraps @@ -134,6 +135,15 @@ public McpSchema.Implementation getServerInfo() { return this.asyncServer.getServerInfo(); } + /** + * Get the server instructions if available + * @return The preset instructions for communication with the server + */ + @Nullable + public String getInstructions() { + return this.getAsyncServer().getInstructions(); + } + /** * Notify clients that the list of available resources has changed. */ From c1fb1eef3fcbc06e335fe8b6a765c37ce382c7e2 Mon Sep 17 00:00:00 2001 From: Zalan Meggyesi Date: Wed, 2 Jul 2025 09:12:46 +0200 Subject: [PATCH 3/4] chore(server): set separate version --- mcp/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcp/pom.xml b/mcp/pom.xml index 773432827..81f5d0259 100644 --- a/mcp/pom.xml +++ b/mcp/pom.xml @@ -10,6 +10,7 @@ mcp jar + 0.12.0-SNAPSHOT Java MCP SDK Java SDK implementation of the Model Context Protocol, enabling seamless integration with language models and AI tools https://github.com/modelcontextprotocol/java-sdk @@ -205,4 +206,4 @@ - \ No newline at end of file + From c8577a08e58a8a89bc12acd8f8ee0d2449a1a372 Mon Sep 17 00:00:00 2001 From: Zalan Meggyesi Date: Wed, 2 Jul 2025 15:02:31 +0200 Subject: [PATCH 4/4] chore(all): fix tests by specifying correct versions --- mcp-spring/mcp-spring-webflux/pom.xml | 2 +- mcp-spring/mcp-spring-webmvc/pom.xml | 4 ++-- mcp-test/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mcp-spring/mcp-spring-webflux/pom.xml b/mcp-spring/mcp-spring-webflux/pom.xml index 26452fe95..5c2076800 100644 --- a/mcp-spring/mcp-spring-webflux/pom.xml +++ b/mcp-spring/mcp-spring-webflux/pom.xml @@ -25,7 +25,7 @@ io.modelcontextprotocol.sdk mcp - 0.11.0-SNAPSHOT + 0.12.0-SNAPSHOT diff --git a/mcp-spring/mcp-spring-webmvc/pom.xml b/mcp-spring/mcp-spring-webmvc/pom.xml index 48d1c3465..0e6ed8a7a 100644 --- a/mcp-spring/mcp-spring-webmvc/pom.xml +++ b/mcp-spring/mcp-spring-webmvc/pom.xml @@ -25,7 +25,7 @@ io.modelcontextprotocol.sdk mcp - 0.11.0-SNAPSHOT + 0.12.0-SNAPSHOT @@ -131,4 +131,4 @@ - \ No newline at end of file + diff --git a/mcp-test/pom.xml b/mcp-test/pom.xml index a17b2baaf..07d5fddc0 100644 --- a/mcp-test/pom.xml +++ b/mcp-test/pom.xml @@ -24,7 +24,7 @@ io.modelcontextprotocol.sdk mcp - 0.11.0-SNAPSHOT + 0.12.0-SNAPSHOT