-
Notifications
You must be signed in to change notification settings - Fork 983
Open
Description
Bug
The MCP-over-HTTP wrapper hangs indefinitely when a client connects to the GET /sse endpoint.
Location
mcp.js:625 in the built bundle (the HTTP proxy/wrapper that fronts the MCP stdio server).
What happens
The handler does:
const response = await fetch(url);
const buf = await response.arrayBuffer(); // <-- hangs hereThe GET /sse endpoint returns a Server-Sent Events ReadableStream — it never closes, so arrayBuffer() never resolves. The request hangs forever and the client never receives any data.
Expected behavior
The SSE stream should be piped through to the client response instead of being buffered. Something like:
if (response.headers.get('content-type')?.includes('text/event-stream')) {
// Pipe the ReadableStream directly to the Node response
Readable.fromWeb(response.body).pipe(nodeRes);
return;
}Workaround
Use the REST POST /query endpoint instead of connecting via MCP-over-HTTP SSE transport. This avoids the hanging arrayBuffer() call entirely.
Environment
- QMD installed via
npm install -g @tobilu/qmd - Running as a daemon on
localhost:8181/mcp - Client: Node.js fetch / MCP SDK SSE transport
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels