java-sdk/mcp-spring/mcp-spring-webmvc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Garnier-Moiroux f6c3fde7f4 DNS rebinding protection: check host header
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
2026-02-12 11:00:42 +01:00
..
src DNS rebinding protection: check host header 2026-02-12 11:00:42 +01:00
pom.xml Decouple mcp-test and mcp-spring modules from Jackson implementation (#760) 2026-01-27 15:47:28 +01:00
README.md Module and Package restructoring 2025-01-29 13:40:53 +01:00

WebMVC SSE Server Transport

<dependency>
    <groupId>io.modelcontextprotocol.sdk</groupId>
    <artifactId>mcp-spring-webmvc</artifactId>
</dependency>
String MESSAGE_ENDPOINT = "/mcp/message";

@Configuration
@EnableWebMvc
static class MyConfig {

    @Bean
    public WebMvcSseServerTransport webMvcSseServerTransport() {
        return new WebMvcSseServerTransport(new ObjectMapper(), MESSAGE_ENDPOINT);
    }

    @Bean
    public RouterFunction<ServerResponse> routerFunction(WebMvcSseServerTransport transport) {
        return transport.getRouterFunction();
    }
}