Skip to content

Fix Spring AI MCP client list discovery - #107

Merged
brianstrauch merged 1 commit into
mainfrom
fix/spring-ai-mcp-client-discovery
Oct 16, 2026
Merged

brianstrauch merged 1 commit into
mainfrom
fix/spring-ai-mcp-client-discovery

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

Spring AI's MCP auto-configuration exposes clients as a List<McpSyncClient> bean, while McpPlugin only discovers individual clients. Workers therefore omit MCP activities even after the MCP connection initializes, and workflows fail with MCP-Client-GetClientInfo not 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:

cd java/spring-ai
./gradlew --no-daemon spotlessCheck test stageDist
./gradlew --no-daemon -PspringBootVersion=4.1.1 spotlessCheck test stageDist

Without the fix, the Spring Boot/stdio regression reproduces the missing MCP-Client-GetClientInfo activity failure.

@brianstrauch
brianstrauch requested a review from a team as a code owner October 16, 2026 20:14
@brianstrauch
brianstrauch enabled auto-merge (squash) October 16, 2026 21:59

@DABH DABH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@brianstrauch
brianstrauch merged commit 98f7345 into main Oct 16, 2026
20 checks passed
@brianstrauch
brianstrauch deleted the fix/spring-ai-mcp-client-discovery branch October 16, 2026 22:07
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