crewAIInc / crewAIInc/crewAI

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

Open
#6,750 2 comments 0 reactions 0 assignees View on GitHub

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:

  1. streamablehttp_client renamed → streamable_http_client, and now yields a 2-tuple instead of a 3-tuple. It yields (read_stream, write_stream); the third get_session_id element is gone. Used in 3 places with the old name + 3-tuple unpack:

    • lib/crewai/src/crewai/mcp/transports/http.py:75,77,84read, write, _ = await self._transport_context.__aenter__()
    • lib/crewai/src/crewai/mcp/tool_resolver.py:601,605async with streamablehttp_client(server_url) as (read, write, _)
    • lib/crewai/src/crewai/tools/mcp_tool_wrapper.py:165,173,175as (read, write, _)
  2. streamable_http_client dropped the headers kwarg. Its 2.0 signature is (url, *, http_client=None, terminate_on_close=True). Custom headers must now be set on an httpx2.AsyncClient passed as http_client= (e.g. via mcp.shared._httpx_utils.create_mcp_http_client(headers=...)). This affects transports/http.py:78-80, which passes headers=self.headers.

  3. camelCase attribute reads on mcp.types → snake_case. Constructing with camelCase aliases still parses, but attribute access must now be snake_case:

    • client.py:418getattr(tool, "inputSchema", {})input_schema
    • client.py:598getattr(result, "isError", False)is_error
    • tool_resolver.py:619,621tool.inputSchemainput_schema
    • lib/crewai-tools/src/crewai_tools/adapters/mcp_adapter.py:54mcp_tool.inputSchemainput_schema
  4. 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); httpx/httpx-sse are replaced by httpx2>=2.5.0. The crewai-tools[mcp] path additionally depends on the third-party mcpadapt bridge, so that path's 2.0 support is gated on mcpadapt adding 2.0 compatibility too.

Notes
  • crewAI uses only the raw mcp SDK — no fastmcp dependency — so it is not transitively blocked the way some frameworks are. The native client code is also nicely centralized under lib/crewai/src/crewai/mcp/, which keeps the migration surface small (~5 modules).
  • Already compatible, no change needed: SessionMessage still exists in 2.0 (mcp/shared/message.py:59), so transports/base.py:8 is fine. crewAI does not use McpError, read_timeout_seconds=timedelta(...), the removed mcp.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

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.