NameError / ImportError with streamable-http MCP server (Incompatible with MCP SDK v2.0.0)
Describe the bug
When configuring an MCP server with "type": "streamable-http", qwen-agent fails with a NameError (or ImportError depending on the version) because it tries to call streamablehttp_client (without an underscore) which is incompatible with the modern MCP Python SDK (v2.0.0+).
In MCP SDK v2.0.0, the client was renamed to streamable_http_client and its function signature was fundamentally changed (it now takes an httpx2.AsyncClient rather than headers and sse_read_timeout, and it returns a 2-tuple instead of a 3-tuple).
Location of bug: https://github.com/QwenLM/Qwen-Agent/blob/main/qwen_agent/tools/mcp_manager.py#L360-L364
Steps to reproduce
- Install
mcp>=2.0.0 - Configure an MCP server in
qwen-agentwith"type": "streamable-http" - Attempt to initialize the MCP manager.
Expected Behavior
The streamable-http MCP client should connect successfully using the updated MCP v2.0.0 API:
from mcp.client.streamable_http import streamable_http_client
# v2 implementation needs to pass an httpx2.AsyncClient and expect a 2-tupleActual Behavior
Code throws an error because streamablehttp_client is used but not imported/does not exist in MCP v2:
self._streams_context = streamablehttp_client(url=url, headers=headers, sse_read_timeout=datetime.timedelta(seconds=sse_read_timeout))
read_stream, write_stream, get_session_id = await self.exit_stack.enter_async_context(self._streams_context)Environment
qwen-agentversion: 0.0.34 (andmainbranch)mcpversion: 2.0.0
Source: QwenLM/Qwen-Agent