Class McpServerSseWebFluxAutoConfiguration
java.lang.Object
org.springframework.ai.mcp.server.autoconfigure.McpServerSseWebFluxAutoConfiguration
@AutoConfiguration(before=McpServerAutoConfiguration.class)
@EnableConfigurationProperties(McpServerSseProperties.class)
@ConditionalOnClass(io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider.class)
@ConditionalOnMissingBean(io.modelcontextprotocol.spec.McpServerTransportProvider.class)
@Conditional({McpServerStdioDisabledCondition.class,EnabledSseServerCondition.class})
public class McpServerSseWebFluxAutoConfiguration
extends Object
Auto-configuration for MCP WebFlux Server Transport.
This configuration class sets up the WebFlux-specific transport components for the MCP server, providing reactive Server-Sent Events (SSE) communication through Spring WebFlux. It is activated when:
- The WebFluxSseServerTransportProvider class is on the classpath (from mcp-spring-webflux dependency)
- Spring WebFlux's RouterFunction class is available (from spring-boot-starter-webflux)
- The
spring.ai.mcp.server.transportproperty is set toWEBFLUX
The configuration provides:
- A WebFluxSseServerTransportProvider bean for handling reactive SSE communication
- A RouterFunction bean that sets up the reactive SSE endpoint
Required dependencies:
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-spring-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
- Since:
- 1.0.0
- Author:
- Christian Tzolov, Yanming Zhou
- See Also:
-
McpServerSsePropertiesWebFluxSseServerTransportProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.reactive.function.server.RouterFunction<?>webfluxSseServerRouterFunction(io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider webFluxProvider) io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProviderwebFluxTransport(com.fasterxml.jackson.databind.ObjectMapper objectMapper, McpServerSseProperties serverProperties)
-
Constructor Details
-
McpServerSseWebFluxAutoConfiguration
public McpServerSseWebFluxAutoConfiguration()
-
-
Method Details
-
webFluxTransport
@Bean @ConditionalOnMissingBean public io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider webFluxTransport(@Qualifier("mcpServerObjectMapper") com.fasterxml.jackson.databind.ObjectMapper objectMapper, McpServerSseProperties serverProperties) -
webfluxSseServerRouterFunction
@Bean @ConditionalOnMissingBean(name="webfluxSseServerRouterFunction") public org.springframework.web.reactive.function.server.RouterFunction<?> webfluxSseServerRouterFunction(io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider webFluxProvider)
-