mcp-demo-refrigerator-inventory-mgmt
This project is a demo showcasing the integration between an AI chatbot and a Spring Boot application. It provides inventory management functionality for refrigerators, responding to queries through an AI model backed by a PostgreSQL database. Utilizing the MCP framework, it leverages a locally running LLM.
GitHub Stars
0
User Rating
Not Rated
Favorites
0
Views
31
Forks
0
Issues
0
๐ง MCP Demo: Refrigerator Inventory Management
A demo project showcasing integration between an AI chatbot and a Spring Boot application using the Model Context Protocol (MCP) framework. It provides inventory management functionality for refrigerators by answering queries through an AI model, backed by a PostgreSQL database.
๐ ๏ธ Tech Stack
- Java / Spring Boot
- MCP Server / Client
- PostgreSQL / NeonDB
- Ollama with
llama3.2(local LLM) - Swagger UI (for testing endpoints)
๐ Project Setup
1. Set Up PostgreSQL
You can either:
- Run PostgreSQL locally
- Use Docker to spin up a PostgreSQL container
- Connect via a hosted DB service like NeonDB
Make sure your database is properly configured and running.
2. Set Up Local LLM with Ollama
Install and run Ollama for local LLM support:
> ollama list
> ollama pull llama3.2:latest
> ollama run llama3.2
๐ก
llama3.2is around 2GB and runs locally for freeโno API key required!
3. Run the Applications
Make sure you run all three components:
refrigerator-inventory-coremcp-servermcp-client
Each should be correctly configured to communicate with the database and each other.
โ Verifying MCP with Local Data
๐ Step 1: Test AI Model is Running
Go to Swagger UI:
http://localhost:8082/swagger-ui/index.html#/ai-chat-controller
Click Try it out on the
chatendpointEnter:
{ "message": "What is the capital of India?" }You should see:
New Delhi
โ๏ธ Confirms the local
llama3.2is up and integrated.
๐ Step 2: Verify Response from Local Database
Navigate to:
http://localhost:8082/swagger-ui/index.html#/mcp-chat-controller/chat
Click Try it out and enter:
{ "message": "Product below 100 rupees" }Sample response:
Here are some products available below 100 rupees: 1. Eggs - priced at 10.0 rupees 2. Cucumber - priced at 40.0 rupees 3. Spinach - priced at 19.99 rupees 4. Gulaab Jamun - priced at 99.0 rupees
โ๏ธ This confirms that the MCP server retrieves and responds using your own database, not internet data.
๐ธ Screenshot

๐งพ Conclusion
The MCP Client connects to the MCP Server, which interacts with the refrigerator-inventory-core app and provides AI-generated answers based on your local database.
๐ฏ A practical demonstration of a local AI system working in real-time with your Spring Boot and PostgreSQL setup!
Software Engineer (Full Stack Java Developer). ====================== +Alumni : University of Hyderabad ====================== "Passionate About Technologies"
10
Followers
120
Repositories
0
Gists
0
Total Contributions