Sampling (MCP)
Sampling is a Model Context Protocol primitive that lets an MCP server ask the client to run a completion against the client's own LLM, rather than the server needing its own model access -- useful when a server's tool needs an AI-generated judgment call partway through a task. The MCP specification requires that sampling requests go through the human in the loop: a client implementing sampling must let the user review and approve both the prompt being sent and the completion coming back before it's used, rather than silently fulfilling the server's request. This mirrors the consent requirement the specification places on ordinary tool calls, and for the same reason -- a server a client didn't fully vet could otherwise use sampling to generate and act on content the user never saw.
By AdminKit team, Netbase JSC · Updated