Skip to main content
Glama

E-commerce MCP Server

README.md1.65 kB
# E-commerce Chatbot with MCP Server (Model Context Protocol) This project refactors your existing LangChain + FAISS vector database e-commerce chatbot to use MCP (Model Context Protocol) server for real-time product data access. ## Key Changes ### Removed: - FAISS vector database and embeddings - Static JSON file loading - Vector similarity search ### Added: - MCP Server for MongoDB integration - Real-time product queries - Structured database operations - MongoDB text search indexing ## Features - **Real-time Data**: Always up-to-date product information - **Structured Queries**: Price range, category filtering - **Product Recommendations**: Based on category and price similarity - **Text Input**: Supports text queries - **Session Management**: Maintains conversation context - **Coreference Resolution**: Handles pronouns and references ## Setup 1. Install dependencies: ```bash pip install -r requirements.txt ``` 2. Set up environment variables in `.env` 3. Start MongoDB: ```bash docker-compose up mongodb -d ``` 4. Run the application: ```bash uvicorn main:app --reload ``` ## API Endpoints - `POST /api/v1/chat/` - Text-based chat ## Benefits of MCP Integration 1. **Real-time Inventory**: Always current stock levels 2. **Complex Queries**: Price ranges, category filters 3. **Better Performance**: Optimized database queries 4. **Scalability**: Direct MongoDB connection 5. **Flexibility**: Easy to extend with new query types The MCP server provides a clean abstraction layer between your LLM and database, enabling more sophisticated product queries while maintaining the conversational interface your users expect.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Noyonchandrasaha/MCP-E-commerce-Chatbot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server