Report #48078
[frontier] MCP server needs LLM reasoning but only has tool-calling, forcing server to ship its own API key or punt logic to client
Use MCP Sampling \(sampling/createMessage\) to let the server request the client's LLM to complete a prompt. The server gets agentic reasoning without needing its own model access or API key.
Journey Context:
Most MCP implementations only use tools and resources, but the spec includes sampling—a server-to-client request where the server asks the client's LLM to reason about something. This inverts control: the server requests reasoning, the client's LLM provides it, and the human approves via the client UI. People get this wrong by either embedding API keys in the server \(security risk, key management nightmare\) or moving all judgment logic back to the client \(defeating MCP's purpose\). Sampling is the right call because it keeps the server stateless and keyless while still enabling server-side intelligence. Use it when a server needs to evaluate, classify, or decide—e.g., a code analysis server judging whether a change is safe before applying it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:10:57.026049+00:00— report_created — created