microsoft / microsoft/agent-framework
Python: Support mcp 2.x (Python SDK): pin blocks mcp 2.0.0
@giles17 is already working on this.
Since Aug 3, 2026.
- 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,<2 — python/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:
-
McpErrorrenamed →MCPError. Imported frommcp.shared.exceptionsand 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 isMCPError(constructorMCPError(code, message, data=None)). -
ClientSession(read_timeout_seconds=timedelta(...))now takes a float._mcp.py:1339-1341— pass a float of seconds instead oftimedelta.
-
camelCase attribute reads on
mcp.types→ snake_case (extensive):.mimeType→mime_type:_mcp.py:588, 603, 660, 668, 678, 733, 741, 781.structuredContent→structured_content:_mcp.py:691, 692, 760.isError→is_error:_mcp.py:761, 2093, 2241, 2436.inputSchema→input_schema:_mcp.py:1534, 1861
Notes
- The streamable-HTTP transport layer is already 2.0-ready:
_mcp.py:361-374uses the newstreamable_http_clientname with thehttp_client=kwarg and a 2-tuple-compatible result, so that part needs no change. - Dependency-floor updates.
mcp2.0 requirespydantic>=2.12,anyio>=4.9,typing-extensions>=4.13, and adds required depsopentelemetry-apiandmcp-types(exact-pinned to the SDK version); the SDK's HTTP layer moved fromhttpx/httpx-ssetohttpx2>=2.5.0.
Happy to help with a PR if the maintainers are open to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.