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_client renamed → streamable_http_client.
server.py:1306 — from mcp.client.streamable_http import streamablehttp_client. In 2.0 the function is streamable_http_client.
-
streamable_http_client / sse_client dropped the headers kwarg.
server.py:1434-1437 — streamablehttp_client(url=..., headers=mcp_connection.headers). In 2.0 headers is removed; it must be set on an httpx2.AsyncClient passed as http_client=.
server.py:1418-1421 — sse_client(url=..., headers=mcp_connection.headers), same change.
Notes
- The tuple-arity change is already handled:
server.py:1442 does read, write = transport[:2], which works for both the old 3-tuple and the new 2-tuple, so no change needed there. server.py:1445-1449 constructs ClientSession without read_timeout_seconds, so the timedelta→float change does not apply. The main work is the import rename and moving headers into an httpx/httpx2 client.
- 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); the SDK's HTTP layer moved from httpx/httpx-sse to httpx2>=2.5.0.
Happy to help with a PR if the maintainers are open to it.
Summary
chainlitcurrently pins the MCP Python SDK to the 1.x line and cannot be installed alongsidemcp2.0.0 (released 2026-07-28). This issue tracks the breaking changes inmcp2.0 that affect the backend.Current constraint
mcp>=1.11.0,<2.0.0—backend/pyproject.toml:45.Breaking changes in
mcp2.0 that affect chainlitAll in
backend/chainlit/server.py, verified against the installedmcp==2.0.0SDK: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
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.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.