Sponsored by Deepsite.site

๐Ÿ›๏ธ MCP - MCP for Commerce Platforms - Universal E-commerce Customer Support Assistant

Created By
slavpilus6 months ago
MCP for Commerce Platforms
Content

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

License: MIT Python 3.10+ Code style: black codecov

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

  1. Clone the repository

    git clone https://github.com/slavpilus/mcp.git
    cd mcp
    
  2. Run the setup script (macOS/Linux)

    chmod +x scripts/setup_dev.sh
    ./scripts/setup_dev.sh
    

    Or 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
    
  3. Configure environment variables

    cp .env.example .env
    # Edit .env with your configuration
    
  4. Run the application

    python app.py
    

    The 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

  1. Activate virtual environment

    source venv/bin/activate  # macOS/Linux
    # or
    venv\Scripts\activate     # Windows
    
  2. Make your changes

    • Follow the existing code style
    • Add tests for new functionality
    • Update documentation as needed
  3. Run code quality checks

    # Format code
    black .
    isort .
    
    # Run linter
    ruff check .
    
    # Type checking
    mypy mcp_server ui
    
  4. Run tests

    # Run all tests with coverage
    pytest
    
    # Run specific test file
    pytest tests/unit/test_strategies.py
    
    # Run with verbose output
    pytest -v
    
  5. 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

  1. 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
    
  2. Add tests in tests/unit/test_your_platform_strategy.py

  3. 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:

  1. Push to the main branch
  2. GitHub Actions will run tests and quality checks
  3. 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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Commit Convention

We use conventional commits:

  • feat: New features
  • fix: Bug fixes
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Test additions/changes
  • chore: Maintenance tasks

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

For issues and feature requests, please use the GitHub Issues page.


Status: ๐Ÿšง Under active development - Phase 1: Core Foundation

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook McpๅŸบไบŽAnduin2017 / HowToCook ๏ผˆ็จ‹ๅบๅ‘˜ๅœจๅฎถๅš้ฅญๆŒ‡ๅ—๏ผ‰็š„mcp server๏ผŒๅธฎไฝ ๆŽจ่่œ่ฐฑใ€่ง„ๅˆ’่†ณ้ฃŸ๏ผŒ่งฃๅ†ณโ€œไปŠๅคฉๅƒไป€ไนˆโ€œ็š„ไธ–็บช้šพ้ข˜๏ผ› Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps้ซ˜ๅพทๅœฐๅ›พๅฎ˜ๆ–น MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
DeepChatYour AI Partner on Desktop
Baidu Map็™พๅบฆๅœฐๅ›พๆ ธๅฟƒAPI็Žฐๅทฒๅ…จ้ขๅ…ผๅฎนMCPๅ่ฎฎ๏ผŒๆ˜ฏๅ›ฝๅ†…้ฆ–ๅฎถๅ…ผๅฎนMCPๅ่ฎฎ็š„ๅœฐๅ›พๆœๅŠกๅ•†ใ€‚
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbotโ„ข
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.