0Pricing
MCP Academy · Lesson

What Sampling Unlocks

Let a server delegate reasoning back to the model.

What Sampling Unlocks is a free MCP Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Flipping the Direction

Usually the model calls your tools. Sampling flips that: your server asks the model to generate text for it. 🔄

Borrow the Model You Already Have

With sampling, your server can use the host’s LLM without ever holding an API key. The client owns the model access.

No API Keys in Your Server

Because the client runs the completion, your server needs no provider credentials. That keeps secrets out of your code entirely.

Agentic Behavior, Nested

Sampling lets an LLM call happen nested inside a tool. Your tool can think with the model mid-task, not just return data.

A Tiny Example: Summarize

Imagine a tool that fetches a report, then asks the model to summarize it. The summarizing happens through sampling.

You Stay in Control of Cost

The client picks the model and pays for it, so the host decides cost, limits, and which model runs your request.

Server Delegates Reasoning

Think of sampling as the server saying: I have data, you have a brain. It delegates the reasoning step back to the model.

What You Can Ask For

A sampling request can ask the model for text, and clients may also support image or audio content in messages.

It Is Opt-In on the Client

Sampling only works if the client declares the sampling capability at startup. Not every host enables it.

"capabilities": {
  "sampling": {}
}

Why It Matters

Sampling unlocks smart, self-contained servers: data tools that can reason, classify, and write — powered by the user’s own model.

The Catch: Trust

Because servers can trigger model calls, there must be a human able to approve them. You’ll see that safety flow soon.

Quick Check

Quick gut check on what sampling really does.

Recap

Sampling flips control: your server asks the host’s model to think for it — no keys, opt-in, and always with a human able to approve. ✅

Frequently asked questions

Is the “What Sampling Unlocks” lesson free?

Yes — the full text of “What Sampling Unlocks” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “What Sampling Unlocks”?

Let a server delegate reasoning back to the model. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “What Sampling Unlocks” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What Sampling Unlocks
  2. Request a Completion from the Host
  3. Shape Messages & Preferences
  4. Human-in-the-Loop Approval
← Back to MCP Academy