Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb1578e9aa | ||
|
|
96e6d9cc15 | ||
|
|
d7177f15a3 | ||
|
|
7be502fb6c |
7 changed files with 20 additions and 16 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-parent</artifactId>
|
<artifactId>mcp-parent</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mcp-bom</artifactId>
|
<artifactId>mcp-bom</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-parent</artifactId>
|
<artifactId>mcp-parent</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>mcp-spring-webflux</artifactId>
|
<artifactId>mcp-spring-webflux</artifactId>
|
||||||
|
|
@ -25,13 +25,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp</artifactId>
|
<artifactId>mcp</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-test</artifactId>
|
<artifactId>mcp-test</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-parent</artifactId>
|
<artifactId>mcp-parent</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>mcp-spring-webmvc</artifactId>
|
<artifactId>mcp-spring-webmvc</artifactId>
|
||||||
|
|
@ -25,13 +25,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp</artifactId>
|
<artifactId>mcp</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-test</artifactId>
|
<artifactId>mcp-test</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-parent</artifactId>
|
<artifactId>mcp-parent</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>mcp-test</artifactId>
|
<artifactId>mcp-test</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp</artifactId>
|
<artifactId>mcp</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-parent</artifactId>
|
<artifactId>mcp-parent</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>mcp</artifactId>
|
<artifactId>mcp</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,9 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
|
||||||
@Override
|
@Override
|
||||||
public void setSessionFactory(McpServerSession.Factory sessionFactory) {
|
public void setSessionFactory(McpServerSession.Factory sessionFactory) {
|
||||||
// Create a single session for the stdio connection
|
// 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
|
@Override
|
||||||
|
|
@ -142,10 +144,6 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
|
||||||
"stdio-inbound");
|
"stdio-inbound");
|
||||||
this.outboundScheduler = Schedulers.fromExecutorService(Executors.newSingleThreadExecutor(),
|
this.outboundScheduler = Schedulers.fromExecutorService(Executors.newSingleThreadExecutor(),
|
||||||
"stdio-outbound");
|
"stdio-outbound");
|
||||||
|
|
||||||
handleIncomingMessages();
|
|
||||||
startInboundProcessing();
|
|
||||||
startOutboundProcessing();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -181,6 +179,12 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
|
||||||
logger.debug("Session transport closed");
|
logger.debug("Session transport closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initProcessing() {
|
||||||
|
handleIncomingMessages();
|
||||||
|
startInboundProcessing();
|
||||||
|
startOutboundProcessing();
|
||||||
|
}
|
||||||
|
|
||||||
private void handleIncomingMessages() {
|
private void handleIncomingMessages() {
|
||||||
this.inboundSink.asFlux().flatMap(message -> session.handle(message)).doOnTerminate(() -> {
|
this.inboundSink.asFlux().flatMap(message -> session.handle(message)).doOnTerminate(() -> {
|
||||||
// The outbound processing will dispose its scheduler upon completion
|
// The outbound processing will dispose its scheduler upon completion
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>io.modelcontextprotocol.sdk</groupId>
|
<groupId>io.modelcontextprotocol.sdk</groupId>
|
||||||
<artifactId>mcp-parent</artifactId>
|
<artifactId>mcp-parent</artifactId>
|
||||||
<version>0.8.0-SNAPSHOT</version>
|
<version>0.8.1</version>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<url>https://github.com/modelcontextprotocol/java-sdk</url>
|
<url>https://github.com/modelcontextprotocol/java-sdk</url>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue