From the course: Unboxing AI: Build a Remote MCP Server from Zero to Deployed with OAuth

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Demo: MCP sampling in VS Code

Demo: MCP sampling in VS Code

- Let's try that server and see what happens. So I'll type in, "Write me a haiku." (keyboard clacking) Let's use the haiku generator. I'll click Continue. "Let's create a haiku! Please tell me which animal you'd like the haiku to be about." Click Respond, duck, Return. The system now generates a haiku for me using the sampling model. So this is not GitHub Copilot generating it. This is the sampling generating it, see? And it's happening, yeah. So it's an interesting phenomenon. And this example is contrived in the extreme, but it is, what's happening. You're passing information and sending instructions through a separate model. You're getting a response that gets passed on to the actual agent, the agent then outputs that response. Again, like with elicitation, the opportunities and possibilities here are currently, because this is all in draft, really widely open. So you can do a lot of interesting things. Like, you can have an MCP server that's controlled by one agent, use a separate…

Contents