← MCP & Integration
Sampling (MCP)
MCP sampling allows an MCP server to request a model completion from the host application rather than calling a model API directly. The server sends a sampling request containing a messages array and optional model preferences, and the host — which already has the model connection — executes the completion and returns the result. This design keeps credentials and model access centralized in the host while allowing servers to leverage LLM capabilities for tasks like classification, summarization, or generation within a tool implementation.