You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Move markInitialized() and reconnect() after status code check
When connecting to an MCP server that doesn't support Streamable HTTP
transport (returns 405 Method Not Allowed), the transports still called
markInitialized() and reconnect() before checking the status code,
which triggered unnecessary GET requests.
This caused issues when using transport fallback (Streamable HTTP → SSE),
as duplicate SSE sessions were created on the upstream server.
This fix moves markInitialized() and reconnect() inside the success
status code check (2xx), so they are only called for successful responses.
Fixes#773
Related to #362
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -310,18 +310,19 @@ public Mono<Void> sendMessage(McpSchema.JSONRPCMessage message) {
0 commit comments