You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Critical Runtime Crash: RuntimeError: Attempted to exit cancel scope... when using MCPToolset on Vertex AI Agent Engine #3731
I am unable to run a custom ADK agent on the Vertex AI Agent Engine due to a concurrency crash occurring during the MCP client setup/teardown. This prevents the agent from processing user queries and, crucially, blocks the required OAuth consent flow from being triggered.
Environment Details
Platform: Vertex AI Agent Engine (deployed via agent_engines.create()), linked to Gemini Enterprise.
Agent Configuration:LlmAgent using LocalMCPToolsetWrapper(MCPToolset).
The agent process crashes immediately when attempting to connect to the MCP server.
This crash prevents the Python tool code's OAuth trigger logic (if not access_token: return []) from executing, meaning the user is never prompted for HubSpot authorization.
Request
We require guidance on a stable version combination for the google-adk, mcp, and anyio dependencies that is compatible with the Vertex AI Agent Engine runtime, or a fix for this concurrency bug in the latest release.
This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.
Activity
yukthiwgeotab commentedon Dec 8, 2025
Any progress on this? It has completely blocked our ability to use our remote mcp servers with agents deployed to agent engine
timjonez commentedon Dec 12, 2025
Also running into this issue
rrondir commentedon Dec 17, 2025
Same issue #3950 it applies to any mcp it seems
feat: start and close ClientSession in a single task in McpSessionMan…
llalitkumarrr commentedon Feb 3, 2026
Hello,
PR (#4025) related to this issue has been merged, kindly update to latest version to test this issue again.
adk-bot commentedon Feb 11, 2026
This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.
adk-bot commentedon Feb 19, 2026
This has been automatically closed because it has been marked as stale for over 7 days.
feat: start and close ClientSession in a single task in McpSessionMan…