inspector icon indicating copy to clipboard operation
inspector copied to clipboard

[Streamable HTTP] MCP-Inspector does not fall back to checking GET SSE stream for responses

Open kumarshantanu opened this issue 6 months ago • 0 comments

Describe the bug As per the spec 2025-06-18:

The server SHOULD NOT close the SSE stream before sending the JSON-RPC response for the received JSON-RPC request, unless the session expires.

Note the SHOULD NOT (recommended) wording - a server may choose to not include the response (for JSON-RPC request) in the POST SSE stream (in order to conserve system resources) because it is awaiting another event. The server may choose to send the response later in the GET SSE stream. MCP-Inspector does not correlate the sent requests with response messages in GET SSE stream, as I found testing my own version of everything (sampleLLM tool call) server.

To Reproduce Steps to reproduce the behavior:

  1. Have MCP-Inspector make a tool-call, where the server does not include the response in the POST SSE stream, but rather it sends the response in the GET SSE stream.
  2. MCP-Inspector observes this condition as a Timeout instead of correlating the response from the GET SSE stream.

Expected behavior MCP-Inspector should track the sent request against responses in the GET SSE stream, in addition to the POST SSE stream.

Logs N/A

Additional context This issue is important for horizontally scalable MCP servers (e.g. several MCP server nodes behind Nginx) where requests are not guaranteed to arrive at the same server instance, or having a sticky session. In a distributed system scenario, an MCP server cannot synchronously keep waiting for an event to happen on the same machine. Dependency-event completion needs to employ a callback mechanism to deliver the JSON-RPC response, potentially on another machine, hence resorting to use the GET SSE stream.

kumarshantanu avatar Jul 12 '25 15:07 kumarshantanu