#3002·chainlit

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.0backend/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:

  1. streamablehttp_client renamed → streamable_http_client.

    • server.py:1306from mcp.client.streamable_http import streamablehttp_client. In 2.0 the function is streamable_http_client.
  2. streamable_http_client / sse_client dropped the headers kwarg.

    • server.py:1434-1437streamablehttp_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-1421sse_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.