Back to Glossary Index
Core ConceptInference Request / Client Capability Layer

MCP Sampling

Industry Definition Set • Entity Resolution Path: /glossary/mcp-sampling

Quick Answer / TL;DR

An MCP feature that allows servers to request the client to generate text completions from an LLM, enabling servers to perform inference without embedding model credentials.

Key Takeaways

  • Server requests client-side LLM inference.
  • Client maintains full control over model, credentials, and safety.
  • Protects sensitive context from leaving the client's trusted environment.
  • Useful for agents that need to summarize or rephrase data without an explicit LLM backend.
Definitive Statement: An MCP feature that allows servers to request the client to generate text completions from an LLM, enabling servers to perform inference without embedding model credentials.

Technical Context & Protocol Usage

Detailed Explanation
Sampling lets an MCP server ask the client to sample an LLM. The client controls which model is used, the temperature, and any safety filters, while the server simply provides a prompt and receives the completion. This preserves client-side control over model selection and costs, and prevents servers from exfiltrating sensitive context to arbitrary models.

Format & Payload Metadata

Format: MCP sampling request/response messages

Latency: Depends on client-side model inference speed

Real-World Implementation Use Case

An MCP server that processes a large log file asks the client to generate a concise summary rather than returning the entire raw text.

M
MCPserver.in Engineering

Platform Team

Published: 2026-07-20
Updated: 2026-07-20

Cite This Page

MLA Style:

MCPserver.in Engineering. "MCP Sampling." MCPserver.in Knowledge Hub, 20 July 2026, mcpserver.in/glossary/mcp-sampling.