From dd4df5ba8151f8377fcff5db73bd8e353dbc014c Mon Sep 17 00:00:00 2001 From: Dreamwxz <82244600+Dreamwxz@users.noreply.github.com> Date: Tue, 5 May 2026 19:27:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20sse=5Fclient=20=E4=B8=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=97=20http=5Fclient=3D=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mcp_module/connection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mcp_module/connection.py b/src/mcp_module/connection.py index 631eef5e..6f1f01b2 100644 --- a/src/mcp_module/connection.py +++ b/src/mcp_module/connection.py @@ -208,11 +208,13 @@ class MCPConnection: if not self.config.url: raise ValueError(f"MCP 服务器 '{self.config.name}' 缺少 SSE url 配置") - self._http_client = await self._exit_stack.enter_async_context(self._build_http_client()) read_stream, write_stream = await self._exit_stack.enter_async_context( sse_client( url=self.config.url, - http_client=self._http_client, + headers=self.config.build_http_headers(), + timeout=self.config.http_timeout_seconds, + sse_read_timeout=self.config.read_timeout_seconds, + httpx_client_factory=self._build_http_client, ) ) return read_stream, write_stream