MCP Elicitations in Spring AI: Request Missing Information from Users
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
Dev.to AI
I Built an Open-Source AI Tools Directory with 850+ Tools — Here's Why and How
Dev.to AI
Your Tech Stack Has an AI Problem: How to Audit and Fix It 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.
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI