Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion livekit-agents/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies = [
]

[project.optional-dependencies]
mcp = ["mcp>=1.24.0, <2"]
mcp = ["mcp>=2, <3"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Agents can no longer use MCP tool servers after the dependency jump

The MCP tool-server dependency is moved to a new major line (mcp>=2, <3 at livekit-agents/pyproject.toml:64) without updating the code that talks to it, so every agent that connects to an MCP tool server fails to start.
Impact: Any agent using MCP tools breaks immediately with a confusing "install the mcp package" error, even though the package is installed.

Incompatible v1 client APIs used against the mcp 2.x SDK

Inspecting the published mcp 2.0.0 wheel shows several v1 APIs used by livekit-agents/livekit/agents/llm/mcp.py are gone or changed:

  • GetSessionIdCallback no longer exists anywhere in the package, so from mcp.client.streamable_http import GetSessionIdCallback, streamable_http_client (livekit-agents/livekit/agents/llm/mcp.py:27) raises ImportError, which the surrounding try/except ImportError (livekit-agents/livekit/agents/llm/mcp.py:29-33) converts into the misleading "The 'mcp' package is required ... pip install 'livekit-agents[mcp]'" message. This alone makes all MCP usage unusable.
  • v2 depends on httpx2, not httpx: sse_client/streamable_http_client expect an httpx2.AsyncClient (and sse_client calls client.sse(url)), while _create_http_client (livekit-agents/livekit/agents/llm/mcp.py:388-405) builds an httpx.AsyncClient.
  • ClientSession(read_timeout_seconds=...) is now float | None (no timedelta handling remains in the package; the value is passed straight to anyio.fail_after), but livekit-agents/livekit/agents/llm/mcp.py:158 still passes timedelta(seconds=...).
  • mcp.server.fastmcp was removed, breaking examples/voice_agents/mcp/server.py:4.

Either keep the <2 bound or port llm/mcp.py (and the example server) to the v2 client API.

Prompt for agents
Bumping the optional dependency to mcp>=2,<3 in livekit-agents/pyproject.toml breaks livekit-agents/livekit/agents/llm/mcp.py, which is written against the mcp 1.x client API. Concretely, in mcp 2.0.0: GetSessionIdCallback no longer exists in mcp.client.streamable_http (the module-level import fails and is swallowed into a misleading 'install the mcp package' ImportError message); the transports now use the httpx2 package instead of httpx, so the locally built httpx.AsyncClient in MCPServerHTTP._create_http_client is not compatible with sse_client/streamable_http_client; ClientSession's read_timeout_seconds is now plain float seconds and is fed directly to anyio.fail_after, while the code passes a datetime.timedelta; and mcp.server.fastmcp (used by examples/voice_agents/mcp/server.py) was removed. Decide whether to keep the <2 constraint until the client code is migrated, or to port llm/mcp.py and the example server to the v2 client API.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

codecs = ["numpy>=1.26.0"]
images = ["pillow>=10.3.0"]
anam = ["livekit-plugins-anam>=1.6.10"]
Expand Down
2 changes: 1 addition & 1 deletion livekit-plugins/livekit-plugins-gnani/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
]
dependencies = [
"livekit-agents[codecs]>=1.6.10",
"websockets>=14.0,<16.0",
"websockets>=17,<17.1",
]

[project.urls]
Expand Down
Loading