public class StdioServerTransportProvider extends Object implements McpServerTransportProvider
| Modifier and Type | Class and Description |
|---|---|
class |
StdioServerTransportProvider.StdioMcpSessionTransport
Implementation of McpServerTransport for the stdio session.
|
| Constructor and Description |
|---|
StdioServerTransportProvider()
Creates a new StdioServerTransportProvider with a default ObjectMapper and System
streams.
|
StdioServerTransportProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Creates a new StdioServerTransportProvider with the specified ObjectMapper and
System streams.
|
StdioServerTransportProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
InputStream inputStream,
OutputStream outputStream)
Creates a new StdioServerTransportProvider with the specified ObjectMapper and
streams.
|
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<Void> |
closeGracefully()
Gracefully closes all the transports with connected clients and releases any
associated resources asynchronously.
|
reactor.core.publisher.Mono<Void> |
notifyClients(String method,
Map<String,Object> params)
Sends a notification to all connected clients.
|
void |
setSessionFactory(McpServerSession.Factory sessionFactory)
Sets the session factory that will be used to create sessions for new clients.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic StdioServerTransportProvider()
public StdioServerTransportProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
objectMapper - The ObjectMapper to use for JSON serialization/deserializationpublic StdioServerTransportProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
InputStream inputStream,
OutputStream outputStream)
objectMapper - The ObjectMapper to use for JSON serialization/deserializationinputStream - The input stream to read fromoutputStream - The output stream to write topublic void setSessionFactory(McpServerSession.Factory sessionFactory)
McpServerTransportProvidersetSessionFactory in interface McpServerTransportProvidersessionFactory - the session factory to be used for initiating client sessionspublic reactor.core.publisher.Mono<Void> notifyClients(String method, Map<String,Object> params)
McpServerTransportProvidernotifyClients in interface McpServerTransportProvidermethod - the name of the notification method to be called on the clientsparams - a map of parameters to be sent with the notificationMcpSession.sendNotification(String, Map)public reactor.core.publisher.Mono<Void> closeGracefully()
McpServerTransportProvidercloseGracefully in interface McpServerTransportProviderMono that completes when the connections have been closed.Copyright © 2025. All rights reserved.