In MCP sampling, what human review does the spec expect before and after the model call?
answer
- A person on both sides of the call
- Prompt in, completion out
- Edit, not just approve or reject
- SHOULD-level; the host enforces it
- Server cannot verify any dialog appeared
basics
~20 sTwo review points. Before the model runs, the client should show the user the prompt the server supplied and let them approve, edit or reject it. After it runs, the user should be able to see and edit the completion before it goes back to the server.
solid answer
~50 sMCP sampling lets a server borrow the client's model instead of holding its own LLM credentials, so the client is the party actually spending tokens and actually seeing the text. The specification's human-in-the-loop guidance puts a person on both sides of that call: the client **should** present the incoming `sampling/createMessage` request so the user can approve it, edit the prompt, or refuse outright, and it **should** let the user review — and if needed edit — the completion before it is returned to the server. Both are SHOULD-level, and MCP cannot enforce either at the protocol level: the host application is the enforcement boundary, and a server has no way to verify that any dialog was ever shown. In revision 2026-07-28 the request arrives inside an `InputRequiredResult` rather than as a server-initiated call, which is what makes the client the natural gate.
go deeper
Know that sampling means the server asks the client's model to generate text, and that a person is supposed to see the request before it runs. Say plainly that the user can refuse.
Explain both review points — approve or edit the prompt before the model runs, review the completion before it is returned — and that they are SHOULD-level guidance the host implements, not something the wire protocol enforces.
Show that you treat the outbound completion as a data-exfiltration channel and design the approval UI around real prompt text, server identity you derived yourself, and a spend budget. Be ready to say what your server does when approval never comes.
Own the position that the host is the only enforcement boundary, so sampling safety is a product decision, not a protocol one. Given the 2026-07-28 deprecation, be prepared to argue for simply not advertising the sampling capability at all.
## What sampling is Sampling is the MCP feature that lets a **server** ask the **client** to run a language-model completion on its behalf. The server sends the messages it wants completed; the client runs them against a model it already has access to and returns the generated text. The point of the arrangement is that the server never needs an LLM provider API key of its own, and the client keeps control over which model runs, what it costs, and what leaves the machine. That arrangement only works as a trust boundary if a person is actually in the loop, which is why the specification attaches human-review guidance to sampling specifically. ## Where the request shows up in revision 2026-07-28 This matters because it changes who is in a position to review. Before 2026-07-28, a server could send a `sampling/createMessage` **request** to the client at any time — servers could initiate JSON-RPC requests. Revision 2026-07-28 removed server-initiated requests entirely. A sampling request now arrives as one entry in the `inputRequests` map of an `InputRequiredResult` returned from a `tools/call`, `prompts/get` or `resources/read` that the client itself started. The client is therefore always mid-way through an operation it chose to begin, holding the interim result in hand, deciding whether to go on. The review point is structurally guaranteed rather than bolted on. ## Review point one: before the model runs The client should surface the request to the user and allow three outcomes: approve as-is, **edit the prompt** and then approve, or reject. Editing is not a nicety. The messages and system prompt in a sampling request are authored by the server — a third party — and approving them unchanged means letting a remote party write instructions straight into your model with your credentials behind them. A reviewer who can see and change that text can strip an instruction they do not want executed, remove context they do not want spent, or cut a request down to size. The reviewer should also be shown **which server** the request came from. Note that self-reported identity fields such as `io.modelcontextprotocol/serverInfo` are explicitly untrusted in 2026-07-28, so the trustworthy label is the one the host derives from its own configuration, not the name the server sends. ## Review point two: before the completion is returned The second gate is easy to forget and is the one that protects data rather than budget. The completion is generated on the client's side, from whatever context ended up in the prompt, and then handed to the server. That is an outbound channel: anything the model writes goes to the remote party. So the user should be able to see the completion, and edit or redact it, before it is delivered. Related to the same concern, the `includeContext` values `"thisServer"` and `"allServers"` were deprecated in 2026-07-28 in favour of omitting the field or using `"none"`, precisely because pulling extra context into a server-requested completion widens what can flow back out. ## SHOULD, not MUST — and why that is not a loophole All of this is advisory in the specification's own terms. MCP is a wire protocol; it can describe a message but it cannot make a desktop application draw a dialog. The consistent position across the specification is that the **host** is the enforcement boundary for consent, and no protocol field proves that a human saw anything. Two consequences follow. First, a server must not be written as though approval is guaranteed — it has to cope with never getting a response. Second, a client that skips review is not violating a parser rule, it is failing its users; the quality of the host is the whole safety story here. ## How a refusal is expressed Because there is no server-initiated request in 2026-07-28, there is also no response to send a rejection in. If the user says no, the client simply does not retry the original request. The server sees nothing further and eventually treats the operation as abandoned. There is no decline error, no reason string, and no way for the server to distinguish a deliberate refusal from a crashed client. ## Practical notes for a client implementation Show the actual prompt text rather than a summary; make the edit box the same box the user reads from; show token cost or a per-server budget alongside the approve button so the decision is informed; and keep a log of what was approved so an unattended run can be audited afterwards. Finally, remember that sampling as a whole is deprecated as of revision 2026-07-28, so a client may reasonably decide the safest human-in-the-loop policy is not to advertise the `sampling` capability at all.
- Why is reviewing the completion on the way out as important as reviewing the prompt on the way in?Because the outbound direction is a data channel. The completion is generated on the client's side from the client's context and then handed to a remote server, so anything the model writes leaves the machine. Reviewing and redacting it before delivery is the only place that flow can be stopped. The deprecation of the `includeContext` values "thisServer" and "allServers" in 2026-07-28 reflects the same concern.
- Can a server tell whether the client actually showed the user an approval dialog?No. Nothing in the protocol carries proof of review, and self-reported client identity in `io.modelcontextprotocol/clientInfo` is explicitly untrusted in 2026-07-28. A server has to be written so that it works whether the response comes back instantly, after a long human pause, or never at all. Treating an approval as guaranteed is a design error on the server side.
- How does the 2026-07-28 removal of server-initiated requests change where the review happens?It makes the client the structural gate. Previously a server could push a `sampling/createMessage` request at any moment, so the client had to interrupt whatever it was doing. Now the sampling request comes back as an interim `InputRequiredResult` for an operation the client itself started, so the client is already holding the result and simply decides whether to continue.
saying these in an interview costs you the question
- Claims MCP enforces sampling approval at the protocol level
- Thinks only the prompt needs review, not the completion
- Assumes approval means accept-or-reject with no editing
- Says the server can detect that a user approved
- Describes sampling as a request the server pushes at any time