Skip to content

Fix typos in mcp client module #2641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -224,11 +224,11 @@ McpSyncClientConfigurer mcpSyncClientConfigurer(ObjectProvider<McpSyncClientCust

@Bean
@ConditionalOnProperty(prefix = McpClientCommonProperties.CONFIG_PREFIX, name = "type", havingValue = "ASYNC")
public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpSyncClientConfigurer,
public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpAsyncClientConfigurer,
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 @@ -239,23 +239,23 @@ public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpSyncClie
this.connectedClientName(commonProperties.getName(), namedTransport.name()),
commonProperties.getVersion());

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

syncSpec = mcpSyncClientConfigurer.configure(namedTransport.name(), syncSpec);
asyncSpec = mcpAsyncClientConfigurer.configure(namedTransport.name(), asyncSpec);

var syncClient = syncSpec.build();
var asyncClient = asyncSpec.build();

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

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

return mcpSyncClients;
return mcpAsyncClients;
}

public record CloseableMcpAsyncClients(List<McpAsyncClient> clients) implements AutoCloseable {
Expand All @@ -267,7 +267,7 @@ public void close() {

@Bean
@ConditionalOnProperty(prefix = McpClientCommonProperties.CONFIG_PREFIX, name = "type", havingValue = "ASYNC")
public CloseableMcpAsyncClients makeAsynClientsClosable(List<McpAsyncClient> clients) {
public CloseableMcpAsyncClients makeAsyncClientsClosable(List<McpAsyncClient> clients) {
return new CloseableMcpAsyncClients(clients);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ public class StdioTransportAutoConfiguration {
* <li>Server-specific parameters from properties
* <li>Unique connection name for identification
* </ul>
* @param sdioProperties the stdio client properties containing server configurations
* @param stdioProperties the stdio client properties containing server configurations
* @return list of named MCP transports
*/
@Bean
public List<NamedClientMcpTransport> stdioTransports(McpStdioClientProperties sdioProperties) {
public List<NamedClientMcpTransport> stdioTransports(McpStdioClientProperties stdioProperties) {

List<NamedClientMcpTransport> stdoiTransports = new ArrayList<>();
List<NamedClientMcpTransport> stdioTransports = new ArrayList<>();

for (Map.Entry<String, ServerParameters> serverParameters : sdioProperties.toServerParameters().entrySet()) {
for (Map.Entry<String, ServerParameters> serverParameters : stdioProperties.toServerParameters().entrySet()) {
var transport = new StdioClientTransport(serverParameters.getValue());
stdoiTransports.add(new NamedClientMcpTransport(serverParameters.getKey(), transport));
stdioTransports.add(new NamedClientMcpTransport(serverParameters.getKey(), transport));

}

return stdoiTransports;
return stdioTransports;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class McpAsyncClientConfigurer {

private List<McpAsyncClientCustomizer> customizers;
private final List<McpAsyncClientCustomizer> customizers;

public McpAsyncClientConfigurer(List<McpAsyncClientCustomizer> customizers) {
this.customizers = customizers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
public class McpSyncClientConfigurer {

private List<McpSyncClientCustomizer> customizers;
private final List<McpSyncClientCustomizer> customizers;

public McpSyncClientConfigurer(List<McpSyncClientCustomizer> customizers) {
this.customizers = customizers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class McpToolCallbackAutoConfigurationTests {
.withConfiguration(AutoConfigurations.of(McpToolCallbackAutoConfiguration.class));

@Test
void disabledByDeafault() {
void disabledByDefault() {

this.applicationContext.run((context) -> {
assertThat(context).doesNotHaveBean("mcpToolCallbacks");
Expand Down