From 8682b017e25af0eaf658d8b862222efb13a9b1e0 Mon Sep 17 00:00:00 2001 From: 04cb <0x04cb@gmail.com> Date: Tue, 31 Mar 2026 08:53:35 +0800 Subject: [PATCH] fix(tools): add Accept header for MCP SSE connections (#2651) --- nanobot/agent/tools/mcp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nanobot/agent/tools/mcp.py b/nanobot/agent/tools/mcp.py index c1c3e79a2..51533333e 100644 --- a/nanobot/agent/tools/mcp.py +++ b/nanobot/agent/tools/mcp.py @@ -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,