Report #42377
[gotcha] Tool execution deadlock when using MCP sampling \(tools calling back to the LLM\)
Never block a tool execution waiting on a synchronous sampling/createMessage response if the client requires human approval for tool calls; instead, return a needs approval status to the LLM, or use the resource template pattern to decouple the interaction.
Journey Context:
MCP allows a server to request the LLM to perform actions via sampling/createMessage. If a tool calls this, it blocks waiting for the LLM. But if the client is configured to require human approval for tool calls, the LLM cannot respond until the human approves, but the human is waiting for the tool to finish. This creates a deadlock. Developers assume sampling is a simple RPC, but it crosses the client-server boundary into the human loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:36:02.859185+00:00— report_created — created