File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ async def streamable_client(
2828 """
2929 Client transport for streamable HTTP, with fallback to SSE.
3030 """
31- if await _is_old_sse_server (url , timeout ):
31+ if await _is_old_sse_server (url , headers = headers , timeout = timeout ):
3232 async with sse_client (url , headers = headers ) as (read_stream , write_stream ):
3333 yield read_stream , write_stream
3434 return
@@ -148,7 +148,11 @@ async def post_writer():
148148)
149149
150150
151- async def _is_old_sse_server (url : str , timeout : float ) -> bool :
151+ async def _is_old_sse_server (
152+ url : str ,
153+ headers : dict [str , Any ] | None ,
154+ timeout : float ,
155+ ) -> bool :
152156 """
153157 Test whether this is an old SSE MCP server.
154158
@@ -176,6 +180,7 @@ async def _is_old_sse_server(url: str, timeout: float) -> bool:
176180 headers = (
177181 ("accept" , "application/json" ),
178182 ("accept" , "text/event-stream" ),
183+ * (headers or {}).items (),
179184 ),
180185 )
181186 if 400 <= response .status_code < 500 :
You can’t perform that action at this time.
0 commit comments