diff --git a/mcp-spring/mcp-spring-webflux/pom.xml b/mcp-spring/mcp-spring-webflux/pom.xml index 26452fe9..5c207680 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 48d1c346..0e6ed8a7 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 f24d9fab..07d5fddc 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 @@ -24,7 +24,7 @@ io.modelcontextprotocol.sdk mcp - 0.11.0-SNAPSHOT + 0.12.0-SNAPSHOT @@ -94,4 +94,4 @@ - \ No newline at end of file + diff --git a/mcp/pom.xml b/mcp/pom.xml index 77343282..81f5d025 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 + diff --git a/mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java b/mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java index 02ad955b..bde0da13 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 91f8d9e4..dd9cbb56 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. */