Skip to content

Commit 0fef925

Browse files
committed
Fix protocol check
1 parent 076c214 commit 0fef925

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/spring/ai/mcp/client/McpAsyncClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Mono<McpSchema.InitializeResult> initialize() {
5757
this.sendRequest("initialize", initializeRequest, new TypeReference<McpSchema.InitializeResult>() {});
5858

5959
return result.flatMap(initializeResult -> {
60-
if (initializeResult.protocolVersion() != McpSchema.LATEST_PROTOCOL_VERSION) {
60+
if (!McpSchema.LATEST_PROTOCOL_VERSION.equals(initializeResult.protocolVersion())) {
6161
return Mono.error(
6262
new McpError("Unsupported protocol version from the server: "
6363
+ initializeResult.protocolVersion()));

0 commit comments

Comments
 (0)