Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,19 @@ public List<McpSyncClient> mcpSyncClients(McpSyncClientConfigurer mcpSyncClientC
this.connectedClientName(commonProperties.getName(), namedTransport.name()),
commonProperties.getVersion());

McpClient.SyncSpec syncSpec = McpClient.sync(namedTransport.transport())
McpClient.SyncSpec spec = McpClient.sync(namedTransport.transport())
.clientInfo(clientInfo)
.requestTimeout(commonProperties.getRequestTimeout());

syncSpec = mcpSyncClientConfigurer.configure(namedTransport.name(), syncSpec);
spec = mcpSyncClientConfigurer.configure(namedTransport.name(), spec);

var syncClient = syncSpec.build();
var client = spec.build();

if (commonProperties.isInitialized()) {
syncClient.initialize();
client.initialize();
}

mcpSyncClients.add(syncClient);
mcpSyncClients.add(client);
}
}

Expand Down Expand Up @@ -212,7 +212,7 @@ public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpSyncClie
McpClientCommonProperties commonProperties,
ObjectProvider<List<NamedClientMcpTransport>> transportsProvider) {

List<McpAsyncClient> mcpSyncClients = new ArrayList<>();
List<McpAsyncClient> mcpAsyncClients = new ArrayList<>();

List<NamedClientMcpTransport> namedTransports = transportsProvider.stream().flatMap(List::stream).toList();

Expand All @@ -223,23 +223,23 @@ public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpSyncClie
this.connectedClientName(commonProperties.getName(), namedTransport.name()),
commonProperties.getVersion());

McpClient.AsyncSpec syncSpec = McpClient.async(namedTransport.transport())
McpClient.AsyncSpec spec = McpClient.async(namedTransport.transport())
.clientInfo(clientInfo)
.requestTimeout(commonProperties.getRequestTimeout());

syncSpec = mcpSyncClientConfigurer.configure(namedTransport.name(), syncSpec);
spec = mcpSyncClientConfigurer.configure(namedTransport.name(), spec);

var syncClient = syncSpec.build();
var client = spec.build();

if (commonProperties.isInitialized()) {
syncClient.initialize().block();
client.initialize().block();
}

mcpSyncClients.add(syncClient);
mcpAsyncClients.add(client);
}
}

return mcpSyncClients;
return mcpAsyncClients;
}

@Bean
Expand Down