Skip to content

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Sep 12, 2025

  1. Rename method parameter rootsChangeConsumers to align mcpSyncServer with mcpAsyncServer.
  2. Simplify lambda.

1. Rename method parameter `rootsChangeConsumers` to align `mcpSyncServer` with `mcpAsyncServer`.
2. Simplify lambda.

Signed-off-by: Yanming Zhou <[email protected]>
.accept(exchange, roots);
serverBuilder.rootsChangeHandler(syncConsumer);
rootsChangeConsumer.ifAvailable(consumer -> {
serverBuilder.rootsChangeHandler(consumer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quaff Thanks for the PR. I believe this is safer to do as the consumer type would always be BiConsumer<McpSyncServerExchange, List<McpSchema.Root>>. But, I want to double check with why it was done this way at first place. @tzolov what's your thoughts on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's copied from mcpAsyncServer method which cannot use it directly.

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