-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple SSE connections issue and SYNC mode startup failure in McpClientAutoConfiguration #2486
Comments
I have closed the duplicate questions. This one is kept and I have already written the code and am ready to submit it. |
Current Issues
Proposed Solution
Benefits
Testing Requirements
Related Files
Labels: enhancement, optimization, configuration |
I apologize for the previous incomplete submission. I have created a new PR (#2493) with a more comprehensive solution: Improvements in the New PR
I suggest closing this issue (#2486) and moving the discussion to the new PR: #2493 Thank you for your understanding and support. Signed-off-by: aliyun1024qjc [email protected] |
In the current implementation of
McpClientAutoConfiguration
, there are two critical issues:type: ASYNC
, both SSE implementations (WebFlux and HttpClient) attempt to establish connections to the same server endpoint simultaneously. This occurs because the auto-configuration allows both transports to be registered:java
@autoConfiguration(after = {
StdioTransportAutoConfiguration.class,
SseHttpClientTransportAutoConfiguration.class,
SseWebFluxTransportAutoConfiguration.class
})
This results in:
type: SYNC
, the application fails to start. This appears to be related to the order of auto-configuration initialization specified in the@AutoConfiguration(after = {...})
annotation.Example configuration where these issues occur:
yaml
spring:
ai:
mcp:
client:
type: ASYNC # or SYNC
server:
endpoint: "http://localhost:8080/"
Questions:
Environment:
The text was updated successfully, but these errors were encountered: