fix: ServerCapabilities should not enable logging by default (#463)
- Change LoggingCapabilities from default-initialized to nullable in ServerCapabilities - Add check if server logging is enabled in McpAsyncClient before setting logging level - Ensure McpAsyncServer always enables logging capabilities when built - Ensure McpStatelessAsyncServer has disabled logging capability by default - Update tests to verify logging capabilities can be null Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com> Co-authored-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
parent
369e925c66
commit
a96da37140
1 changed files with 9 additions and 5 deletions
|
|
@ -950,7 +950,7 @@ public abstract class AbstractMcpClientServerIntegrationTests {
|
|||
List<McpSchema.LoggingMessageNotification> receivedNotifications = new CopyOnWriteArrayList<>();
|
||||
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
;
|
||||
|
||||
// Create server with a tool that sends logging notifications
|
||||
McpServerFeatures.AsyncToolSpecification tool = McpServerFeatures.AsyncToolSpecification.builder()
|
||||
.tool(Tool.builder()
|
||||
|
|
@ -999,7 +999,7 @@ public abstract class AbstractMcpClientServerIntegrationTests {
|
|||
.build();
|
||||
|
||||
var mcpServer = prepareAsyncServerBuilder().serverInfo("test-server", "1.0.0")
|
||||
.capabilities(ServerCapabilities.builder().logging().tools(true).build())
|
||||
.capabilities(ServerCapabilities.builder().tools(true).build())
|
||||
.tools(tool)
|
||||
.build();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue