MCPSERV.CLUB
rogervinas

Spring Boot AI MCP Server

MCP Server

AI Agent for Booking Accommodations with Spring AI and MCP

Active(76)
6stars
2views
Updated 18 days ago

About

A Spring Boot application that exposes an MCP server to provide booking, weather, and clock tools for a travel‑booking AI agent. It demonstrates Spring AI’s MCP integration, local tool implementation, and RAG for city data retrieval.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Diagram

Spring Boot AI is an MCP (Model Context Protocol) server that turns a Spring Boot application into a fully‑featured AI agent capable of interacting with external tools, data stores, and chat clients. By leveraging Spring AI’s MCP boot starter, the project exposes a set of tools—Clock, Weather, and Booking—through a lightweight HTTP API that Claude or any other MCP‑compatible assistant can invoke on demand. This solves the common problem of needing a custom integration layer between an LLM and domain‑specific services; instead, developers can simply annotate ordinary Spring beans with and let the framework handle serialization, routing, and security.

The server’s core value lies in its seamless blend of Retrieval Augmented Generation (RAG) and tool execution. While the Clock and Weather tools run locally, the Booking tool is delegated to a remote MCP server, demonstrating how multiple back‑ends can coexist under a single protocol. The vector store, initialized at startup, supplies contextual city data that the LLM uses to answer user queries more accurately. This architecture allows developers to mix and match models (e.g., Ollama locally, AWS Bedrock remotely) without rewriting business logic, simply by swapping configuration.

Key capabilities include:

  • Tool exposure: Any Spring bean method can be turned into a tool with minimal annotations, automatically generating the MCP schema.
  • Advisors and chat clients: The project integrates Spring AI’s Chat Client API, enabling the assistant to maintain conversational context and invoke tools as needed.
  • Testing support: Built‑in AI model evaluation utilities allow unit and integration tests to assert that tool calls are made correctly and responses meet quality thresholds.
  • Extensibility: Additional tools or vector stores can be added by adding new beans and updating the configuration, without touching the MCP implementation.

Real‑world scenarios for this server include travel agencies that need to book hotels on behalf of users, smart home systems that query weather or time data before taking actions, and internal knowledge bases where an LLM can fetch up‑to‑date information from a vector store. In each case, the MCP server acts as a bridge between conversational AI and enterprise services, reducing latency and eliminating the need for custom adapters.

Integration into existing AI workflows is straightforward: a Claude or other LLM client simply sends an MCP request describing the desired tool, and the Spring Boot server routes it to the appropriate bean. The response is returned in a standardized JSON format, ready for the LLM to incorporate into its reply. This tight coupling of language models with domain logic makes Spring Boot AI a powerful, developer‑friendly solution for building intelligent agents that can act, not just talk.