Merge pull request #1428 from xinnan-tech/hot-fix

update:修复参数错误
This commit is contained in:
欣南科技 2025-05-31 10:14:50 +08:00 committed by GitHub
commit 3c3be950e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,15 +92,21 @@ class MCPClient:
args=self.config.get("args", []),
env=env,
)
stdio_r, stdio_w = await stack.enter_async_context(stdio_client(params))
stdio_r, stdio_w = await stack.enter_async_context(
stdio_client(params)
)
read_stream, write_stream = stdio_r, stdio_w
# 建立SSEClient
elif "url" in self.config:
if "API_ACCESS_TOKEN" in self.config:
headers = {"Authorization": f"Bearer {self.config['API_ACCESS_TOKEN']}"}
headers = {
"Authorization": f"Bearer {self.config['API_ACCESS_TOKEN']}"
}
else:
headers = {}
sse_r, sse_w = await stack.enter_async_context(sse_client(self.config["url"], , headers=headers))
sse_r, sse_w = await stack.enter_async_context(
sse_client(self.config["url"], headers=headers)
)
read_stream, write_stream = sse_r, sse_w
else: