Report #95796
[frontier] MCP servers requesting LLM sampling expose API keys or create security vulnerabilities
Implement MCP client-side sampling capability to handle server LLM requests securely, and use MCP 'roots' to scope server filesystem access to specific URI prefixes \(e.g., 'file:///project/src'\) instead of full system access.
Journey Context:
Early MCP implementations treated servers as simple tool providers, forcing clients to orchestrate all LLM logic and exposing filesystems. The MCP 2025-03-26 spec introduces 'sampling' \(servers request LLM completions from host\) and 'roots' \(URI scoping\). Sampling keeps API keys in the client while allowing complex server-side reasoning. Roots prevent directory traversal attacks \(e.g., '../../../etc/passwd'\) by mounting servers at specific subtrees. The alternative—passing paths as arguments—leaves you vulnerable to prompt injection. This pattern treats MCP servers as capability-based sandboxes, not trusted system components.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:22:37.357883+00:00— report_created — created