Class McpServerSseWebMvcAutoConfiguration

java.lang.Object
org.springframework.ai.mcp.server.webmvc.autoconfigure.McpServerSseWebMvcAutoConfiguration

@AutoConfiguration(before=org.springframework.ai.mcp.server.common.autoconfigure.McpServerAutoConfiguration.class) @EnableConfigurationProperties(org.springframework.ai.mcp.server.common.autoconfigure.properties.McpServerSseProperties.class) @ConditionalOnClass(org.springframework.ai.mcp.server.webmvc.transport.WebMvcSseServerTransportProvider.class) @ConditionalOnMissingBean(io.modelcontextprotocol.spec.McpServerTransportProvider.class) @Conditional({org.springframework.ai.mcp.server.common.autoconfigure.McpServerStdioDisabledCondition.class,org.springframework.ai.mcp.server.common.autoconfigure.McpServerAutoConfiguration.EnabledSseServerCondition.class}) @Deprecated(since="2.0.0", forRemoval=true) public class McpServerSseWebMvcAutoConfiguration extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Auto-configuration for MCP WebMvc Server Transport.

This configuration class sets up the WebMvc-specific transport components for the MCP server, providing Server-Sent Events (SSE) communication through Spring MVC. It is activated when:

  • The WebMvcSseServerTransport class is on the classpath (from mcp-spring-webmvc dependency)
  • Spring MVC's RouterFunction class is available (from spring-boot-starter-web)
  • The spring.ai.mcp.server.transport property is set to WEBMVC

The configuration provides:

  • A WebMvcSseServerTransport bean for handling SSE communication
  • A RouterFunction bean that sets up the SSE endpoint

Required dependencies:


 <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-web</artifactId>
 </dependency>
 
Since:
1.0.0
Author:
Christian Tzolov, Yanming Zhou
See Also:
  • McpServerSseProperties
  • WebMvcSseServerTransportProvider
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.web.servlet.function.RouterFunction<org.springframework.web.servlet.function.ServerResponse>
    webMvcSseServerRouterFunction(org.springframework.ai.mcp.server.webmvc.transport.WebMvcSseServerTransportProvider transportProvider)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    org.springframework.ai.mcp.server.webmvc.transport.WebMvcSseServerTransportProvider
    webMvcSseServerTransportProvider(tools.jackson.databind.json.JsonMapper jsonMapper, org.springframework.ai.mcp.server.common.autoconfigure.properties.McpServerSseProperties serverProperties)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • McpServerSseWebMvcAutoConfiguration

      public McpServerSseWebMvcAutoConfiguration()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • webMvcSseServerTransportProvider

      @Bean @ConditionalOnMissingBean public org.springframework.ai.mcp.server.webmvc.transport.WebMvcSseServerTransportProvider webMvcSseServerTransportProvider(@Qualifier("mcpServerJsonMapper") tools.jackson.databind.json.JsonMapper jsonMapper, org.springframework.ai.mcp.server.common.autoconfigure.properties.McpServerSseProperties serverProperties)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • webMvcSseServerRouterFunction

      @Bean @ConditionalOnMissingBean(name="webMvcSseServerRouterFunction") public org.springframework.web.servlet.function.RouterFunction<org.springframework.web.servlet.function.ServerResponse> webMvcSseServerRouterFunction(org.springframework.ai.mcp.server.webmvc.transport.WebMvcSseServerTransportProvider transportProvider)
      Deprecated, for removal: This API element is subject to removal in a future version.