spring-ai -demo
MCP server example for Agentic AI demo with Java & Spring
claude mcp add --transport stdio ramzus-spring-ai-mcp-server-demo docker run -i spring-ai/oms-mcp-server:latest
How to use
This MCP server demo wires together two Spring Boot-based MCP servers: one for Order Management (OMS) and one for Incidents. They act as AI-driven integration points that let conversational agents issue actions against real business APIs via the MCP (Model Context Protocol) layer. In this setup, you typically run the services with Docker Compose to spin up the microservices, frontends, and the data store, then connect your AI assistant to render natural-language prompts into concrete API calls and workflows. You can verify basic health and interact with the two MCP endpoints to trigger order, payment, and incident operations through natural language commands.
Once running, you can experiment with prompts such as: ask the OMS MCP to fetch pending orders, instruct the Incident MCP to create an incident, or request a payment for a specific order. The MCP layer translates these conversations into RESTful API calls to the underlying Spring Boot services (orders, payments, incidents) and returns structured results that the AI agent can present back to you. The demo emphasizes real operations (not mocks) and includes a production-minded stack with health checks and container orchestration.
How to install
Prerequisites: Docker Desktop installed and running, Git available on your machine, and network ports available as described in the README (5173-5175, 8081-8083, 8085, 27017).
Step-by-step:
-
Clone the repository or download the demo: git clone <repository-url> && cd <project-directory>
-
Prerequisites check:
- Ensure Docker is running and you have permission to run containers.
- Make sure the required ports are not in use by other services.
-
Start the stack with Docker Compose (recommended for this demo):
Navigate to project directory
cd agentic-ai-demo
Build and start all services in detached mode
docker-compose up --build -d
-
Verify services are up: docker-compose ps
Optional: check health endpoints
curl http://localhost:8081/actuator/health curl http://localhost:8082/actuator/health curl http://localhost:8083/actuator/health
-
Alternative: Run individual MCP servers as Docker containers (if not using compose): docker run -d --name oms-mcp-server -p 8081:8081 -p 8085:8085 spring-ai/oms-mcp-server:latest docker run -d --name incident-mcp-server -p 8083:8083 -p 8085:8085 spring-ai/incident-mcp-server:latest
-
Connect your AI assistant by configuring MCP server endpoints as described in the docs. For VS Code integration, you would point the MCP client to the -jar based servers or to the REST endpoints exposed by these containers.
Additional notes
Tips and notes:
- Ports: Ensure 5173-5175 (frontends), 8081-8083 (APIs), 8085 (MCP), and 27017 (MongoDB) are available as described in the README.
- If you modify environment configs or memory limits, adjust Docker resources accordingly.
- Health checks: Rely on the Spring Actuator endpoints to monitor backend health; containers may auto-restart if unhealthy.
- If you need to rebuild MCP servers after code changes, use the docker-compose build step or build the jars locally and point the containers to the updated images.
- The MCP is designed to bridge natural-language prompts to real business operations; ensure your AI assistant prompts stay within the supported operation set (orders, payments, incidents).
- For troubleshooting, inspect container logs with docker-compose logs -f or docker logs <container-name>.
Related MCP Servers
mcp-for-beginners
This open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
sonarqube
SonarQube MCP Server
wanaku
Wanaku MCP Router
api2mcp4j
This is a revolutionary AI MCP plugin with excellent pluggable and encapsulated features. With just a few lines of configuration, it can easily integrate into your Spring boot web program and give it MCP capabilities,inheriting the powerful engineering capabilities of the Spring series framework
WigAI
Bitwig Controller Extension that provides an MCP Server for AI Agent control
vertx
A Vert.x MCP Server built on top of MCP Java SDK