-
Notifications
You must be signed in to change notification settings - Fork 627
ServerCapabilities builder should not assign logging an initial value #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServerCapabilities builder should not assign logging an initial value #463
Conversation
Thanks @Randgalt. Could you elaborate on this? Does it break existing clients? I don't see how this could be harmful. Also, some existing (deprecated) code expects the logging to be present:
|
I see one issue with logging enabled in the stateless server context: it will falsely claim logging capability but won't actually be able to send logs. |
There are two issues:
So, the stateless server advertises that it supports logging but it doesn't. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Randgalt , we need to ensure backward compatibility for the non-stateless servers
by ensuring that the logging capabilities is enabled by default for those.
I've just added a ServerCapabilities#mutate() method that should help you do this.
(e.g. capabilities = capabilities.mutate().logging();
)
OK - I understand. I'll close this. |
I will reopen the PR and apply the missing change while merging it |
- 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 <[email protected]> Co-authored-by: Christian Tzolov <[email protected]>
- 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 <[email protected]> Co-authored-by: Christian Tzolov <[email protected]>
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]>
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]>
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]>
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]>
Motivation and Context
ServerCapabilities builder should not assign logging an initial value
How Has This Been Tested?
added
assertThat(result.capabilities().logging()).isNull();
totestSuccessfulInitialization
Breaking Changes
ServerCapabilities
builder no longer has logging enabled by default.Types of changes
Checklist