Skip to content

Commit f8934ac

Browse files
committed
fix: disable logging capabilities for stateless servers
Remove LoggingCapabilities from McpStatelessServerFeatures.Async constructor as stateless servers do not support setLogging operations. This aligns the async implementation with the sync implementation which already has logging disabled. Follows up on modelcontextprotocol#463 Signed-off-by: Christian Tzolov <[email protected]>
1 parent 6ec443c commit f8934ac

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

mcp/src/main/java/io/modelcontextprotocol/server/McpStatelessServerFeatures.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ record Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities s
6767
this.serverCapabilities = (serverCapabilities != null) ? serverCapabilities
6868
: new McpSchema.ServerCapabilities(null, // completions
6969
null, // experimental
70-
new McpSchema.ServerCapabilities.LoggingCapabilities(), // Enable
71-
// logging
72-
// by
73-
// default
70+
null, // currently statless server doesn't support set logging
7471
!Utils.isEmpty(prompts) ? new McpSchema.ServerCapabilities.PromptCapabilities(false) : null,
7572
!Utils.isEmpty(resources)
7673
? new McpSchema.ServerCapabilities.ResourceCapabilities(false, false) : null,

0 commit comments

Comments
 (0)