- ๐๏ธ MCP - MCP for Commerce Platforms - Universal E-commerce Customer Support Assistant
๐๏ธ MCP - MCP for Commerce Platforms - Universal E-commerce Customer Support Assistant
title: E-commerce Customer Support MCP emoji: ๐๏ธ colorFrom: blue colorTo: purple sdk: gradio sdk_version: 5.33.0 app_file: app.py pinned: false license: mit tags: ["mcp", "commerce", "customer support" ]
๐๏ธ MCP - MCP for Commerce Platforms - Universal E-commerce Customer Support Assistant
One Chat, Every Platform - A platform-agnostic customer support assistant that connects to any e-commerce platform through pluggable strategies, using MCP (Model Context Protocol) server and Gradio for the interface.
๐ฏ Features
- ๐ฆ Order Management: Track orders, check status, view history
- ๐ Returns & Refunds: Initiate returns, process refunds seamlessly
- โ Cancellations: Quick and easy order cancellations
- ๐ฌ Natural Language: Conversational interface for customer support
- ๐ Platform Agnostic: Extensible to any e-commerce platform
- ๐ Auto-Deploy: Continuous deployment to Hugging Face Spaces
๐๏ธ Architecture
The system uses a Strategy Pattern to abstract different e-commerce platforms:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gradio UI Layer โ
โ (Customer Support Conversational Interface) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Server Core โ
โ (Order Management, NLP Processing, Context Engine) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ E-commerce Strategy Interface โ
โ (MockData, Shopify, Magento, WooCommerce, etc.) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Prerequisites
- Python 3.10 or higher
- Git
- Virtual environment tool (venv)
Installation
-
Clone the repository
git clone https://github.com/slavpilus/mcp.git cd mcp -
Run the setup script (macOS/Linux)
chmod +x scripts/setup_dev.sh ./scripts/setup_dev.shOr manually:
# Create virtual environment python -m venv venv # Activate virtual environment # On macOS/Linux: source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements-dev.txt # Install pre-commit hooks pre-commit install -
Configure environment variables
cp .env.example .env # Edit .env with your configuration -
Run the application
python app.pyThe application will be available at
http://localhost:7860
๐ ๏ธ Development
Project Structure
mcp/
โโโ .github/workflows/ # CI/CD pipelines
โโโ mcp_server/ # Core MCP server implementation
โ โโโ strategies/ # E-commerce platform strategies
โ โโโ models/ # Data models
โ โโโ utils/ # Utility functions
โโโ ui/ # Gradio UI components
โโโ tests/ # Test suite
โโโ app.py # Main Gradio application
โโโ requirements.txt # Python dependencies
Development Workflow
-
Activate virtual environment
source venv/bin/activate # macOS/Linux # or venv\Scripts\activate # Windows -
Make your changes
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
-
Run code quality checks
# Format code black . isort . # Run linter ruff check . # Type checking mypy mcp_server ui -
Run tests
# Run all tests with coverage pytest # Run specific test file pytest tests/unit/test_strategies.py # Run with verbose output pytest -v -
Commit changes
git add . git commit -m "feat: your feature description"Pre-commit hooks will automatically run code quality checks.
Code Style
This project uses:
- Black for code formatting (line length: 88)
- isort for import sorting
- Ruff for linting
- MyPy for type checking
All code must pass these checks before merging.
Testing
- Minimum test coverage: 80%
- Write unit tests for all new functionality
- Integration tests for critical workflows
- Use pytest fixtures for test data
Adding a New E-commerce Platform
-
Create a new strategy in
mcp_server/strategies/:from .base import EcommerceStrategy class YourPlatformStrategy(EcommerceStrategy): async def get_order(self, order_id: str) -> Optional[Order]: # Implementation here pass -
Add tests in
tests/unit/test_your_platform_strategy.py -
Update the strategy factory to include your platform
๐ Environment Variables
Create a .env file based on .env.example:
# Application Settings
DEBUG=False
LOG_LEVEL=INFO
# Hugging Face (for deployment)
HF_TOKEN=your_token_here
HF_USERNAME=your_username
HF_SPACE_NAME=your_space_name
# E-commerce Platforms (future)
# SHOPIFY_API_KEY=
# MAGENTO_API_URL=
๐ Deployment
Automatic Deployment
This project is configured for automatic deployment to Hugging Face Spaces:
- Push to the
mainbranch - GitHub Actions will run tests and quality checks
- If all checks pass, the app deploys to Hugging Face Spaces
Manual Deployment
To deploy manually to Hugging Face Spaces:
# Add Hugging Face remote
git remote add space https://huggingface.co/spaces/SlavPilus/mpc-for-commerce-platforms
# Push to deploy
git push space main
๐งช Running Specific Commands
# Run only unit tests
pytest tests/unit/
# Run with coverage report
pytest --cov=mcp_server --cov=ui --cov-report=html
# Run linting
ruff check . --fix
# Format imports
isort .
# Type checking
mypy mcp_server ui --strict
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Commit Convention
We use conventional commits:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test additions/changeschore:Maintenance tasks
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with Gradio
- Uses MCP (Model Context Protocol)
- Deployed on Hugging Face Spaces
๐ Support
For issues and feature requests, please use the GitHub Issues page.
Status: ๐ง Under active development - Phase 1: Core Foundation