- 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
29 lines
603 B
Markdown
29 lines
603 B
Markdown
# WebMVC SSE Server Transport
|
|
|
|
```xml
|
|
<dependency>
|
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
|
<artifactId>mcp-spring-webmvc</artifactId>
|
|
</dependency>
|
|
```
|
|
|
|
|
|
|
|
```java
|
|
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();
|
|
}
|
|
}
|
|
```
|