E-commerce MCP Server
# MCP E-commerce Server
A comprehensive Model Context Protocol (MCP) server for e-commerce product management with CRUD operations, AI-powered descriptions, and database integration.
## Features
- ๐๏ธ **Complete CRUD Operations** - Create, read, update, delete products
- ๐ค **AI-Powered Descriptions** - Automatic product description generation using MCP sampling
- ๐ **Database Integration** - MySQL database with proper schema
- ๐ **Smart Search** - Search products by name with pagination
- ๐ฆ **Low Stock Monitoring** - Resource for tracking inventory levels
- ๐ **Dual Transport Support** - Both stdio and HTTP/SSE transports
- ๐ง **TypeScript** - Fully typed with Zod validation
- ๐ **MCP Resources** - Product catalog and low-stock resources
- ๐ฏ **MCP Prompts** - Pre-built prompt templates
## Quick start
```bash
# 1) Install deps
npm i
# 2) Prepare env
cp .env.example .env
# 3) Create schema (optional, run in your MySQL)
# See sql/schema.sql
# 4) Run demo (non-MCP) usage
npm run dev:demo
# 5) Run MCP server (stdio transport)
npm run dev:mcp
```
The MCP server prints nothing special; it waits on stdio for a client like Claude Desktop / MCP Inspector / Apps SDK to connect.
## Notes
- This is intentionally minimal and tutorialโfriendly.
- All database params come from environment variables.
- You can extend with transactions, pagination, auth, etc.
#package.json
npm link
npm login
npm publish --access public
TDQS
Scored across 5 tools
add_product and add_product_smartly overlap significantly, both creating products with the same parameters, though add_product_smartly adds AI description generation and duplicate checking. The other tools are distinct CRUD operations, so the main ambiguity is between the two creation tools.
Most tools follow a verb_noun pattern (add_product, get_product_by_id, delete_product, update_product), but add_product_smartly breaks the convention with an adverb suffix. The naming is mostly consistent but the smartly variant is a deviation.
Five tools is a reasonable count for a simple product CRUD server. The add_product_smartly tool is somewhat redundant, making the count feel slightly padded, but it's still within an appropriate range.
The server covers the core CRUD lifecycle for products: create, read, update, delete. A list/search products tool is missing, which is a notable gap for an e-commerce server, but the essential operations are present.