Skip to content

Conversation

@paoxiaomooo
Copy link
Contributor

@paoxiaomooo paoxiaomooo commented Jul 23, 2025

This PR introduces server name-based filtering capabilities to AsyncMcpToolCallbackProvider, matching the functionality already present in the synchronous implementation. The changes include:

​​New Constructor​​:
public AsyncMcpToolCallbackProvider(List mcpClients, Set allowedServerNames)

  • Filters clients by allowed server names during initialization
  • aintains existing asynchronous behavior
  • Includes null/empty validation
    ​​New Reactive Utility Method​​:
    public static Flux asyncToolCallbacksByServer(List mcpClients, Set allowedServerNames)
  • Provides end-to-end reactive pipeline for filtered tool discovery
  • Performs duplicate tool name validation
  • Preserves non-blocking characteristics

Why Add Server Filtering?

  1. Selective Tool Discovery – Only fetch tools from specified servers, reducing overhead and improving performance.
  2. Consistent API – Matches the sync version’s functionality, avoiding surprises.
  3. Reactive Efficiency – Built-in non-blocking filtering for cleaner, optimized async flows.
  4. Operational Control – Enables precise server management in multi-server environments.

Before: Manual filtering + duplicate checks.
After: Single-line reactive filtering with validation.
// Cleaner, safer usage
Flux tools = asyncToolCallbacksByServer(clients, allowedServers);

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.

1 participant