Skip to main content
Glama

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

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

Available Tools

4 tools
add_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

    C2.6/5.0

    Scored across 4 tools

    Disambiguation3/5

    The two 'add' tools (add_product and add_product_smart) overlap significantly; their distinction relies on the optional AI description generation, which may confuse agents about which to use. The other tools are distinct.

    Naming Consistency3/5

    Names follow a verb_noun pattern but are inconsistent: add_product vs. add_product_smart (qualifier suffix), get_product_by_id vs. delete_product (different level of detail). The pattern is not uniform.

    Tool Count2/5

    With only 4 tools for an e-commerce server, the tool count is too low for the domain's typical needs, lacking essential operations like listing or updating products.

    Completeness2/5

    The set covers create, read, and delete, but missing update and list/search endpoints, leaving significant gaps for typical e-commerce workflows.

    Related MCP Connectors

    Related MCP Servers