ecom-mcp
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., "@ecom-mcpwhy is order ord_pick_002 stuck?"
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-ecommerce
An MCP server that lets an AI agent investigate stuck orders, surface fulfillment anomalies, and create escalation records — turning a multi-tab ops investigation into a single natural-language query.
Deployed on Railway with a PostgreSQL database. Connect any MCP-compatible client to the hosted URL and start querying immediately — no local setup required to evaluate.
Hosted MCP Server
https://ecom-mcp-production-f5bf.up.railway.app/sseThe server and its PostgreSQL database are both running on Railway. The /sse endpoint is live and accepting MCP client connections.
Connect via the included Groq client
git clone https://github.com/beinghadibadami/ecom-mcp.git
cd ecom-mcp
npm install
cp .env.example .env
# add GROQ_API_KEY and MCP_SERVER_URL=https://ecom-mcp-production-f5bf.up.railway.app
npm run client:remote -- "why is order ord_pick_002 stuck?"The client prints each tool call and result as it runs, then a [final answer].
Related MCP server: ShopBot AI MCP Server
MCP Tools
Tool | Access | Description |
| Read | Full order details and line items for a given order ID |
| Read | Payment state (captured / failed / refunded / pending) and amount |
| Read | Current stage, hours in stage, carrier, tracking, and error reason |
| Read | Orders breaching SLA thresholds with hours overdue and escalation status |
| Write | Creates or returns an existing escalation (idempotent). Blocked at the business layer if no confirmed anomaly exists |
Anomaly thresholds (hardcoded in src/constants.ts)
Stage | Threshold |
Picking | 8 hours |
Packing | 4 hours |
Carrier handoff | 48 hours |
Thresholds are enforced in code — the model never invents or infers them.
Demo Orders (seeded synthetic data)
Order ID | Scenario |
| Fully delivered, no issues |
| Stuck in picking (~12 h, threshold: 8 h) |
| Stuck in packing (~7 h, threshold: 4 h) |
| Stuck at carrier handoff (~60 h, threshold: 48 h) |
| Failed payment, no fulfillment triggered |
| Stuck in picking, already has an existing escalation |
Architecture
Ops Engineer (natural-language query)
↓
Groq client — llama-3.3-70b-versatile
drives multi-turn tool-call loop (max 10 iterations)
↓ MCP JSON-RPC over SSE
MCP Server (Railway) — SSEServerTransport
↓ pg connection pool
PostgreSQL (Railway) — orders, payments, fulfillments, escalationsTransport is selected by environment: MCP_TRANSPORT=http → SSE (Railway), otherwise stdio (local dev).
Key Product Decisions
Escalation enforcement — 3 layers
A write operation that creates a manager-review ticket needs to be safe. Enforcement works at three independent levels:
System prompt — instructs the model to only call
create_escalationon explicit single-order investigation requests, never during general listing queriesBusiness layer —
hasConfirmedAnomaly()re-queries the database before any insert; if no SLA breach or payment failure is confirmed, the function returns a blocked error and nothing is writtenDatabase constraint —
UNIQUEonescalations.order_idprevents duplicates even under concurrent requests
Listing vs. investigation intent
General listing queries ("show me flagged orders") call list_flagged_orders and return evidence only. Specific order queries ("investigate ord_pick_002") follow the full chain and may escalate. This distinction is enforced in the system prompt and backed by the business layer — listing can never accidentally trigger a write.
Idempotency
create_escalation called twice for the same order returns created: false with the existing record. The anomaly gate still runs on the second call, so only genuinely anomalous orders can ever hold an escalation.
Running Tests
Tests use Node's built-in test runner against a live local database — no mocking.
# make sure local DB is running and seeded first
npm testTest | What it checks |
Allowed path |
|
Blocked path |
|
Idempotency |
|
Payment failure |
|
Out of Scope
Frontend, authentication, real payment provider integrations, and CI/CD are intentionally excluded per the assignment brief.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
Hosted MCP for e-commerce: live product catalog, stock, and pricing for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA Shopify-focused MCP server that enables AI agents to manage store operations like order tracking, product discovery, and checkout link generation. It facilitates customer-facing interactions including shipping estimates and real-time inventory searches.-
- AlicenseNot gradedqualityBmaintenanceAI customer support MCP server with order status lookup and RAG-powered knowledge base search for e-commerce stores.1MIT
- FlicenseNot gradedqualityDmaintenanceA proof of concept MCP server that gives AI agents business context for e-commerce operations including orders, inventory, logistics, returns, claims, and payments.1-
- FlicenseNot gradedqualityBmaintenanceAn AI Operations Investigation MCP server that enables LLMs to investigate order fulfillment incidents by correlating data across independent services using predefined scenarios.-