Sponsored by Deepsite.site

Spring MCP Server Demo

Created By
esurovtsev7 months ago
Remote MCP (Model Context Protocol) server built with Spring Boot and SSE. Demonstrates how to register tools, configure endpoints, and stream results to connected LLM clients using the Spring AI MCP SDK.
Content

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

# 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 is a tool that allows you to test your MCP server without needing to integrate with an LLM.

# 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!

# 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

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.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server