# Spring MCP Server Demo A simple demonstration of how to build a remote Model Context Protocol (MCP) server using Spring Boot and Java. This project showcases how to implement and expose tools that can be called by AI models through the MCP protocol. ## What's Inside - Complete MCP server implementation using Spring AI - Tool registration and callback handling - RAG search service as a practical example tool - Docker support for easy deployment ## Quick Start ```bash # Run with Maven mvn spring-boot:run # Or build and run the JAR mvn clean package java -jar target/mcpserver-0.0.1-SNAPSHOT.jar ``` The server will start at http://localhost:8080 ## 🧪 Testing with MCP Inspector The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a tool that allows you to test your MCP server without needing to integrate with an LLM. ```bash # Run the Inspector with your MCP server npx @modelcontextprotocol/inspector ``` This will start the MCP Inspector web interface (typically at http://127.0.0.1:6274) ## Docker Support Want to run this in Docker? No problem! ```bash # Build and package everything in one go ./docker-build.sh # Run the container docker run -p 8080:8080 mcp-server:latest ``` That's it! Your MCP server will be available at http://localhost:8080. ## Available Tools ### Search Searches through documentation files in the RAG directory. **Parameters:** - `query`: The search term **Returns:** A list of relevant text snippets from the documentation ## How It Works This demo uses Spring AI's MCP server capabilities to expose tools that can be called by AI models. The server implements the Model Context Protocol, allowing AI models to discover and use the tools provided by this server. The RAG search tool demonstrates how to implement a practical tool that can enhance an AI model's capabilities by providing access to specific information sources.