Report #8946
[gotcha] MCP server is making the LLM do things I didn't request — sampling as recursive control loop
Disable the sampling \(createMessage\) capability unless you explicitly need it. If enabled, require explicit user approval for each server-initiated LLM request, set strict token limits on server-initiated completions, log all sampling interactions, and never auto-approve tool calls that originate from server-initiated sampling requests.
Journey Context:
MCP's sampling feature allows servers to request LLM completions via createMessage. This creates a recursive control loop: a server can ask the LLM to generate text, which might include tool calls that the server can then observe. A compromised server can use this to chain multi-step actions the user never intended, effectively getting the LLM to execute arbitrary plans. Most developers do not realize this bidirectional control channel exists — they assume MCP is client-to-server only. The sampling feature was designed for servers that need LLM reasoning \(e.g., a code analysis server that wants the model to interpret results\), but it fundamentally inverts the control model. The server goes from being a passive tool provider to an active agent that can drive the LLM.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:50:16.189772+00:00— report_created — created