Skip to content

Instructions #365

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mcp-spring/mcp-spring-webflux/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.12.0-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions mcp-spring/mcp-spring-webmvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.12.0-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -131,4 +131,4 @@
</dependencies>


</project>
</project>
6 changes: 3 additions & 3 deletions mcp-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<artifactId>mcp-test</artifactId>
<packaging>jar</packaging>
<name>Tests for the Java MCP SDK</name>
<description>Provides some shared test fasilities for the MCP Java SDK</description>
<description>Provides some shared test facilities for the MCP Java SDK</description>
<url>https://github.com/modelcontextprotocol/java-sdk</url>

<scm>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.12.0-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -94,4 +94,4 @@
</dependencies>


</project>
</project>
3 changes: 2 additions & 1 deletion mcp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</parent>
<artifactId>mcp</artifactId>
<packaging>jar</packaging>
<version>0.12.0-SNAPSHOT</version>
<name>Java MCP SDK</name>
<description>Java SDK implementation of the Model Context Protocol, enabling seamless integration with language models and AI tools</description>
<url>https://github.com/modelcontextprotocol/java-sdk</url>
Expand Down Expand Up @@ -205,4 +206,4 @@
</dependencies>


</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down
Loading