intermediateMCP Advanced — Sampling, Elicitation, Resources, Prompts

What is MCP 'sampling', and why is it a notably different direction of control flow than a normal tool call?

Sampling lets an MCP SERVER ask the CLIENT's LLM to generate a completion on the server's behalf — inverting the usual direction where the client always initiates. This lets a server perform its own AI-driven logic (like summarizing something internally) while borrowing the client's already-configured model access rather than needing its own API key.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

What is MCP 'sampling', and why is it a notably different direction of control flow than a normal tool call?

Next Step

Continue to What is 'elicitation' in MCP, and what user experience problem does it solve?← Back to all Spring AI questions