Sampling (MCP)
Definition
An MCP feature that lets a server ask the client's model to generate a response, so the server needs no model API key of its own.
In more detail
The server sends sampling/createMessage with messages and model preferences, such as name hints and priorities for cost, speed and intelligence, and the client chooses the actual model. The 2025-11-25 specification also lets the request include tools, so a server can run a small agent loop through the host's model, and it says a person should be able to review and deny each request.
The 2026-07-28 specification deprecates sampling, along with roots and logging. It keeps working during the deprecation window, but new servers are told to call a model provider's API directly instead.
Related terms
Elicitation (MCP)
An MCP feature that lets a server ask the user for more information during a request, through a form in the client or a link to a web page.
Human in the loop
A design in which a person reviews or approves an AI system's actions or outputs at defined points before they take effect.
MCP client
The component inside a host application that holds a connection to a single MCP server and relays messages to and from that server.
MCP server
A program that exposes tools, resources or prompts to MCP clients, running locally over stdio or remotely over HTTP, so any MCP host can use them.
Read more about Sampling (MCP)
- What changed in MCP 2026-07-28: a stateless protocol
The July 2026 MCP specification removes the handshake and sessions, adds server discovery and deprecates roots and sampling. What it means for you.
- Model Context Protocol
Connecting AI applications to tools and data through MCP servers and clients.
- MCP client
The component inside a host application that holds a connection to a single MCP server and relays messages to and from that server.