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 24,900 courses taught by industry experts.

Testing a new MCP elicitation

Testing a new MCP elicitation

- Okay, so what does that look like? I'll create a new chat, and say, "Start the calculator." It spins up the MCP server, and then it says, "Let's do some math. Please provide the numbers and operation you would like to perform." Remember, that's the message up here, "Let's do some math. Please provide the numbers." So in ctx.elicit, the message is what shows up in the client as the message to the user. Click Respond. It now says First Number, and one of three because in this case, we have three inputs. We have first, second, and operation. So we'll say the first number is 98, the second number is three, and the operation, I'll say asterisk here to say multiply. That information is passed back in, Python does its thing, and out I get a response. 98 x 3 is 294, which I'm going to assume is correct. This is how it works. And what you see is it's really straightforward. You set up a tool, you then call in context, you then set up context, elicit, then declare a message, define what types…

Contents