-
Notifications
You must be signed in to change notification settings - Fork 676
Closed
Milestone
Description
Bug description
Line 505 of io.modelcontextprotocol.client.transport.HttpClientStreamableHttpTransport. If the result of responseEvent conversion is as follows: AggregateResponseEvent[responseInfo=jdk.internal.net.http.ResponseInfoImpl@67d15067, data=], the obtained data is an empty string. The Utils.hasText method does not recognize empty strings, resulting in an error:
io.modelcontextprotocol.spec.McpTransportException: Error deserializing JSON-RPC message: AggregateResponseEvent[responseInfo=jdk.internal.net.http.ResponseInfoImpl@5e431139, data=]
at io.modelcontextprotocol.client.transport.HttpClientStreamableHttpTransport.lambda$sendMessage$27(HttpClientStreamableHttpTransport.java:515) ~[mcp-core-0.13.1.jar:0.13.1]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:388) ~[reactor-core-3.7.9.jar:3.7.9]
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:251) ~[reactor-core-3.7.9.jar:3.7.9]
at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:880) ~[reactor-core-3.7.9.jar:3.7.9]
at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:805) ~[reactor-core-3.7.9.jar:3.7.9]
at reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:163) ~[reactor-core-3.7.9.jar:3.7.9]
at io.modelcontextprotocol.client.transport.ResponseSubscribers$AggregateSubscriber.hookOnComplete(ResponseSubscribers.java:263) ~[mcp-core-0.13.1.jar:0.13.1]
at reactor.core.publisher.BaseSubscriber.onComplete(BaseSubscriber.java:197) ~[reactor-core-3.7.9.jar:3.7.9]
Environment
Mcp Client: SpringBoot 3.5.5 SpringAI 1.1.0-M2
Mcp Java SDK: 0.13.1
Mcp Server: Python FastMCP
Expected behavior
Hopefully, the Utils.hasText() method can be used to recognize empty strings and return Mono.empty() to avoid errors.
