feat(mcp): Update to MCP SDK 0.8.0-SNAPSHOT and fix client initialization

- Make MCP client initialization blocking with .block() call
- Upgrade MCP SDK version from 0.7.0 to 0.8.0-SNAPSHOT

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov
2025-03-10 11:39:11 +01:00
committed by Ilayaperumal Gopinathan
parent 206b9e220a
commit 72bb5ca296
3 changed files with 5 additions and 4 deletions

View File

@@ -268,7 +268,7 @@ public class McpClientAutoConfiguration {
var syncClient = syncSpec.build();
if (commonProperties.isInitialized()) {
syncClient.initialize();
syncClient.initialize().block();
}
mcpSyncClients.add(syncClient);

View File

@@ -142,8 +142,9 @@ public final class McpToolUtils {
try {
String callResult = toolCallback.call(ModelOptionsUtils.toJsonString(request));
if (mimeType != null && mimeType.toString().startsWith("image")) {
return new McpSchema.CallToolResult(List.of(new McpSchema.ImageContent(List.of(Role.ASSISTANT),
null, "image", callResult, mimeType.toString())), false);
return new McpSchema.CallToolResult(List
.of(new McpSchema.ImageContent(List.of(Role.ASSISTANT), null, callResult, mimeType.toString())),
false);
}
return new McpSchema.CallToolResult(List.of(new McpSchema.TextContent(callResult)), false);
}

View File

@@ -239,7 +239,7 @@
<okhttp3.version>4.12.0</okhttp3.version>
<!-- MCP-->
<mcp.sdk.version>0.7.0</mcp.sdk.version>
<mcp.sdk.version>0.8.0-SNAPSHOT</mcp.sdk.version>
<!-- plugin versions -->
<antlr.version>4.13.1</antlr.version>