Skip to content

fix: respect caller-provided server capabilities - #1101

Open
1yuxiangJ wants to merge 1 commit into
modelcontextprotocol:mainfrom
1yuxiangJ:fix/1086-server-capabilities-logging
Open

fix: respect caller-provided server capabilities#1101
1yuxiangJ wants to merge 1 commit into
modelcontextprotocol:mainfrom
1yuxiangJ:fix/1086-server-capabilities-logging

Conversation

@1yuxiangJ

Copy link
Copy Markdown

Fixes #1086

Problem

McpAsyncServer unconditionally advertises the logging capability,
even when the caller did not configure it.

Changes

  • Preserve the caller-provided server capabilities
  • Stop implicitly advertising logging
  • Cover both server transport construction paths
  • Add regression tests
  • Explicitly configure logging in the existing logging integration test

Testing

Passed:

./mvnw -pl mcp-core -Dtest=McpAsyncServerCapabilitiesTests test
./mvnw -pl mcp-core test
./mvnw -pl mcp-test -am \
  -Dtest=HttpServletSseIntegrationTests#testLoggingNotification,HttpServletStreamableIntegrationTests#testLoggingNotification \
  -Dsurefire.failIfNoSpecifiedTests=false test

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.

ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilities

1 participant