9
Sampling
One of the most powerful features of MCP is sampling. What does that mean, first of all? Well, let’s take a look at the definition of the word and deduce from there. Merriam-Webster defines sampling as follows:
“the action or process of taking samples of something for analysis”
Okay, so we need a sample, and we end up analyzing said sample, understood. With this definition in mind, let’s talk about it in the context of MCP. In MCP, sampling means the server is sending a sampling request, a sample for analysis, to the client. Why does the server do that? It’s simple; the server needs the client’s help with some things. Because the client is the one with the LLM (even though a server can have an LLM sometimes), the server delegates ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access