microsoft / microsoft/agent-framework

Python: Support mcp 2.x (Python SDK): pin blocks mcp 2.0.0

Open
#7,446 0 comments 0 reactions 1 assignee View on GitHub

@giles17 is already working on this.

Since Aug 3, 2026.

agents python
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Summary

agent-framework currently caps the MCP Python SDK below 2.0 (mcp>=1.24.0,<2), so it cannot be installed alongside mcp 2.0.0 (released 2026-07-28). The pin is load-bearing and correct today, but lifting it to support 2.x requires the code changes below.

Current constraint

mcp>=1.24.0,<2python/packages/core/pyproject.toml:35.

Breaking changes in mcp 2.0 that affect agent-framework

All client-side, in python/packages/core/agent_framework/_mcp.py, verified against the installed mcp==2.0.0 SDK:

  1. McpError renamed → MCPError. Imported from mcp.shared.exceptions and used in many handlers: _mcp.py:1980, 2088, 2107, 2109, 2113, 2210, 2226, 2228, 2300, 2327, 2366, 2378, 2458, 2470, 2500, 2505, 2593, 2597, 2618, 2654. In 2.0 the name is MCPError (constructor MCPError(code, message, data=None)).

  2. ClientSession(read_timeout_seconds=timedelta(...)) now takes a float.

    • _mcp.py:1339-1341 — pass a float of seconds instead of timedelta.
  3. camelCase attribute reads on mcp.types → snake_case (extensive):

    • .mimeTypemime_type: _mcp.py:588, 603, 660, 668, 678, 733, 741, 781
    • .structuredContentstructured_content: _mcp.py:691, 692, 760
    • .isErroris_error: _mcp.py:761, 2093, 2241, 2436
    • .inputSchemainput_schema: _mcp.py:1534, 1861
Notes
  • The streamable-HTTP transport layer is already 2.0-ready: _mcp.py:361-374 uses the new streamable_http_client name with the http_client= kwarg and a 2-tuple-compatible result, so that part needs no change.
  • 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.