Complete Intro to MCP

Roots, Sampling, & Elicitation

Brian Holt
Databricks
Complete Intro to MCP

Lesson Description

The "Roots, Sampling, & Elicitation" Lesson is part of the full, Complete Intro to MCP course featured in this preview video. Here's what you'd learn in this lesson:

Brian discusses additional MCP features, including Roots, Sampling, and Elicitation. Roots are a formal way to expose a specific directory of your file system to an LLM, giving it access to operate on any files within that designated folder. Sampling is a feature that allows MCP servers to directly prompt the LLM with tasks (like code refactoring), while requiring human approval for both the initial prompt and the response sent back to the server. Elicitation enables MCP servers to ask users follow-up questions to gather specific information needed to complete tasks, rather than relying on the LLM to infer or correlate missing data.

Preview
Close

Transcript from the "Roots, Sampling, & Elicitation" Lesson

[00:00:00]
>> Brian Holt: Let's talk about future features of mcp, at least ones that they're planning so far. So, first of all, here's a list of all these clients. So we've been using Claude Desktop, this one here. And you can see it supports the first three resources, prompts and tools, but it does not support discovery, sampling, routes or elicitation.

[00:00:25]
So Roots, what I'm gonna say about the way that they've been developing MCP cuz it's developed by Anthropic, right? There's a product manager at Anthropic that's thinking about MCP Server. They're generally saying, like, what do we do in Cloud Desktop? What do we do in Cloud code? What are they doing in Cursor?

[00:00:42]
And then whatever the toolmaker themselves is developing, let's just expose it as a generic primitive that anybody can use, right? So Roots is basically saying, like, here is a directory. Anything inside of this directory, go ahead and you can modify. You can see, you can do all that kind of stuff, right?

[00:00:59]
So imagine it's like opening VS code in a directory. You can use VS code to modify any file in that directory, or the agent mode of VS code can modify any file in that directory. That's just a root, right? It's a root of a directory of folders that you can use.

[00:01:15]
So they're going to expose that as a primitive that now Cloud Desktop can use or anybody. Here's some subset of the file system that you're allowed to see, modify, update, read, delete, all those kind of things. And I left some notes here if you wanna learn more about routes, that's all available here for you to check out.

[00:01:36]
It makes more sense in the context of something like Cursor, right? It makes less sense. Like you're not gonna tell Claude Desktop. I mean, I guess you could, he's like, here's all of my Excel documents. You can see anything in here. Now let's answer some questions about that, right, but as of yet, Cloud Desktop does not support that sampling.

[00:01:57]
When you see the word sampling, what do you think it means? It's a trick question, because whatever you thought of is probably wrong, because at least I don't like the name sampling because it doesn't really inspire what it actually means. It's the ability for your MCP server to prompt the LLM directly, right?

[00:02:18]
So let's say you have an MCP server that looks at code and then decides things that are wrong with it. That's all it does. You can make a sampling call to the LLM directly, here's this piece of code. Here's what's wrong with it, please fix it. Now, you, the human, it could just pass it back to you, the human.

[00:02:41]
You, the human could then prompt the LLM again to go fix it, right? That would all work. Sampling allows you to cut the human out there and just say MCP server, call the LLM to do a thing, right, or it can say, I mean, whatever you want. But that's the idea is it just allows your MCP servers to directly ask the LLM questions.

[00:03:06]
Now, what's cool about this is you can see about the MTP server is about to call the LLM with this prompt. It'll show that to you, and you, the human can go in and modify it and then it'll do it and then it'll come back. The LLM has responded this.

[00:03:22]
You can also modify the output before it goes back to the MCP server. So you, the human, are in control of every step there, which is pretty cool. So, yeah, initiate sampling, Human Laroop Review Model interaction response review complete request. So that's kind of the whole thing there.

[00:03:44]
And at every point you can stop it, you can edit it, you can do anything you want there. So sampling is the name of that workflow. Again, this word sampling has come up multiple different ways with AI and they all mean very different things. So be very cautious of this word sampling, it means very different things in different contexts.

[00:04:09]
I'm very excited. This one actually will be very useful whenever it lands cuz it makes your MCP server a lot more powerful that it can start doing AI interactions itself, right? Which is cool. Yeah.
>> Student: Does it still require human in the loop for every interaction then? So every time it's going to prompt you, you'll say, okay, and then it'll send that along to the LLM.

[00:04:28]
>> Brian Holt: It's part of the protocol that the human should always be in the loop. However the client chooses to implement it is totally up to the client. So, for example, CLAUDE code should ask you every single time, like when it's using tools and all that kind of stuff.

[00:04:42]
But you can say, yolo, just do it. I don't care. Yeah, right. But it is part of the protocol that there should be human in the loop review. Let's talk about elicitation. I don't know why they chose such silly words for these. I feel like there's better words.

[00:04:55]
They should just ask an LLM, what's a better word for elicitation? But they didn't elicitation mean it's just a fancy word of your MCP server can ask follow up questions. Let's say you're like, hey, please fill out this form for me. Right now, if I gave it a webpage with comment, some sort of autonomous browser, it's like, fill out this form for me, it would have to come back and say, what do you wanna put in the form?

[00:05:19]
Right? That would be an elicitation, right? It's the LLM or the MCP server coming back to you. Say like, I need more information from the end user for me to complete this request. So it allows you to pause your tool call essentially and say, get more information from user continue tool call.

[00:05:37]
That is an elicitation.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now