Building an AI Chat Agent with MCP, Spring AI A developer built an AI chat agent using Model Context Protocol (MCP), Spring AI, and Google Gemini to answer weather questions with real tool integration. The system includes a Spring Boot MCP server exposing weather and geocoding tools, and an AI agent that uses Gemini to decide when to call these tools, preventing hallucination. The project demonstrates a scalable architecture for production AI assistants. Model Context Protocol MCP is an open standard for connecting AI apps to tools and data sources. A useful way to think about it is as a USB-C port for AI: one standard interface that lets different models plug into different capabilities without custom glue code for every integration. In this project, we combine MCP, Spring AI, and Google Gemini to build a chat app that can answer weather questions using real tools instead of hallucinating. The system has three parts: The result is a small but realistic architecture you can extend into a production assistant. User Browser:3000 | POST /api/chat v AI Agent Spring:7171 -- MCP / Streamable HTTP -- MCP Server Spring:7170 | | | Google Gemini | Bright Sky API weather | | OpenStreetMap Nominatim geocoding v v Chat response Tool execution The full source code is available on GitHub https://github.com/ykpraveen/mcp-spring-sample . The tool server is a Spring Boot application that exposes MCP tools through Spring AI's annotation scanner. It runs on port 7170 and uses Streamable HTTP for transport.