File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
mcp/src/main/java/io/modelcontextprotocol/server Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 3535import org .slf4j .LoggerFactory ;
3636import reactor .core .publisher .Flux ;
3737import reactor .core .publisher .Mono ;
38+ import reactor .util .annotation .Nullable ;
3839
3940/**
4041 * The Model Context Protocol (MCP) server implementation that provides asynchronous
@@ -236,6 +237,15 @@ public McpSchema.Implementation getServerInfo() {
236237 return this .serverInfo ;
237238 }
238239
240+ /**
241+ * Get the server instructions if available
242+ * @return The preset instructions for communication with the server
243+ */
244+ @ Nullable
245+ public String getInstructions () {
246+ return this .instructions ;
247+ }
248+
239249 /**
240250 * Gracefully closes the server, allowing any in-progress operations to complete.
241251 * @return A Mono that completes when the server has been closed
Original file line number Diff line number Diff line change 77import io .modelcontextprotocol .spec .McpSchema ;
88import io .modelcontextprotocol .spec .McpSchema .LoggingMessageNotification ;
99import io .modelcontextprotocol .util .Assert ;
10+ import reactor .util .annotation .Nullable ;
1011
1112/**
1213 * A synchronous implementation of the Model Context Protocol (MCP) server that wraps
@@ -134,6 +135,15 @@ public McpSchema.Implementation getServerInfo() {
134135 return this .asyncServer .getServerInfo ();
135136 }
136137
138+ /**
139+ * Get the server instructions if available
140+ * @return The preset instructions for communication with the server
141+ */
142+ @ Nullable
143+ public String getInstructions () {
144+ return this .getAsyncServer ().getInstructions ();
145+ }
146+
137147 /**
138148 * Notify clients that the list of available resources has changed.
139149 */
You can’t perform that action at this time.
0 commit comments