docs Improve MCP readme

This commit is contained in:
Christian Tzolov 2024-12-28 23:56:16 +01:00
commit 347f86ff19
2 changed files with 270 additions and 203 deletions

View file

@ -155,19 +155,6 @@ public interface McpServer {
return this;
}
/**
* Set the server implementation information using name and version.
* @param name The server name
* @param version The server version
* @return This builder instance
*/
public Builder serverInfo(String name, String version) {
Assert.notNull(name, "Server name must not be null");
Assert.notNull(version, "Server version must not be null");
this.serverInfo = new McpSchema.Implementation(name, version);
return this;
}
/**
* Set the server capabilities.
* @param serverCapabilities The server capabilities configuration

View file

@ -60,27 +60,6 @@ public class McpSyncServer {
this.asyncServer.removeTool(toolName).block();
}
/**
* Notify clients that the list of available tools has changed.
*/
public void notifyToolsListChanged() {
this.asyncServer.notifyToolsListChanged().block();
}
/**
* Notify clients that the list of available resources has changed.
*/
public void notifyResourcesListChanged() {
this.asyncServer.notifyResourcesListChanged().block();
}
/**
* Notify clients that the list of available prompts has changed.
*/
public void notifyPromptsListChanged() {
this.asyncServer.notifyPromptsListChanged().block();
}
/**
* Add a new resource handler.
* @param resourceHandler The resource handler to add
@ -113,6 +92,27 @@ public class McpSyncServer {
this.asyncServer.removePrompt(promptName).block();
}
/**
* Notify clients that the list of available tools has changed.
*/
public void notifyToolsListChanged() {
this.asyncServer.notifyToolsListChanged().block();
}
/**
* Notify clients that the list of available resources has changed.
*/
public void notifyResourcesListChanged() {
this.asyncServer.notifyResourcesListChanged().block();
}
/**
* Notify clients that the list of available prompts has changed.
*/
public void notifyPromptsListChanged() {
this.asyncServer.notifyPromptsListChanged().block();
}
/**
* Close the server gracefully.
*/