Compare commits

...
Author SHA1 Message Date
Christian Tzolov
cb1578e9aa Release version 0.8.1
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-26 12:19:01 +01:00
Christian Tzolov
96e6d9cc15 refactor(server): Fi StdioServerTransportProvider initialization flow (#74)
Extract message processing initialization from StdioMcpSessionTransport constructor into a
separate initProcessing() method.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-26 12:10:52 +01:00
Christian Tzolov
d7177f15a3 Next development version
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-21 17:34:55 +01:00
Christian Tzolov
7be502fb6c Release version 0.8.0
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-21 17:34:29 +01:00
7 changed files with 20 additions and 16 deletions

View file

@ -7,7 +7,7 @@
<parent>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
</parent>
<artifactId>mcp-bom</artifactId>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>mcp-spring-webflux</artifactId>
@ -25,13 +25,13 @@
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
</dependency>
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-test</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
<scope>test</scope>
</dependency>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>mcp-spring-webmvc</artifactId>
@ -25,13 +25,13 @@
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
</dependency>
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-test</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
<scope>test</scope>
</dependency>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
</parent>
<artifactId>mcp-test</artifactId>
<packaging>jar</packaging>
@ -24,7 +24,7 @@
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
</dependency>
<dependency>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
</parent>
<artifactId>mcp</artifactId>
<packaging>jar</packaging>

View file

@ -93,7 +93,9 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
@Override
public void setSessionFactory(McpServerSession.Factory sessionFactory) {
// Create a single session for the stdio connection
this.session = sessionFactory.create(new StdioMcpSessionTransport());
var transport = new StdioMcpSessionTransport();
this.session = sessionFactory.create(transport);
transport.initProcessing();
}
@Override
@ -142,10 +144,6 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
"stdio-inbound");
this.outboundScheduler = Schedulers.fromExecutorService(Executors.newSingleThreadExecutor(),
"stdio-outbound");
handleIncomingMessages();
startInboundProcessing();
startOutboundProcessing();
}
@Override
@ -181,6 +179,12 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
logger.debug("Session transport closed");
}
private void initProcessing() {
handleIncomingMessages();
startInboundProcessing();
startOutboundProcessing();
}
private void handleIncomingMessages() {
this.inboundSink.asFlux().flatMap(message -> session.handle(message)).doOnTerminate(() -> {
// The outbound processing will dispose its scheduler upon completion

View file

@ -6,7 +6,7 @@
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.1</version>
<packaging>pom</packaging>
<url>https://github.com/modelcontextprotocol/java-sdk</url>