Class MpcStdioClientAutoConfiguration

java.lang.Object
org.springframework.ai.autoconfigure.mcp.client.stdio.MpcStdioClientAutoConfiguration

@AutoConfiguration @ConditionalOnClass({io.modelcontextprotocol.spec.McpSchema.class,io.modelcontextprotocol.client.McpSyncClient.class}) @EnableConfigurationProperties(McpStdioClientProperties.class) @ConditionalOnProperty(prefix="spring.ai.mcp.client.stdio", name="enabled", havingValue="true") public class MpcStdioClientAutoConfiguration extends Object
Auto-configuration for Model Context Protocol (MCP) STDIO clients.

This configuration is responsible for setting up MCP clients that communicate with MCP servers through standard input/output (STDIO). It creates and configures McpSyncClient instances based on the provided configuration properties.

The configuration is conditionally enabled when:

  • Required classes (McpSchema and McpSyncClient) are present on the classpath
  • The 'spring.ai.mcp.client.stdio.enabled' property is set to 'true'

This auto-configuration provides:

  • A List<McpSyncClient> bean configured for STDIO communication
  • A McpSyncClientConfigurer bean for customizing the MCP sync client configuration
  • A List<ToolCallback> bean containing tool callbacks from the MCP clients
Since:
1.0.0
Author:
Christian Tzolov
See Also: