fix: disable logging capabilities for stateless servers #517
+1
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #463
Remove logging capabilities from stateless servers as they don't support setLogging operations.
Motivation and Context
This change fixes an inconsistency in the MCP Java SDK where stateless servers were incorrectly advertising logging capabilities. Stateless servers do not support setLogging operations, so they should not expose LoggingCapabilities in their server capabilities.
This follows up on #463 and aligns the async stateless server implementation with the sync implementation, which already correctly sets logging capabilities to null.
How Has This Been Tested?
Breaking Changes
This is not a breaking change for users. Clients that were attempting to use logging with stateless servers would have encountered errors anyway, so removing the capability advertisement prevents confusion and aligns with actual server behavior.
Types of changes
Checklist