Repository navigation
Fix Spring AI MCP client list discovery - #107
Conversation
DABH
left a comment
There was a problem hiding this comment.
Reviewed d485164: no actionable findings. The change discovers typed client-list beans alongside individual clients, deduplicates shared instances, and preserves deferred registration and duplicate-name rejection.
All 135 tests passed with Java 17 / Boot 4.0.8 and again with Java 25 / Boot 4.1.1, including the real Spring Boot/stdio tool-execution regression. Formatting, staged distribution metadata/license/Java-17 bytecode checks, and repository conventions also passed; the full CI compatibility matrix is green.
Independently reran the original samples-java #810 startup probe against published 0.1.1 and this PR's jar. The published package reproduces the missing MCP-Client-GetClientInfo activity failure; this jar discovers the client and initializes the sample successfully without the individual-client-bean workaround. This confirms the upstream fix for the earlier follow-up.
Spring AI's MCP auto-configuration exposes clients as a
List<McpSyncClient>bean, whileMcpPluginonly discovers individual clients. Workers therefore omit MCP activities even after the MCP connection initializes, and workflows fail withMCP-Client-GetClientInfonot registered (known types:CallChatModel).Discover typed client-list beans alongside individual clients, deduplicate shared client instances, and preserve deferred registration and duplicate-name validation. Add a real Spring Boot/stdio regression using a local Java MCP server, plus coverage for multiple lists, aliases, late discovery, and duplicate names. The new tests require no provider credentials or external services.
This is the upstream fix for the MCP discovery follow-up on temporalio/samples-java#810. After release, the samples can consume it through a dependency bump.
Validation on Java 21: all 135 tests pass with both supported Spring Boot versions, along with formatting and distribution checks:
Without the fix, the Spring Boot/stdio regression reproduces the missing
MCP-Client-GetClientInfoactivity failure.