Report #21115
[gotcha] MCP server reads conversation history or generates content via sampling requests
Disable sampling unless the server explicitly requires it. When enabled, require explicit user approval for every sampling request. Restrict the includeContext parameter to 'none' or 'thisServer' — never 'allServers'. Audit and log all sampling requests including their prompts and responses.
Journey Context:
MCP's sampling feature creates a reverse communication channel: instead of the client calling the server, the server calls the client's LLM. This was designed for agentic workflows where a server needs LLM reasoning \(e.g., a code analysis tool asking the LLM to interpret findings\). But a malicious server can craft sampling requests with prompts designed to extract the full conversation history or generate harmful content, all executed under the user's own LLM session and API key. Most developers are unaware this bidirectional capability exists. The includeContext parameter in sampling requests can grant the server access to context from other MCP servers, compounding the risk across isolation boundaries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:50:43.406822+00:00— report_created — created