MCP Elicitations in Spring AI: Request Missing Information from Users

Dan Vega · Intermediate ·🛠️ AI Tools & Apps ·4mo ago
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 AI Lessons

35 ChatGPT Prompts for Wealth Managers: Strengthen Client Relationships, Sharpen Analysis, and Scale Your Practice
Wealth managers can leverage ChatGPT with 35 tailored prompts to enhance client relationships, analysis, and practice scalability, freeing up time for high-value tasks
Dev.to AI
I Built an Open-Source AI Tools Directory with 850+ Tools — Here's Why and How
Learn how to build an open-source AI tools directory with 850+ curated tools using Next.js, Prisma, and Supabase
Dev.to AI
Your Tech Stack Has an AI Problem: How to Audit and Fix It in 2026
Learn to identify and fix AI-related issues in your tech stack to stay competitive in 2026
Dev.to · Lycore Development
If you follow my Linux and DevOps articles — this one is different. I built something. Let me tell you about it.
Learn how to build a Yellow Pages for AI tools using FastAPI, Meilisearch, and Redis
Dev.to AI
Up next
How AI Is Transforming ITSM And ITIL 5 | Future Of IT Service Management With AI | Simplilearn
Simplilearn
Watch →