Get the FREE Ultimate OpenClaw Setup Guide โ†’

spring-boot-ai

๐Ÿ€ ๐Ÿค– Spring Boot AI - Evaluation Testing

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rogervinas-spring-boot-ai docker run -i rogervinas/spring-boot-ai:latest \
  --env JAVA_OPTS="-Xms512m -Xmx1g" \
  --env SPRING_PROFILES_ACTIVE="default"

How to use

This MCP server is a Spring Boot AI example that exposes an MCP-compliant service for building AI-powered agents. It wires together a local Weather tool, a Clock tool, and a remote Booking tool via an MCP client/server setup, enabling a chat agent to reason about real-time dates, weather, and reservations. The server demonstrates how to register tools with Spring AI using @Tool and @ToolParam, expose them to an MCP-enabled agent, and combine local and remote tools (via an MCP client connection) with Retrieval Augmented Generation (RAG) for context. You can interact with the MCP server by running the container or application and using the MCP protocol to invoke the available tools from an agent that queries weather, tells the date, or books accommodations through the remote Booking tool.

How to install

Prerequisites:

  • Docker installed on your system (for the recommended docker-based run)
  • Optional: Java 21/OpenJDK if you prefer running the Spring Boot app directly
  • Basic knowledge of MCP and Spring AI concepts

Recommended setup via Docker:

  1. Pull and run the Docker image (or build locally if you prefer): npm or curl not required; use the docker command shown in the mcp_config

  2. Verify the container starts and exposes the MCP server endpoint (port 8080 by default in many Spring Boot setups). You may need to adjust port mappings depending on your environment.

  3. If you prefer to run locally from source, clone the repository and start the app:

# From project root
./mvnw -q spring-boot:run
# or with Gradle if configured
./gradlew bootRun
  1. Ensure the remote Booking MCP server is reachable if you want to exercise the Booking tool. Configure the MCP client in application.yml (as shown in the README) to point to the remote server's URL.

  2. Once running, use MCP client interactions to list tools and invoke methods such as getWeather, getClockDate, or book a reservation via the remote Booking tool.

Additional notes

Tips and common considerations:

  • If you run via Docker, ensure the container has network access to the remote Booking MCP server (host networking or appropriate port mappings).
  • The Weather and Clock tools are implemented locally; the Booking tool is remote and configured via MCP client settings in application.yml as described in the README.
  • For RAG, ensure your vector store (e.g., PGVector) is properly configured and accessible by the Chat Server if youโ€™re combining weather/date context with retrieved information.
  • If you encounter MCP client connectivity issues, verify the SSE connection URL in your application.yml and ensure the remote server is up and reachable.
  • Environment variables can be used to tweak model selection, logging verbosity, and Spring profiles during deployment.

Related MCP Servers

Sponsor this space

Reach thousands of developers โ†—