MCP Elicitations in Spring AI: Request Missing Information from Users

Dan Vega · Intermediate ·🛠️ AI Tools & Apps ·6mo ago

Key Takeaways

This video teaches how to request missing information from users using MCP elicitations in Spring AI

Original Description

What happens when your MCP tool gets called but the user didn't provide all the required information? Before elicitations, it would simply fail. Now there's a better way. In this tutorial, you'll learn how to implement MCP Elicitations in Spring AI, a standardized approach for servers to request additional information from users during an interaction. We'll build a complete coffee shop ordering system where the MCP server dynamically asks for missing details like coffee size, type, and milk preference. 🎯 What You'll Learn: • Understanding elicitations in the MCP specification (form mode vs URL mode) • Building an MCP server with elicitation support using Spring Boot • Creating tool parameters with the @MCPTool and @MCPToolParams annotations • Testing elicitations in the MCP Inspector • Building a Spring AI client with the @MCPElicitation annotation • Handling elicitation requests and responses in a real application 📚 Resources: GitHub Repository: https://github.com/danvega/spring-ai-mcp-elicitation MCP Elicitations Docs: https://modelcontextprotocol.io/docs/concepts/elicitation Spring AI Reference: https://docs.spring.io/spring-ai/reference/ Spring Initializr: https://start.spring.io 👋🏻Connect with me: Website: https://www.danvega.dev Twitter: https://twitter.com/therealdanvega Github: https://github.com/danvega LinkedIn: https://www.linkedin.com/in/danvega Newsletter: https://www.danvega.dev/newsletter SUBSCRIBE TO MY CHANNEL: http://bit.ly/2re4GH0 ❤️
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

Up next
What is Telematics Explained with Examples
VLR Software Training
Watch →