autogen icon indicating copy to clipboard operation
autogen copied to clipboard

autogen-ext: mcp 2.0.0 breaks MCP tools (no upper bound, uses removed/renamed 1.x APIs)

Open SiAgentBuild opened this issue 4 months ago • 3 comments

Summary

The autogen-ext MCP integration does not cap the MCP Python SDK, so pip install autogen-ext[mcp] now resolves to mcp 2.0.0 (released 2026-07-28) — and the code breaks on it, because it uses several mcp 1.x APIs that were removed or renamed in 2.0. This is a live latent bug today, not just a future migration concern.

Current constraint

mcp = ["mcp>=1.11.0"] — python/packages/autogen-ext/pyproject.toml:153 (no upper bound).

Breaking changes in mcp 2.0 that affect autogen-ext

All client-side, in python/packages/autogen-ext/src/autogen_ext/tools/mcp/, verified against the installed mcp==2.0.0 SDK:

  1. streamablehttp_client renamed → streamable_http_client, 3-tuple → 2-tuple, and dropped kwargs.

    • _session.py:9 — from mcp.client.streamable_http import streamablehttp_client; used at _session.py:50.
    • _session.py:50-54 — unpacks a 3-tuple as (read, write, session_id_callback); 2.0 returns only (read, write).
    • _session.py:47-48 — passes timeout= / sse_read_timeout= (as timedelta), both removed in 2.0; timeouts must move onto an httpx2.AsyncClient passed as http_client=.
  2. ClientSession(read_timeout_seconds=timedelta(...)) now takes a float.

    • _session.py:27, :38, :59 — pass a float of seconds instead of timedelta.
  3. camelCase attribute reads on mcp.types → snake_case.

    • .inputSchema → input_schema: _base.py:50, _workbench.py:302-304
    • .isError → is_error: _base.py:122, _workbench.py:347
  4. sse_client(**server_params.model_dump(...)) at _session.py:34 — passes the full params dict; if it includes kwargs removed in 2.0, this path also breaks and should be re-verified.

Notes

  • Short term, capping mcp<2 would stop the breakage; the longer-term fix is the migration above.
  • Dependency-floor updates. mcp 2.0 requires pydantic>=2.12, anyio>=4.9, typing-extensions>=4.13, and adds required deps opentelemetry-api and mcp-types (exact-pinned to the SDK version); the SDK's HTTP layer moved from httpx/httpx-sse to httpx2>=2.5.0.

Happy to help with a PR if the maintainers are open to it.

SiAgentBuild avatar Jul 31 '26 02:07 SiAgentBuild

Hi — I’m interested in helping with this, but I’d like to confirm the intended scope before starting implementation.

The immediate breakage appears to come from autogen-ext allowing mcp>=1.11.0 with no upper bound while the integration still targets MCP SDK 1.x APIs. I see two reasonable scopes:

  1. A minimal compatibility fix that caps the dependency at mcp<2 to restore reliable installs with the current implementation.
  2. A full MCP 2.0 migration covering the renamed streamable HTTP client, changed tuple and timeout behavior, ClientSession timeout typing, and snake_case schema/result attributes.

For the minimal fix, I would add a dependency-resolution regression check plus MCP import/smoke coverage. For a full migration, I would add deterministic tests for stdio, SSE, and streamable HTTP session setup, along with tool schema and error-result conversion, using mocks/fakes rather than external services.

Would maintainers prefer the compatibility cap or the full migration? If this is open to an external contribution, please confirm the scope and assign the issue if assignment is part of the workflow. I’ll wait for that direction before opening a PR.

zyz619963502zyz avatar Aug 01 '26 04:08 zyz619963502zyz

Ran into this one myself a few weeks back...... quick unblock is pinning the SDK: pip install "mcp<2" and autogen-ext's MCP tools work again while upstream decides. There's an open PR (#8021) capping mcp>=1.11.0,<2 if you want to add signal; heads up that mcp 2.0 also drags in pydantic>=2.12 and anyio>=4.9, so a fresh venv helps when you test the migration.

MilkyWay008 avatar Aug 14 '26 13:08 MilkyWay008