Package ch.so.agi.mcp.transport
Class SerializedStdioServerTransportProvider
java.lang.Object
ch.so.agi.mcp.transport.SerializedStdioServerTransportProvider
- All Implemented Interfaces:
io.modelcontextprotocol.spec.McpServerTransportProvider,io.modelcontextprotocol.spec.McpServerTransportProviderBase,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public final class SerializedStdioServerTransportProvider
extends Object
implements io.modelcontextprotocol.spec.McpServerTransportProvider, org.springframework.context.ApplicationContextAware
STDIO transport with a single writer queue.
The upstream SDK transport processes inbound messages concurrently but attempts to enqueue concurrent responses through a Reactor unicast sink. A dedicated FIFO queue makes the single-writer requirement explicit while preserving concurrent request handling.
-
Constructor Summary
ConstructorsConstructorDescriptionSerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper) SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper, boolean shutdownApplicationOnEof) SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper, InputStream inputStream, OutputStream outputStream) SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper, InputStream inputStream, OutputStream outputStream, boolean shutdownApplicationOnEof) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()reactor.core.publisher.Mono<Void> reactor.core.publisher.Mono<Void> notifyClient(String sessionId, String method, Object params) reactor.core.publisher.Mono<Void> notifyClients(String method, Object params) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetSessionFactory(io.modelcontextprotocol.spec.McpServerSession.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.McpServerTransportProviderBase
protocolVersions
-
Constructor Details
-
SerializedStdioServerTransportProvider
public SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper) -
SerializedStdioServerTransportProvider
public SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper, InputStream inputStream, OutputStream outputStream) -
SerializedStdioServerTransportProvider
public SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper, boolean shutdownApplicationOnEof) -
SerializedStdioServerTransportProvider
public SerializedStdioServerTransportProvider(io.modelcontextprotocol.json.McpJsonMapper jsonMapper, InputStream inputStream, OutputStream outputStream, boolean shutdownApplicationOnEof)
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
setSessionFactory
public void setSessionFactory(io.modelcontextprotocol.spec.McpServerSession.Factory sessionFactory) - Specified by:
setSessionFactoryin interfaceio.modelcontextprotocol.spec.McpServerTransportProvider
-
notifyClients
- Specified by:
notifyClientsin interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase
-
notifyClient
public reactor.core.publisher.Mono<Void> notifyClient(String sessionId, String method, Object params) - Specified by:
notifyClientin interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase
-
closeGracefully
- Specified by:
closeGracefullyin interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase
-
close
public void close()- Specified by:
closein interfaceio.modelcontextprotocol.spec.McpServerTransportProviderBase
-