Skip to content

MCP Sampling and Elicitation

Client features that let MCP servers ask the host for a model completion or request information from the user.

Editorial team 1 min read

Most MCP traffic flows from client to server. But the protocol also lets servers make certain requests back to the client, always under the host's control.

Sampling

With sampling, a server asks the host to run a model completion. For example, a server might need to summarise a document it fetched.

Benefits:

  • Servers can use AI without their own model API keys.
  • The user's chosen model and host policies apply.

Safeguards:

  • The host decides whether to allow the request and may show it to the user.
  • The host controls which model is used and what context is included.

Elicitation

With elicitation, a server asks the host to collect information from the user mid-task — such as a missing parameter or a confirmation — through a structured form.

Safeguards:

  • The host presents the request and the user can decline.
  • Servers shouldn't request sensitive data such as passwords through this route.

Roots

Clients can also tell servers which directories or locations are in scope, helping servers stay within bounds.

Support Varies

Not every host implements every client feature. Servers should check declared capabilities and degrade gracefully.

More in MCP

All MCP guides →
MCP Guide · 1 min

MCP Architecture: Hosts, Clients and Servers

How the Model Context Protocol is structured: the host application, the clients it creates and the servers that expose capabilities.

MCP 1 min read 2 Sep 2025

MCP Guide · 2 min

MCP Tools, Resources and Prompts

The three main things an MCP server can offer, who controls each, and when to use which.

MCP 2 min read 1 Sep 2025

MCP Guide · 1 min

MCP Transports: stdio and HTTP

How MCP messages travel: standard input and output for local servers, HTTP for remote ones, and how to choose.

MCP 1 min read 31 Aug 2025

MCP Guide · 1 min

Building Your First MCP Server

A walkthrough of the steps to create a simple MCP server that exposes a tool, and how to test it.

MCP 1 min read 30 Aug 2025