java-sdk/mcp-spring/mcp-spring-webmvc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sébastien Deleuze e60a0743a5
Refine McpJsonDefaults method names (#789)
As a follow-up of #779, this commit refines McpJsonDefaults
method names by shortening them to not repeat the qualifiers
already expressed at type level.
2026-02-13 16:54:01 +01:00
..
src Refine McpJsonDefaults method names (#789) 2026-02-13 16:54:01 +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();
    }
}