feat: broadcast 2025-11-25 as latest supported client version (#758)

* feat: broadcast 2025-11-25 as latest supported client version
* fix: ignore empty SSE events
This commit is contained in:
Luca Chang 2026-02-06 01:55:37 -08:00 • committed by GitHub
commit ef8399c1cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 22 deletions

View file

@ -518,7 +518,7 @@ public class WebClientStreamableHttpTransport implements McpClientTransport {
private boolean openConnectionOnStartup = false;
private List<String> supportedProtocolVersions = List.of(ProtocolVersions.MCP_2024_11_05,
ProtocolVersions.MCP_2025_03_26, ProtocolVersions.MCP_2025_06_18);
ProtocolVersions.MCP_2025_03_26, ProtocolVersions.MCP_2025_06_18, ProtocolVersions.MCP_2025_11_25);
private Builder(WebClient.Builder webClientBuilder) {
Assert.notNull(webClientBuilder, "WebClient.Builder must not be null");

View file

@ -106,7 +106,7 @@ public class WebFluxStreamableServerTransportProvider implements McpStreamableSe
@Override
public List<String> protocolVersions() {
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26,
ProtocolVersions.MCP_2025_06_18);
ProtocolVersions.MCP_2025_06_18, ProtocolVersions.MCP_2025_11_25);
}
@Override

View file

@ -105,14 +105,14 @@ class WebFluxStreamableHttpVersionNegotiationIntegrationTests {
.hasSize(3)
.map(McpTestRequestRecordingExchangeFilterFunction.Call::headers)
.allSatisfy(headers -> assertThat(headers).containsEntry("mcp-protocol-version",
ProtocolVersions.MCP_2025_06_18));
ProtocolVersions.MCP_2025_11_25));
assertThat(response).isNotNull();
assertThat(response.content()).hasSize(1)
.first()
.extracting(McpSchema.TextContent.class::cast)
.extracting(McpSchema.TextContent::text)
.isEqualTo(ProtocolVersions.MCP_2025_06_18);
.isEqualTo(ProtocolVersions.MCP_2025_11_25);
mcpServer.close();
}
@ -120,7 +120,7 @@ class WebFluxStreamableHttpVersionNegotiationIntegrationTests {
void usesServerSupportedVersion() {
var transport = WebClientStreamableHttpTransport
.builder(WebClient.builder().baseUrl("http://localhost:" + PORT))
.supportedProtocolVersions(List.of(ProtocolVersions.MCP_2025_06_18, "2263-03-18"))
.supportedProtocolVersions(List.of(ProtocolVersions.MCP_2025_11_25, "2263-03-18"))
.build();
var client = McpClient.sync(transport).requestTimeout(Duration.ofHours(10)).build();
@ -137,14 +137,14 @@ class WebFluxStreamableHttpVersionNegotiationIntegrationTests {
.hasSize(2)
.map(McpTestRequestRecordingExchangeFilterFunction.Call::headers)
.allSatisfy(headers -> assertThat(headers).containsEntry("mcp-protocol-version",
ProtocolVersions.MCP_2025_06_18));
ProtocolVersions.MCP_2025_11_25));
assertThat(response).isNotNull();
assertThat(response.content()).hasSize(1)
.first()
.extracting(McpSchema.TextContent.class::cast)
.extracting(McpSchema.TextContent::text)
.isEqualTo(ProtocolVersions.MCP_2025_06_18);
.isEqualTo(ProtocolVersions.MCP_2025_11_25);
mcpServer.close();
}

View file

@ -157,7 +157,7 @@ public class WebMvcStreamableServerTransportProvider implements McpStreamableSer
@Override
public List<String> protocolVersions() {
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26,
ProtocolVersions.MCP_2025_06_18);
ProtocolVersions.MCP_2025_06_18, ProtocolVersions.MCP_2025_11_25);
}
@Override