Skip to content

Commit babb566

Browse files
committed
another round
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent 18e10f0 commit babb566

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ private Flux<McpSchema.JSONRPCMessage> directResponseFlux(McpSchema.JSONRPCMessa
390390
return response.bodyToMono(String.class).<Iterable<McpSchema.JSONRPCMessage>>handle((responseMessage, s) -> {
391391
try {
392392
if (sentMessage instanceof McpSchema.JSONRPCNotification && Utils.hasText(responseMessage)) {
393-
logger.warn("Notificaiton: {} received non-compliant response: {}", sentMessage, responseMessage);
393+
logger.warn("Notification: {} received non-compliant response: {}", sentMessage, responseMessage);
394+
s.complete();
394395
}
395396
else {
396397
McpSchema.JSONRPCMessage jsonRpcResponse = McpSchema.deserializeJsonRpcMessage(objectMapper,
@@ -399,6 +400,7 @@ private Flux<McpSchema.JSONRPCMessage> directResponseFlux(McpSchema.JSONRPCMessa
399400
}
400401
}
401402
catch (IOException e) {
403+
// TODO: this should be a McpTransportError
402404
s.error(e);
403405
}
404406
}).flatMapIterable(Function.identity());

mcp/src/main/java/io/modelcontextprotocol/client/transport/HttpClientStreamableHttpTransport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,14 +437,15 @@ else if (contentType.contains(APPLICATION_JSON)) {
437437
messageSink.success();
438438
String data = ((ResponseSubscribers.AggregateResponseEvent) responseEvent).data();
439439
if (sentMessage instanceof McpSchema.JSONRPCNotification && Utils.hasText(data)) {
440-
logger.warn("Notificaiton: {} received non-compliant response: {}", sentMessage, data);
440+
logger.warn("Notification: {} received non-compliant response: {}", sentMessage, data);
441441
return Mono.empty();
442442
}
443443

444444
try {
445445
return Mono.just(McpSchema.deserializeJsonRpcMessage(objectMapper, data));
446446
}
447447
catch (IOException e) {
448+
// TODO: this should be a McpTransportError
448449
return Mono.error(e);
449450
}
450451
}

mcp/src/main/java/io/modelcontextprotocol/client/transport/ResponseSubscribers.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ else if (line.startsWith("event:")) {
168168
}
169169
else {
170170
// If the response is not successful, emit an error
171+
// TODO: This should be a McpTransportError
171172
this.sink.error(new McpError(
172173
"Invalid SSE response. Status code: " + this.responseInfo.statusCode() + " Line: " + line));
173174

0 commit comments

Comments
 (0)