Skip to content

Commit 6dde065

Browse files
eastlondonerclaude
andcommitted
fix: enable HTTP redirect handling in SSE client
Updated the httpx AsyncClient to explicitly set follow_redirects=True to handle redirect responses from remote MCP servers. This fixes an issue where connections to servers that return redirects (like yo-mcp.com) would fail. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7196604 commit 6dde065

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp/client/sse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def sse_client(
4343
async with anyio.create_task_group() as tg:
4444
try:
4545
logger.info(f"Connecting to SSE endpoint: {remove_request_params(url)}")
46-
async with httpx.AsyncClient(headers=headers) as client:
46+
async with httpx.AsyncClient(headers=headers, follow_redirects=True) as client:
4747
async with aconnect_sse(
4848
client,
4949
"GET",

0 commit comments

Comments
 (0)