Skip to content

add server instructions #2720

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

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ public McpSyncServer mcpSyncServer(McpServerTransportProvider transportProvider,

serverBuilder.capabilities(capabilitiesBuilder.build());

serverBuilder.instructions(serverProperties.getInstructions());

return serverBuilder.build();
}

Expand Down Expand Up @@ -324,6 +326,8 @@ public McpAsyncServer mcpAsyncServer(McpServerTransportProvider transportProvide

serverBuilder.capabilities(capabilitiesBuilder.build());

serverBuilder.instructions(serverProperties.getInstructions());

return serverBuilder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public class McpServerProperties {
*/
private String version = "1.0.0";

/**
* The instructions of the MCP server instance.
* <p>
* These instructions are used to provide guidance to the client on how to interact
* with this server.
*/
private String instructions = null;

/**
* Enable/disable notifications for resource changes. Only relevant for MCP servers
* with resource capabilities.
Expand Down Expand Up @@ -180,6 +188,14 @@ public void setVersion(String version) {
this.version = version;
}

public String getInstructions() {
return this.instructions;
}

public void setInstructions(String instructions) {
this.instructions = instructions;
}

public boolean isResourceChangeNotification() {
return this.resourceChangeNotification;
}
Expand Down