Parse an SSE (Server-Sent Events) response body to extract the first valid JSON-RPC message.
The MCP Streamable HTTP protocol sends JSON-RPC responses as SSE data: lines.
This function returns the first successfully parsed JSON-RPC message; any
subsequent data: lines are ignored. This matches the MCP protocol expectation
of one JSON-RPC response per HTTP request/response cycle.
Parameters
body: string
Raw SSE response text (may contain multiple lines including event: and data:)
Parse an SSE (Server-Sent Events) response body to extract the first valid JSON-RPC message.
The MCP Streamable HTTP protocol sends JSON-RPC responses as SSE
data:lines. This function returns the first successfully parsed JSON-RPC message; any subsequentdata:lines are ignored. This matches the MCP protocol expectation of one JSON-RPC response per HTTP request/response cycle.