fix(tools): add Accept header for MCP SSE connections (#2651)

This commit is contained in:
04cb 2026-03-31 08:53:35 +08:00 committed by Xubin Ren
parent 7fad14802e
commit 8682b017e2

View File

@ -170,7 +170,11 @@ async def connect_mcp_servers(
timeout: httpx.Timeout | None = None,
auth: httpx.Auth | None = None,
) -> httpx.AsyncClient:
merged_headers = {**(cfg.headers or {}), **(headers or {})}
merged_headers = {
"Accept": "application/json, text/event-stream",
**(cfg.headers or {}),
**(headers or {}),
}
return httpx.AsyncClient(
headers=merged_headers or None,
follow_redirects=True,