diff --git a/src/mcp/client/streamable_http.py b/src/mcp/client/streamable_http.py index 57df64705..a7c34fc70 100644 --- a/src/mcp/client/streamable_http.py +++ b/src/mcp/client/streamable_http.py @@ -157,7 +157,7 @@ async def _handle_sse_event( is_initialization: bool = False, ) -> bool: """Handle an SSE event, returning True if the response is complete.""" - if sse.event == "message": + if sse.event in {"message", "error"}: try: message = JSONRPCMessage.model_validate_json(sse.data) logger.debug(f"SSE message: {message}")