Class WebFluxStreamableServerTransportProvider
java.lang.Object
io.modelcontextprotocol.server.transport.WebFluxStreamableServerTransportProvider
- All Implemented Interfaces:
io.modelcontextprotocol.spec.McpServerTransportProviderBase,io.modelcontextprotocol.spec.McpStreamableServerTransportProvider
public class WebFluxStreamableServerTransportProvider
extends Object
implements io.modelcontextprotocol.spec.McpStreamableServerTransportProvider
Implementation of a WebFlux based
McpStreamableServerTransportProvider.- Author:
- Dariusz Jędrzejczyk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creating instances ofWebFluxStreamableServerTransportProvider. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()reactor.core.publisher.Mono<Void>org.springframework.web.reactive.function.server.RouterFunction<?>Returns the WebFlux router function that defines the transport's HTTP endpoints.reactor.core.publisher.Mono<Void>notifyClients(String method, Object params) voidsetSessionFactory(io.modelcontextprotocol.spec.McpStreamableServerSession.Factory sessionFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.modelcontextprotocol.spec.McpStreamableServerTransportProvider
close
-
Field Details
-
MESSAGE_EVENT_TYPE
- See Also:
-
-
Method Details
-
protocolVersions
- Specified by:
protocolVersionsin interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase
-
setSessionFactory
public void setSessionFactory(io.modelcontextprotocol.spec.McpStreamableServerSession.Factory sessionFactory) - Specified by:
setSessionFactoryin interfaceio.modelcontextprotocol.spec.McpStreamableServerTransportProvider
-
notifyClients
- Specified by:
notifyClientsin interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase- Specified by:
notifyClientsin interfaceio.modelcontextprotocol.spec.McpStreamableServerTransportProvider
-
closeGracefully
- Specified by:
closeGracefullyin interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase- Specified by:
closeGracefullyin interfaceio.modelcontextprotocol.spec.McpStreamableServerTransportProvider
-
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 with three methods:
- GET {messageEndpoint} - For the client listening SSE stream
- POST {messageEndpoint} - For receiving client messages
- DELETE {messageEndpoint} - For removing sessions
- Returns:
- The configured
RouterFunctionfor handling HTTP requests
-
builder
-