NameError / ImportError with streamable-http MCP server (Incompatible with MCP SDK v2.0.0)

Author: Krish8732Created Aug 25, 2026Updated Aug 25, 2026

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

  1. Install mcp>=2.0.0
  2. Configure an MCP server in qwen-agent with "type": "streamable-http"
  3. Attempt to initialize the MCP manager.

Expected Behavior

The streamable-http MCP client should connect successfully using the updated MCP v2.0.0 API:

python
from mcp.client.streamable_http import streamable_http_client

# v2 implementation needs to pass an httpx2.AsyncClient and expect a 2-tuple

Actual Behavior

Code throws an error because streamablehttp_client is used but not imported/does not exist in MCP v2:

python
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-agent version: 0.0.34 (and main branch)
  • mcp version: 2.0.0