Greetings! In the previous article, we learned the concepts behind Model Context Protocol (MCP). In this article, we'll focus on Spring AI and see how easily it can expose Java methods as MCP tools and consume remote MCP servers. Architecture Part 1 - MCP Server Dependency Note that we don't need AI models in the MCP server. gradle implementation "org.springframework.ai:spring-ai-starter-mcp-server-webmvc" Configuration yaml server : port : 8080 spring : application : name : movie-mcp-server ai : mcp : server : name : movie-mcp-server version : 1.0.0 type : SYNC protocol : STREAMABLE instructions : > Provides tools for listing, finding, searching, and filtering movies. streamable-http : mcp-endpoint : /mcp Repository java public record Movie ( Long id, String title, String director, int releaseYear, String genre, ...
May all beings be happy, be well, be peaceful, and be free