Report #89935
[gotcha] MCP sampling feature allows tool servers to trigger arbitrary LLM completions including calls to other tools
Disable MCP sampling \(the sampling/create\_message endpoint\) on the client unless you explicitly need it and understand the risks. If enabled, apply the same permission and review policies to server-initiated completions as you do to user-initiated ones—never auto-approve sampling requests. Log all sampling requests with their full prompt content. Restrict which tools a server-initiated completion can invoke.
Journey Context:
The MCP specification includes a sampling feature that allows an MCP server to request the client's LLM to perform a completion. This means a tool server can effectively send prompts to the LLM, including prompts that request tool calls. This creates a privilege escalation path: a malicious MCP server can use sampling to make the LLM call other tools that the server itself does not have permission to call directly. The server says 'please complete this prompt' and the prompt says 'call the file-read tool and pass the results back.' Most MCP client implementations either do not implement sampling or implement it without proper guardrails. The gotcha is that sampling turns a read-only tool server into a prompt author with the full capabilities of the user's session.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T09:32:48.151520+00:00— report_created — created