Autonomous AI agents for e-commerce automation — built on the Model Context Protocol (MCP)
CommerceAI Agent is a multi-agent system that automates e-commerce operations using specialized AI agents. Each agent handles a specific domain — inventory, pricing, customer service, marketing — and communicates through the Model Context Protocol (MCP) for seamless LLM integration.
The system deploys specialized agents that autonomously manage different aspects of an online store:
┌─────────────────────┐
│ MCP Protocol │
│ (LLM Integration) │
└────────┬────────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌────────▼──────┐ ┌──────▼───────┐ ┌──────▼───────┐
│ Inventory │ │ Pricing │ │ Marketing │
│ Agent │ │ Agent │ │ Agent │
│ │ │ │ │ │
│ - Stock mgmt │ │ - Dynamic │ │ - Product │
│ - Demand │ │ pricing │ │ copywriting│
│ forecasting │ │ - Competitor │ │ - SEO │
│ - Auto-reorder│ │ analysis │ │ - Campaigns │
└───────────────┘ └──────────────┘ └──────────────┘
│ │ │
┌────────▼──────┐ ┌──────▼───────┐ │
│ Customer │ │ Email │ │
│ Service │ │ Agent │ │
│ Agent │ │ │ │
│ │ │ - Auto-reply │ │
│ - Chat bot │ │ - Follow-ups │ │
│ - Returns │ │ - Newsletters│ │
│ - Complaints │ │ - Refunds │ │
└───────────────┘ └──────────────┘────────┘
│
┌────────▼────────────┐
│ FastAPI Backend │
│ PostgreSQL + Redis│
└─────────────────────┘
Monitors stock levels across connected stores, forecasts demand based on historical sales data, and triggers automatic reorder suggestions when inventory drops below configurable thresholds.
Analyzes competitor pricing, market demand, and margin targets to recommend or automatically adjust product prices. Supports rule-based and ML-driven pricing strategies.
Handles incoming customer queries via chat with context-aware responses. Manages returns, refund requests, and complaint escalation. Learns from previous interactions to improve response quality.
Generates optimized product descriptions, SEO metadata, and ad copy. Creates email campaign content and suggests promotional strategies based on inventory levels and sales trends.
Automates transactional and marketing email workflows: order confirmations, shipping updates, review requests, abandoned cart recovery, and personalized newsletters.
| Category | Services |
|---|---|
| Marketplaces | Shopify, WooCommerce, Amazon, eBay |
| Payments | Stripe, PayPal |
| CRM | HubSpot, Salesforce |
| Shipping | DHL, UPS, FedEx |
| AI | OpenAI, Google Cloud AI |
- Python 3.9+
- Node.js 16+
- Docker and Docker Compose
- PostgreSQL
- Redis
git clone https://github.com/vinsblack/commerce-ai-agent.git
cd commerce-ai-agent
# Backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env # Configure your API keys
python -m src.db.init_db
uvicorn src.main:app --reload# Frontend
cd frontend
npm install
npm startdocker-compose up -d
docker-compose ps
docker-compose logs -fThe dashboard is available at http://localhost:3000, API at http://localhost:8000.
Copy .env.example to .env and configure:
# Required
OPENAI_API_KEY=sk-...
# Marketplace integrations (configure as needed)
SHOPIFY_API_KEY=...
SHOPIFY_API_SECRET=...
WOOCOMMERCE_CONSUMER_KEY=...
AMAZON_MWS_ACCESS_KEY=...
# Payments
STRIPE_API_KEY=...
PAYPAL_CLIENT_ID=...
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/commerce_ai
REDIS_URL=redis://localhost:6379/0All integrations are configured through the Settings > API page in the dashboard.
commerce-ai-agent/
├── docs/ # Documentation
├── frontend/ # React frontend
│ ├── public/
│ └── src/
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React Context API
│ ├── pages/ # Application pages
│ └── utils/ # Helpers and utilities
├── src/ # Python backend
│ ├── api/ # FastAPI endpoints
│ ├── db/ # Database models
│ ├── mcp/ # MCP protocol implementation
│ ├── schemas/ # Pydantic schemas
│ ├── tasks/ # Async task queue (Celery)
│ └── utils/ # Helpers
├── tests/ # Unit and integration tests
├── docker-compose.yml
├── requirements.txt
└── setup.sh / setup.bat
The web dashboard provides:
- Overview — Sales metrics, top products, recent orders, agent activity
- Products — Catalog management, marketplace sync, AI-powered price optimization
- Orders — Order processing, status tracking, invoice generation
- Customers — Purchase history, segmentation, communication preferences
- Stores — Multi-store management across platforms
- Agents — Configure, monitor, and control each AI agent
- Integrations — Manage API connections to external services
- Solo sellers managing multiple marketplace listings across Shopify, Amazon, and eBay
- Small e-commerce teams looking to automate repetitive customer service and inventory tasks
- Agencies managing multiple client stores from a single dashboard
- Developers building custom e-commerce automation workflows using the MCP protocol
- Additional marketplace integrations (Etsy, Walmart)
- Mobile companion app (iOS, Android)
- SEO optimization agent
- ERP integration (SAP, Oracle)
- Multi-language agent support
- Agent marketplace for community-built automations
- Analytics and reporting agent
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit changes using conventional commits:
git commit -m 'feat: add feature' - Push:
git push origin feature/your-feature - Open a Pull Request
Please follow PEP 8 for Python and use TypeScript for frontend code. Include tests for new features.
- Community Edition: MIT License
- Commercial Edition: Contact for licensing
Vincenzo Gallo — Full Stack Developer & Data Analyst
- Email: vincenzo.gallo77@hotmail.com
- GitHub: vinsblack