ecommerce-custom-mcp
Provides product management capabilities against a MySQL database, including CRUD operations, catalog listing, name search, and low-stock monitoring through a dedicated products schema.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ecommerce-custom-mcp Add a product: SKU TS-101, name 'Cotton T-Shirt', price 19.99, quantity 100"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Agents and MCP clients (Cursor, Claude Desktop, MCP Inspector, Apps SDK) can create products, look them up, delete them, browse the catalog, and generate copy through tools, resources, and prompts. Product data lives in MySQL.
Features
🛍️ Complete CRUD Operations — Create, read, update, and delete products (MCP tools plus the service/demo layer)
🤖 AI-Powered Descriptions — Automatic product description generation using MCP sampling when you skip a description
📊 Database Integration — MySQL with a dedicated
productsschema, unique SKUs, and timestamps🔍 Smart Search — Search products by name with limit/offset pagination
📦 Low Stock Monitoring — Resource for products with quantity below 5
🌐 Dual Transport Support — Stdio for MCP clients; HTTP/SSE types exported from the library for further wiring
🔧 TypeScript — Fully typed with Zod validation on inputs
📋 MCP Resources — Full catalog (
products://catalog) and low-stock (products://low-stock)🎯 MCP Prompts — Pre-built prompt template for marketing-style product descriptions
Related MCP server: MCP E-commerce Server
Quick start
# 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:mcpPut your real MySQL password in .env (not in .env.example). The MCP server prints nothing special; it waits on stdio for a client like Claude Desktop, MCP Inspector, Apps SDK, or Cursor to connect.
Environment variables (see .env.example):
Variable | Meaning | Example |
| Server host |
|
| Port |
|
| User |
|
| Password | your password |
| Database name |
|
This repo already includes .cursor/mcp.json, which starts npx tsx src/mcp/server.ts with that .env file.
How it is put together
Layer | Location | Role |
MCP server |
| Tools, resources, and prompts |
Service |
| Zod validation and business calls |
Repository |
| SQL against |
Model |
| Product type |
Database pool |
|
|
Demo CLI |
| Create → read → update → list → delete without MCP |
src/index.ts also re-exports ProductService and Product so other Node code can use the same library.
Product data model
Each row in products (sql/schema.sql) has:
Field | Type | Notes |
| integer | Auto-increment primary key |
| string (max 64) | Unique stock-keeping unit |
| string (max 255) | Required |
| text | Optional |
| decimal(10,2) | Non-negative; default |
| integer | Non-negative; default |
| timestamp | Set on insert |
| timestamp | Updated on every change |
There is an index on name (idx_products_name) to support search.
MCP tools
Registered on server ecommerce-custom-mcp (v1.0.0). Inputs are validated with Zod.
add_product — Create a product. Required: sku, name, price (≥ 0), quantity (integer ≥ 0). Optional: description. Returns the inserted row, including id and timestamps.
add_product_smart — Same fields. If description is omitted, the server asks the connected model (MCP sampling, up to 100 tokens) for a short 2–3 sentence description from the name and price. If you pass a description, sampling is skipped.
get_product_by_id — Fetch one product by positive integer id. Missing ids return product {id} not found.
delete_product — Delete by id. Returns { deleted: true } or { deleted: false }.
List, update, and name search are available on ProductService (demo, catalog resource, repository). They are not separate MCP tools.
MCP resources and prompt
Name | URI | Behavior |
|
| Up to 200 products, newest |
|
| Same list, then quantity below 5 |
generate-product-description-template takes productName (required) plus optional features and targetAudience. It asks the model for a 5–8 word headline, 2–3 paragraphs, 3–5 benefit bullets, and a call to action.
Service and database
ProductService and ProductRepository support create, get by id, get by SKU, partial update, delete, list (ORDER BY id DESC with limit/offset), and search by name (LIKE with the same pagination). The pool in src/db.ts uses a limit of 10 connections, a 60s idle timeout, and keep-alive.
npm run dev:demo inserts DEMO-001, reads it, updates price/quantity, lists up to 10 rows, deletes the demo product, and closes the pool — useful to verify MySQL before attaching an MCP client.
Scripts and layout
Script | What it does |
| Install dependencies |
| CRUD smoke test against MySQL |
| MCP server on stdio ( |
| Typecheck without emit |
| Compile to |
After a build, the binary name is ecommerce-products-mcp (dist/mcp/server.js).
src/
mcp/server.ts
services/ProductService.ts
repo/ProductRepository.ts
models/Product.ts
db.ts
index.ts
sql/schema.sql
.cursor/mcp.json
.env.exampleAuthor
Santhan Sai
Available Tools
4 toolsadd_productAdd ProductB
Create a new product with sku, name, (optional) description, price, and quantity.
Inputs: sku (required), name (required), price (required), quantity (required), +1 more. Returns: id, sku, name, price, +4 more
add_product_smartAdd Product (Smart AI Enhanced)A
Create a new product with smart ai generated description if missing
Inputs: sku (required), name (required), price (required), quantity (required), +1 more. Returns: id, sku, name, price, +4 more
delete_productDelete ProductA
Delete a product by id. Returns { deleted: boolean }.
Inputs: id (required). Returns: deleted
get_product_by_idGet Product by IDA
Fetch a single product by numeric ID
Inputs: id (required). Returns: id, sku, name, price, +4 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
add_product and add_product_smart overlap significantly since both create a product, differing only by optional AI description generation. An agent could easily select the wrong one. The other tools are distinct enough.
Names mostly follow a clear verb_noun snake_case pattern: add_product, get_product_by_id, delete_product. add_product_smart is a minor deviation but remains readable and predictable.
Four tools is a reasonable size for a focused product management server. However, add_product_smart feels like a variant rather than a distinct capability, so the set is slightly less tight than it could be.
The server covers create, read, and delete for products, but misses obvious update and list/search operations. Agents can do basic workflows but will hit dead ends when trying to modify products or view all products.
Related MCP Connectors
Hosted MCP for e-commerce: live product catalog, stock, and pricing for AI agents.
Unified MCP server for 70+ eCommerce platforms: products, orders, customers, and more.
Let your AI manage WooCommerce and Shopify stores: products, SEO, descriptions and images.
Merchant product catalogs for AI agents: price, availability, specs, variants, buy links. Read-only.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables comprehensive product management for e-commerce with CRUD operations, AI-powered product description generation, inventory tracking, and MySQL database integration.51MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables full CRUD operations for e-commerce product management, featuring MySQL integration and AI-powered product description generation. It provides tools for inventory monitoring and supports both stdio and HTTP/SSE transports.MIT
- AlicenseCqualityDmaintenanceEnables e-commerce product management with CRUD operations, AI-powered descriptions, and MySQL database integration via MCP.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides e-commerce product management with CRUD operations, AI-powered descriptions, and MySQL database integration through MCP.MIT