Class SseWebFluxTransportAutoConfiguration
java.lang.Object
org.springframework.ai.mcp.client.autoconfigure.SseWebFluxTransportAutoConfiguration
@AutoConfiguration
@ConditionalOnClass(io.modelcontextprotocol.client.transport.WebFluxSseClientTransport.class)
@EnableConfigurationProperties({McpSseClientProperties.class,McpClientCommonProperties.class})
@ConditionalOnProperty(prefix="spring.ai.mcp.client",
name="enabled",
havingValue="true",
matchIfMissing=true)
public class SseWebFluxTransportAutoConfiguration
extends Object
Auto-configuration for WebFlux-based Server-Sent Events (SSE) client transport in the
Model Context Protocol (MCP).
This configuration class sets up the necessary beans for SSE-based WebFlux transport, providing reactive transport implementation for MCP client communication when WebFlux is available on the classpath.
Key features:
- Creates WebFlux-based SSE transports for configured MCP server connections
- Configures WebClient.Builder for HTTP client operations
- Sets up ObjectMapper for JSON serialization/deserialization
- Supports multiple named server connections with different base URLs
- See Also:
-
WebFluxSseClientTransport
McpSseClientProperties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwebFluxClientTransports
(McpSseClientProperties sseProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.web.reactive.function.client.WebClient.Builder> webClientBuilderProvider, org.springframework.beans.factory.ObjectProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapperProvider) Creates a list of WebFlux-based SSE transports for MCP communication.
-
Constructor Details
-
SseWebFluxTransportAutoConfiguration
public SseWebFluxTransportAutoConfiguration()
-
-
Method Details
-
webFluxClientTransports
@Bean public List<NamedClientMcpTransport> webFluxClientTransports(McpSseClientProperties sseProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.web.reactive.function.client.WebClient.Builder> webClientBuilderProvider, org.springframework.beans.factory.ObjectProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapperProvider) Creates a list of WebFlux-based SSE transports for MCP communication.Each transport is configured with:
- A cloned WebClient.Builder with server-specific base URL
- ObjectMapper for JSON processing
- Server connection parameters from properties
- Parameters:
sseProperties
- the SSE client properties containing server configurationswebClientBuilderProvider
- the provider for WebClient.BuilderobjectMapperProvider
- the provider for ObjectMapper or a new instance if not available- Returns:
- list of named MCP transports
-