- mcp-transport -> mcp-spring - mcp-webflux-sse-transport -> mcp-spring-webflux - pom coordinates changed accordingly - mpc-webmvc-sse-transport -> mcp-spring-webmvc - pom coordinates changed accordingly - docs contains the mdx version of the documentation
603 B
603 B
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();
}
}