+ <>
+
+ Creates a Servlet-based SSE server transport. It is included in the core mcp module.
+ The HttpServletSseServerTransport can be used with any Servlet container.
+ To use it with a Spring Web application, you can register it as a Servlet bean:
+
+
+ ```java
+ @Configuration
+ @EnableWebMvc
+ public class McpServerConfig implements WebMvcConfigurer {
+
+ @Bean
+ public HttpServletSseServerTransport servletSseServerTransport() {
+ return new HttpServletSseServerTransport(new ObjectMapper(), "/mcp/message");
+ }
+
+ @Bean
+ public ServletRegistrationBean customServletBean(HttpServletSseServerTransport servlet) {
+ return new ServletRegistrationBean(servlet);
+ }
+ }
+ ```
+
+
+ Implements the MCP HTTP with SSE transport specification using the traditional Servlet API, providing:
+
+
+ - Asynchronous message handling using Servlet 6.0 async support
+ - Session management for multiple client connections
+ -
+ Two types of endpoints:
+
+ - SSE endpoint (
/sse) for server-to-client events
+ - Message endpoint (configurable) for client-to-server requests
+
+
+ - Error handling and response formatting
+ - Graceful shutdown support
+
+ >
+
+
+