Skip to content

Commit 72bb5ca

Browse files
tzolovilayaperumalg
authored andcommitted
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 <[email protected]>
1 parent 206b9e2 commit 72bb5ca

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

auto-configurations/spring-ai-mcp-client/src/main/java/org/springframework/ai/autoconfigure/mcp/client/McpClientAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpSyncClie
268268
var syncClient = syncSpec.build();
269269

270270
if (commonProperties.isInitialized()) {
271-
syncClient.initialize();
271+
syncClient.initialize().block();
272272
}
273273

274274
mcpSyncClients.add(syncClient);

mcp/common/src/main/java/org/springframework/ai/mcp/McpToolUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ public static McpServerFeatures.SyncToolRegistration toSyncToolRegistration(Tool
142142
try {
143143
String callResult = toolCallback.call(ModelOptionsUtils.toJsonString(request));
144144
if (mimeType != null && mimeType.toString().startsWith("image")) {
145-
return new McpSchema.CallToolResult(List.of(new McpSchema.ImageContent(List.of(Role.ASSISTANT),
146-
null, "image", callResult, mimeType.toString())), false);
145+
return new McpSchema.CallToolResult(List
146+
.of(new McpSchema.ImageContent(List.of(Role.ASSISTANT), null, callResult, mimeType.toString())),
147+
false);
147148
}
148149
return new McpSchema.CallToolResult(List.of(new McpSchema.TextContent(callResult)), false);
149150
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
<okhttp3.version>4.12.0</okhttp3.version>
240240

241241
<!-- MCP-->
242-
<mcp.sdk.version>0.7.0</mcp.sdk.version>
242+
<mcp.sdk.version>0.8.0-SNAPSHOT</mcp.sdk.version>
243243

244244
<!-- plugin versions -->
245245
<antlr.version>4.13.1</antlr.version>

0 commit comments

Comments
 (0)