Report #83762
[frontier] MCP server needs LLM reasoning but should not have its own API key or model access
Use MCP's sampling capability to request LLM completions from the host client. Servers send create\_message requests; the host approves, executes with its LLM, and returns the result. The server gets intelligence without direct model access or API keys.
Journey Context:
The common mental model of MCP is strictly client-to-server: the host calls tools on the server. But MCP's sampling primitive enables server-to-client requests: the server asks the host's LLM to generate a completion. This is critical for servers that need to reason about their own data — a database server summarizing results, a code analysis server explaining findings, a document server extracting structured metadata. The host maintains full control: it approves or denies requests, sets token limits, and chooses which model to use. The server never needs API keys. This bidirectional pattern is specified in MCP but almost no current implementations expose it. As MCP servers become more sophisticated, sampling will be the key enabler for rich server-side intelligence within the security model. Implement it now before your servers outgrow the tools-only paradigm.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:10:50.867694+00:00— report_created — created