fix: env parameters exception when configuring SSE or HTTP MCP server (#513)

* fix: _create_streamable_http_session() got an unexpected keyword argument 'env'

fix unit error

* update md

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
Anoyer-lzh
2025-08-20 17:23:57 +08:00
committed by GitHub
parent b08e9ad3ac
commit 270d8c3712
8 changed files with 54 additions and 16 deletions

View File

@@ -87,10 +87,15 @@ async def test_load_mcp_tools_sse_success(mock_sse_client, mock_get_tools):
result = await mcp_utils.load_mcp_tools(
server_type="sse",
url="http://localhost:1234",
headers={"Authorization": "Bearer 1234567890"},
timeout_seconds=7,
)
assert result == ["toolB"]
mock_sse_client.assert_called_once_with(url="http://localhost:1234")
mock_sse_client.assert_called_once_with(
url="http://localhost:1234",
headers={"Authorization": "Bearer 1234567890"},
timeout=7,
)
mock_get_tools.assert_awaited_once_with(mock_client, 7)