Class WebFluxStatelessServerTransport
java.lang.Object
io.modelcontextprotocol.server.transport.WebFluxStatelessServerTransport
- All Implemented Interfaces:
McpStatelessServerTransport
Implementation of a WebFlux based
McpStatelessServerTransport.- Author:
- Dariusz Jędrzejczyk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creating instances ofWebFluxStatelessServerTransport. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a builder for the server.reactor.core.publisher.Mono<Void>org.springframework.web.reactive.function.server.RouterFunction<?>Returns the WebFlux router function that defines the transport's HTTP endpoints.voidsetMcpHandler(McpStatelessServerHandler mcpHandler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.modelcontextprotocol.spec.McpStatelessServerTransport
close, protocolVersion
-
Method Details
-
setMcpHandler
- Specified by:
setMcpHandlerin interfaceMcpStatelessServerTransport
-
closeGracefully
- Specified by:
closeGracefullyin interfaceMcpStatelessServerTransport
-
getRouterFunction
public org.springframework.web.reactive.function.server.RouterFunction<?> getRouterFunction()Returns the WebFlux router function that defines the transport's HTTP endpoints. This router function should be integrated into the application's web configuration.The router function defines one endpoint handling two HTTP methods:
- GET {messageEndpoint} - Unsupported, returns 405 METHOD NOT ALLOWED
- POST {messageEndpoint} - For handling client requests and notifications
- Returns:
- The configured
RouterFunctionfor handling HTTP requests
-
builder
Create a builder for the server.- Returns:
- a fresh
WebFluxStatelessServerTransport.Builderinstance.
-