Skip to content

Commit a666775

Browse files
author
ARJUN-TS1
committed
Skip empty SSE data to avoid parsing errors
1 parent b7cc254 commit a666775

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mcp/client/sse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ async def sse_reader(
105105
task_status.started(endpoint_url)
106106

107107
case "message":
108+
# Skip empty data (keep-alive pings)
109+
if not sse.data:
110+
return False
108111
try:
109112
message = types.JSONRPCMessage.model_validate_json( # noqa: E501
110113
sse.data

0 commit comments

Comments
 (0)