feat: Add roots change notification support to MCP server

- Implement roots change notification handler in McpAsyncServer
- Add rootsChangeConsumer builder methods to support single and multiple consumers
- Rename info() builder method to serverInfo() for clarity
- Add comprehensive tests for roots change notification functionality
- Add default server info implementation in Builder

Resolves #39
This commit is contained in:
Christian Tzolov 2025-01-02 08:27:12 +01:00
commit 0fd93a9f82

View file

@ -67,7 +67,7 @@ public class McpServerConfig {
// Create the server with both tool and resource capabilities
var server = McpServer.using(transport)
.info("MCP Demo Server", "1.0.0")
.serverInfo("MCP Demo Server", "1.0.0")
.capabilities(capabilities)
.resources(systemInfoResourceRegistration())
.prompts(greetingPromptRegistration())