chatbot_Shopify
Agentic Shopify Chatbot with MCP integration, embedded directly into Shopify via a Theme Extension
claude mcp add --transport stdio mobeen-dev-chatbot_shopify docker run -i chatbot_shopify:latest
How to use
Shopify ChatBot is an intelligent commerce assistant that integrates with a Shopify storefront to provide natural language customer interactions, product discovery via a hybrid retrieval system, and autonomous actions such as cart management and checkout flows. The system uses a FastAPI server for the web API, OpenAI for conversational AI, FAISS for semantic search, and Elasticsearch for lexical search, with Redis for session management and MongoDB for chat history. To operate, the bot connects to Shopify GraphQL APIs to fetch live store data, query product catalogs, and manage customer orders. You can interact with the bot via the provided API endpoints to initiate chats, request product suggestions, or trigger agentic actions like creating or updating carts and initiating checkouts. The MCP server orchestrates the OpenAI response, routes queries through the hybrid retriever, and then delegates any required Shopify actions to the Shopify integration layer.
How to install
Prerequisites:
- Docker and Docker Compose
- Python 3.10+ (for local development if you choose to run components directly)
- Access to a Shopify Partner store and OpenAI API key
-
Clone the repository and navigate to the project root: git clone https://github.com/Mobeen-Dev/chatbot_Shopify.git cd chatbot_Shopify
-
Create and configure environment variables:
- Copy the example env file to a real env file and fill in credentials: cp credentials/.env.example credentials/.env
- Edit credentials/.env with your OpenAI, Shopify, database, and search service credentials
-
Install dependencies (if running components locally):
- Python dependencies (optional if using Docker): pip install -r requirements.txt
-
Run supporting services (using Docker Compose): docker-compose up -d redis mongodb elasticsearch
Ensure all services start correctly
-
Start the application (Docker-based):
- Build and run the Docker image as defined in Dockerfile/Docker Compose docker-compose build docker-compose up
-
Verify API endpoints (example):
-
Optional: for local development without Docker, run the FastAPI app directly: python src/server.py
-
For production deployment, follow the CI/CD and GitHub Actions guidance in the repository:
- Build and push Docker images
- Deploy using docker-compose.prod.yaml or your orchestrator of choice
Additional notes
Tips and common issues:
- Ensure your environment variables are loaded correctly (OpenAI, Shopify, MongoDB, Redis, and search services).
- If you encounter slow search performance, consider rebuilding the FAISS index or checking Elasticsearch cluster health.
- When running in production, tune LOG_LEVEL and APP_ENV to appropriate values and enable secure session handling with Redis.
- If Shopify API rate limits become an issue, implement retry strategies and caching of frequent queries.
- Monitor container logs with docker-compose logs to diagnose startup or runtime problems.
- The system relies on several services (Redis, MongoDB, Elasticsearch, FAISS). Ensure network connectivity and proper startup order.
Related MCP Servers
mysql_mcp_server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
Gitingest
mcp server for gitingest
mcp-chatbot
MCP Chatbot powered by Anthropic Claude. Delivering on‐demand literature search and summarisation for academics and engineers
skill-to
Convert AI Skills (Claude Skills format) to MCP server resources - Part of BioContextAI
scraper
Context-optimized MCP server for web scraping. Reduces LLM token usage by 70-90% through server-side CSS filtering and HTML-to-markdown conversion.
mcpbr
Model Context Protocol Benchmark Runner