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:
parent
5ed6063a07
commit
ef8399c1cb
4 changed files with 43 additions and 22 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue