Class WebFluxStreamableServerTransportProvider
java.lang.Object
io.modelcontextprotocol.server.transport.WebFluxStreamableServerTransportProvider
- All Implemented Interfaces:
McpServerTransportProviderBase,McpStreamableServerTransportProvider
public class WebFluxStreamableServerTransportProvider
extends Object
implements 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(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
-
protocolVersion
- Specified by:
protocolVersionin interfaceMcpServerTransportProviderBase
-
setSessionFactory
- Specified by:
setSessionFactoryin interfaceMcpStreamableServerTransportProvider
-
notifyClients
- Specified by:
notifyClientsin interfaceMcpServerTransportProviderBase- Specified by:
notifyClientsin interfaceMcpStreamableServerTransportProvider
-
closeGracefully
- Specified by:
closeGracefullyin interfaceMcpServerTransportProviderBase- Specified by:
closeGracefullyin interfaceMcpStreamableServerTransportProvider
-
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
-