feat: add MCP protocol version 2025-06-18 support for streamable-http and stateless transports (#558)
- Set MCP_2025_06_18 as upper supported protocol version for streamable-http and stateless transport - Update LATEST_PROTOCOL_VERSION constant to reflect new upper bound - Update test expectations for new protocol version usage Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
parent
8ac7eae47c
commit
8159bcbb05
5 changed files with 16 additions and 11 deletions
|
|
@ -77,7 +77,7 @@ public class HttpClientStreamableHttpTransport implements McpClientTransport {
|
|||
|
||||
private static final Logger logger = LoggerFactory.getLogger(HttpClientStreamableHttpTransport.class);
|
||||
|
||||
private static final String MCP_PROTOCOL_VERSION = ProtocolVersions.MCP_2025_03_26;
|
||||
private static final String MCP_PROTOCOL_VERSION = ProtocolVersions.MCP_2025_06_18;
|
||||
|
||||
private static final String DEFAULT_ENDPOINT = "/mcp";
|
||||
|
||||
|
|
@ -140,7 +140,8 @@ public class HttpClientStreamableHttpTransport implements McpClientTransport {
|
|||
|
||||
@Override
|
||||
public List<String> protocolVersions() {
|
||||
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26);
|
||||
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26,
|
||||
ProtocolVersions.MCP_2025_06_18);
|
||||
}
|
||||
|
||||
public static Builder builder(String baseUri) {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,8 @@ public class HttpServletStreamableServerTransportProvider extends HttpServlet
|
|||
|
||||
@Override
|
||||
public List<String> protocolVersions() {
|
||||
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26);
|
||||
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26,
|
||||
ProtocolVersions.MCP_2025_06_18);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public final class McpSchema {
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
public static final String LATEST_PROTOCOL_VERSION = ProtocolVersions.MCP_2025_03_26;
|
||||
public static final String LATEST_PROTOCOL_VERSION = ProtocolVersions.MCP_2025_06_18;
|
||||
|
||||
public static final String JSONRPC_VERSION = "2.0";
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public interface McpStatelessServerTransport {
|
|||
Mono<Void> closeGracefully();
|
||||
|
||||
default List<String> protocolVersions() {
|
||||
return List.of(ProtocolVersions.MCP_2025_03_26);
|
||||
return List.of(ProtocolVersions.MCP_2025_03_26, ProtocolVersions.MCP_2025_06_18);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class HttpClientStreamableHttpTransportTest {
|
|||
|
||||
// Verify the customizer was called
|
||||
verify(mockRequestCustomizer, atLeastOnce()).customize(any(), eq("POST"), eq(uri), eq(
|
||||
"{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"id\":\"test-id\",\"params\":{\"protocolVersion\":\"2025-03-26\",\"capabilities\":{\"roots\":{\"listChanged\":true}},\"clientInfo\":{\"name\":\"Spring AI MCP Client\",\"version\":\"0.3.1\"}}}"),
|
||||
"{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"id\":\"test-id\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{\"roots\":{\"listChanged\":true}},\"clientInfo\":{\"name\":\"Spring AI MCP Client\",\"version\":\"0.3.1\"}}}"),
|
||||
eq(context));
|
||||
});
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ class HttpClientStreamableHttpTransportTest {
|
|||
|
||||
// Verify the customizer was called
|
||||
verify(mockRequestCustomizer, atLeastOnce()).customize(any(), eq("POST"), eq(uri), eq(
|
||||
"{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"id\":\"test-id\",\"params\":{\"protocolVersion\":\"2025-03-26\",\"capabilities\":{\"roots\":{\"listChanged\":true}},\"clientInfo\":{\"name\":\"Spring AI MCP Client\",\"version\":\"0.3.1\"}}}"),
|
||||
"{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"id\":\"test-id\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{\"roots\":{\"listChanged\":true}},\"clientInfo\":{\"name\":\"Spring AI MCP Client\",\"version\":\"0.3.1\"}}}"),
|
||||
eq(context));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue