Support mcp 2.x (Python SDK): pin blocks mcp 2.0.0
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 58.8k
- Forks
- 8.5k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 109
Description
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.
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.
Research direction
Start with the MCP client modules listed in lib/crewai/src/crewai/mcp/, especially transports/http.py, tool_resolver.py, and mcp_tool_wrapper.py, then review client.py and lib/crewai-tools/src/crewai_tools/adapters/mcp_adapter.py. Check the dependency declarations in both pyproject.toml files and verify behavior against mcp 2.0. Done means the client handles the renamed transport, tuple and attribute changes, dependency floors, and the mcpadapt compatibility constraint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100