Module and Package restructoring
- 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
This commit is contained in:
parent
7e73152ada
commit
585f30cf33
1 changed files with 51 additions and 133 deletions
29
mcp-spring/mcp-spring-webmvc/README.md
Normal file
29
mcp-spring/mcp-spring-webmvc/README.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# 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();
|
||||
}
|
||||
}
|
||||
```
|
||||
Loading…
Reference in a new issue