Pattern
MCP sampling and roots
Use MCP's client-directed capabilities — sampling, which lets a server ask the client to run an LLM call on its behalf, and roots, which let the client grant a server a bounded set of directories — so servers can reason and act without holding their own model credentials or unbounded filesystem access.
Classification — Server-initiated capabilities: sampling (LLM callbacks) and roots (scoped grants).
Full entry
The complete treatment — problem, how it works, when to use it, sources, and examples — lives in the volume below.
Browse the full pattern index or the catalog.