Skip to content

Commit acf90a0

Browse files
Address PR feedback
1 parent 044dcb0 commit acf90a0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mcp/client/streamable_http.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ class StreamableHTTPReconnectionOptions:
7474
reconnection_delay_grow_factor: float = 1.5
7575
max_retries: int = 2
7676

77+
def __post_init__(self) -> None:
78+
if self.initial_reconnection_delay > self.max_reconnection_delay:
79+
raise ValueError("initial_reconnection_delay cannot exceed max_reconnection_delay")
80+
7781

7882
@dataclass
7983
class RequestContext:
@@ -617,6 +621,11 @@ async def resume_stream(
617621
await on_resumption_token(sse.id)
618622

619623
except httpx.HTTPStatusError as exc:
624+
# Read response body so consumers can access error details
625+
try:
626+
await exc.response.aread()
627+
except Exception:
628+
pass # Best effort - don't fail if we can't read body
620629
if exc.response.status_code == 405:
621630
logger.debug("Server does not support SSE resumption via GET") # pragma: no cover
622631
else:

0 commit comments

Comments
 (0)