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

README
๐ŸงŠ 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.2 is around 2GB and runs locally for freeโ€”no API key required!


3. Run the Applications

Make sure you run all three components:

  • refrigerator-inventory-core
  • mcp-server
  • mcp-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 chat endpoint

  • Enter:

    {
      "message": "What is the capital of India?"
    }
    
  • You should see:

    New Delhi
    

โœ”๏ธ Confirms the local llama3.2 is 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

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

Author Information
Aaditya Bachchu Chatterjee

Software Engineer (Full Stack Java Developer). ====================== +Alumni : University of Hyderabad ====================== "Passionate About Technologies"

Hyderabad

10

Followers

120

Repositories

0

Gists

0

Total Contributions