Description
google-adk==1.28.0 declares mcp>=1.23.0,<2.0.0 in its dependencies, but the ADK's MCP session code passes sampling_capabilities to mcp.ClientSession.__init__(), a keyword argument that does not exist in mcp versions prior to 1.24.0. This causes a TypeError at runtime when the resolver picks mcp==1.23.0 (the declared lower bound).
Environment
google-adk==1.28.0
mcp==1.23.0 (resolved by uv from the declared >=1.23.0 floor)
- Python 3.13.5
- macOS (also reproducible on Linux)
Steps to Reproduce
- Install
google-adk==1.28.0 without pinning mcp separately
- Allow the resolver to pick
mcp==1.23.0 (the minimum allowed version)
- Configure any agent with an MCP toolset using Streamable HTTP transport
- Start the agent (e.g.
adk web or programmatically via Runner.run_async)
Expected Behavior
MCP session initializes successfully and tools are discovered from the remote MCP server.
Actual Behavior
Session creation fails immediately with:
TypeError: ClientSession.__init__() got an unexpected keyword argument 'sampling_capabilities'
Full traceback:
ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| File ".../google/adk/tools/mcp_tool/session_context.py", line 186, in _run
| ClientSession(
| *transports[:2],
| ...
| sampling_capabilities=self._sampling_capabilities,
| )
| TypeError: ClientSession.__init__() got an unexpected keyword argument 'sampling_capabilities'
+------------------------------------
The ADK retries once, then surfaces a ConnectionError: Failed to create MCP session.
Suggested Fix
Bump the lower bound in pyproject.toml:
- "mcp>=1.23.0,<2.0.0"
+ "mcp>=1.24.0,<2.0.0"
Workaround
Add an explicit mcp>=1.24.0 dependency in the downstream project to force a compatible version.
Description
google-adk==1.28.0declaresmcp>=1.23.0,<2.0.0in its dependencies, but the ADK's MCP session code passessampling_capabilitiestomcp.ClientSession.__init__(), a keyword argument that does not exist inmcpversions prior to1.24.0. This causes aTypeErrorat runtime when the resolver picksmcp==1.23.0(the declared lower bound).Environment
google-adk==1.28.0mcp==1.23.0(resolved byuvfrom the declared>=1.23.0floor)Steps to Reproduce
google-adk==1.28.0without pinningmcpseparatelymcp==1.23.0(the minimum allowed version)adk webor programmatically viaRunner.run_async)Expected Behavior
MCP session initializes successfully and tools are discovered from the remote MCP server.
Actual Behavior
Session creation fails immediately with:
Full traceback:
The ADK retries once, then surfaces a
ConnectionError: Failed to create MCP session.Suggested Fix
Bump the lower bound in
pyproject.toml:Workaround
Add an explicit
mcp>=1.24.0dependency in the downstream project to force a compatible version.