Skip to content

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Aug 26, 2025

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?

  • Verified that stateless servers no longer advertise logging capabilities
  • Confirmed that existing functionality remains unchanged
  • Tested that the server capabilities are properly constructed with null logging

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@tzolov tzolov added this to the 0.12.0 milestone Aug 26, 2025
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]>
@tzolov tzolov force-pushed the fix-stateless-server-has-no-logging-capabilities branch from f8934ac to cc32f1d Compare August 26, 2025 09:48
@tzolov tzolov merged commit 9c9e2eb into modelcontextprotocol:main Aug 26, 2025
1 of 3 checks passed
tzolov added a commit that referenced this pull request Aug 26, 2025
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

Signed-off-by: Christian Tzolov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants