Support mcp 2.x (Python SDK): pin blocks mcp 2.0.0
Summary
crewAI currently pins the MCP Python SDK to the 1.x line and therefore cannot be installed alongside mcp 2.0.0 (released 2026-07-28). This issue tracks the breaking changes in mcp 2.0 that affect crewAI and what it would take to support it.
Current pins
| Package | Constraint | Location |
|---|---|---|
crewai (core) |
mcp~=1.28.1 (i.e. >=1.28.1,<1.29) |
lib/crewai/pyproject.toml:43 |
crewai-tools[mcp] extra |
mcp>=1.28.1,<2 + mcpadapt>=0.1.9 |
lib/crewai-tools/pyproject.toml:102-105 |
Both hard-cap the SDK below 2.0.
Breaking changes in mcp 2.0 that affect crewAI
Verified against the installed mcp==2.0.0 SDK and crewAI main:
-
streamablehttp_clientrenamed →streamable_http_client, and now yields a 2-tuple instead of a 3-tuple. It yields(read_stream, write_stream); the thirdget_session_idelement is gone. Used in 3 places with the old name + 3-tuple unpack:lib/crewai/src/crewai/mcp/transports/http.py:75,77,84—read, write, _ = await self._transport_context.__aenter__()lib/crewai/src/crewai/mcp/tool_resolver.py:601,605—async with streamablehttp_client(server_url) as (read, write, _)lib/crewai/src/crewai/tools/mcp_tool_wrapper.py:165,173,175—as (read, write, _)
-
streamable_http_clientdropped theheaderskwarg. Its 2.0 signature is(url, *, http_client=None, terminate_on_close=True). Custom headers must now be set on anhttpx2.AsyncClientpassed ashttp_client=(e.g. viamcp.shared._httpx_utils.create_mcp_http_client(headers=...)). This affectstransports/http.py:78-80, which passesheaders=self.headers. -
camelCase attribute reads on
mcp.types→ snake_case. Constructing with camelCase aliases still parses, but attribute access must now be snake_case:client.py:418—getattr(tool, "inputSchema", {})→input_schemaclient.py:598—getattr(result, "isError", False)→is_errortool_resolver.py:619,621—tool.inputSchema→input_schemalib/crewai-tools/src/crewai_tools/adapters/mcp_adapter.py:54—mcp_tool.inputSchema→input_schema
-
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);httpx/httpx-sseare replaced byhttpx2>=2.5.0. Thecrewai-tools[mcp]path additionally depends on the third-partymcpadaptbridge, so that path's 2.0 support is gated onmcpadaptadding 2.0 compatibility too.
Notes
- crewAI uses only the raw
mcpSDK — nofastmcpdependency — so it is not transitively blocked the way some frameworks are. The native client code is also nicely centralized underlib/crewai/src/crewai/mcp/, which keeps the migration surface small (~5 modules). - Already compatible, no change needed:
SessionMessagestill exists in 2.0 (mcp/shared/message.py:59), sotransports/base.py:8is fine. crewAI does not useMcpError,read_timeout_seconds=timedelta(...), the removedmcp.types.Content/Cursor/ResourceReference, or the removed lowlevel@server.list_tools()/@server.call_tool()decorators (crewAI is a pure MCP client).
Happy to help with a PR if the maintainers are open to it.
hey looks like we need to update the mcp version constraints, I'll take care of it
For the 1.x→2.x migration, I would add a small semantic conformance matrix in addition to import/API compatibility tests. The risk is not only that the client starts; it is that transport/API changes silently alter what CrewAI can observe.
Useful invariants across both supported SDK lines:
- tool name + normalized input schema presented to the agent is equivalent;
is_error/error outcomes cannot be lost by the camelCase→snake_case transition;- auth/header behavior is actually effective on the wire, not merely configured;
- session/transport identity changes are recorded explicitly rather than inferred from the old third tuple element;
- a failing MCP server and a successful tool result remain distinguishable in the same way.
That lets the SDK version be provenance, not a security/correctness verdict by itself.
This configured-vs-effective/transport-provenance distinction is also used in AgentCI: https://github.com/jinngimk-lang/agentci . Reference only; no CrewAI/MCP compatibility or certification claim.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.