Support mcp 2.x (Python SDK): pin blocks mcp 2.0.0
Author: ProgrammerPlus1998Created Jul 31, 2026Updated Aug 27, 2026
Labelsenhancementbackend
Summary
chainlit currently pins the MCP Python SDK to the 1.x line and cannot be installed alongside mcp 2.0.0 (released 2026-07-28). This issue tracks the breaking changes in mcp 2.0 that affect the backend.
Current constraint
mcp>=1.11.0,<2.0.0 — backend/pyproject.toml:45.
Breaking changes in mcp 2.0 that affect chainlit
All in backend/chainlit/server.py, verified against the installed mcp==2.0.0 SDK:
streamablehttp_clientrenamed →streamable_http_client.server.py:1306—from mcp.client.streamable_http import streamablehttp_client. In 2.0 the function isstreamable_http_client.
streamable_http_client/sse_clientdropped theheaderskwarg.server.py:1434-1437—streamablehttp_client(url=..., headers=mcp_connection.headers). In 2.0headersis removed; it must be set on anhttpx2.AsyncClientpassed ashttp_client=.server.py:1418-1421—sse_client(url=..., headers=mcp_connection.headers), same change.
Notes
- The tuple-arity change is already handled:
server.py:1442doesread, write = transport[:2], which works for both the old 3-tuple and the new 2-tuple, so no change needed there.server.py:1445-1449constructsClientSessionwithoutread_timeout_seconds, so the timedelta→float change does not apply. The main work is the import rename and movingheadersinto anhttpx/httpx2client. - 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.
Source: Chainlit/chainlit