Skip to content

Commit a1de59c

Browse files
#115925 - handle rpc notification from proxy server (#6)
1 parent 9863cbd commit a1de59c

7 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎mcp-bom/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.modelcontextprotocol.sdk</groupId>
99
<artifactId>mcp-parent</artifactId>
10-
<version>1.2.0</version>
10+
<version>1.3.0</version>
1111
</parent>
1212

1313
<artifactId>mcp-bom</artifactId>

‎mcp-spring/mcp-spring-webflux/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.3.0</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212
<artifactId>mcp-spring-webflux</artifactId>

‎mcp-spring/mcp-spring-webmvc/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.3.0</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212
<artifactId>mcp-spring-webmvc</artifactId>

‎mcp-test/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.3.0</version>
1010
</parent>
1111
<artifactId>mcp-test</artifactId>
1212
<packaging>jar</packaging>

‎mcp/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.3.0</version>
1010
</parent>
1111
<artifactId>mcp</artifactId>
1212
<packaging>jar</packaging>

‎mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,14 @@ else if (message instanceof McpSchema.JSONRPCNotification notification) {
213213
// happening first
214214
logger.debug("Received notification: {}", notification);
215215
// TODO: in case of error, should the POST request be signalled?
216-
return handleIncomingNotification(notification)
217-
.doOnError(error -> logger.error("Error handling notification: {}", error.getMessage()));
216+
if (proxySession) {
217+
logger.debug("Sending notification to original server via proxy: {}", notification);
218+
return this.transport.sendMessage(notification).then(Mono.empty());
219+
}
220+
else {
221+
return handleIncomingNotification(notification)
222+
.doOnError(error -> logger.error("Error handling notification: {}", error.getMessage()));
223+
}
218224
}
219225
else {
220226
logger.warn("Received unknown message type: {}", message);

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.3.0</version>
1010

1111
<packaging>pom</packaging>
1212
<url>https://github.com/modelcontextprotocol/java-sdk</url>

0 commit comments

Comments
 (0)