Commerce Ops MCP Server
Click on "Install 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., "@Commerce Ops MCP ServerCheck damaged order ORD-1001 and process refund"
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.
Commerce Ops MCP Server
An AI-native, remotely hosted MCP server written in TypeScript that empowers operations teams and AI agents to investigate and resolve e-commerce order exceptions โ damaged items, lost shipments, refunds, and replacement dispatches โ safely and autonomously.
๐ฏ Problem & Justification
User: An operations agent (human or AI) handling post-delivery exceptions in an online commerce business.
Problem: When an order is damaged or lost, the ops agent must:
Investigate the order and understand what happened (Read)
Check if a replacement item is available in inventory (Read)
Process a partial or full refund safely (Write)
Escalate for a replacement shipment if appropriate (Write)
Justification: Resolving post-delivery exceptions (damaged/lost items) touches the three most critical domains of commerce ops (Order Management, Inventory, and Payment). It provides a complete, measurable operational outcome while remaining safely constrainable via programmatic guardrails (e.g., refund limits, idempotency).
Related MCP server: agentinbox-mcp
๐ข Systems Modeled (Strict PostgreSQL Architecture)
To support this workflow, the server connects to a PostgreSQL Database modeling three source systems with strict relational integrity:
OMS (Order Management System): Stores order history, items, and status.
WMS (Warehouse Management System): Stores WMS inventory and Carrier shipments.
Payment Gateway: Records processed refunds and enforces ledger protection (
CHECK (amount_refunded <= amount_paid)).
๐ก๏ธ Read vs. Write Boundary
The workflow goes beyond lookup to safely bounded actions.
Read Boundary: Unrestricted lookup of order details and inventory availability.
Write Boundary (Atomic): Actions (Refunds, Replacements) are executed via single atomic
BEGIN/COMMITtransactions.Guardrails: A refund cannot exceed $150, the order must be <30 days old, risk score <70, and carrier exception verified. Failures route automatically to manager review via the
escalationstable.Idempotency: Stable-intent idempotency is enforced purely at the database level using
UNIQUEindexes on(order_id, sku, action, amount). Duplicate requests are caught and gracefully returned without duplicating mutations.Replacements: Are never created automatically. They are always routed to
escalationsfor human approval.
๐ ๏ธ MCP Tools
Tool | Description | Inputs | Guardrails |
| Fetch order status, items, tracking, refund history |
| Returns error if not found |
| Check available stock for a SKU |
| Returns error if SKU not found |
| Apply a partial or full refund atomically |
| 6 strict guardrails (amount cap, risk, age). Stable-intent idempotency catches duplicates. |
| Escalate a request for a replacement item |
| Always escalates to manager. Enforces stable-intent idempotency on retries. |
๐ Live Hosted URL
MCP SSE Endpoint:
https://diligence-mcp-ops.onrender.com/sseHealth Check:
https://diligence-mcp-ops.onrender.com/health
Note: The Render free tier spins down after 15 min of inactivity. Hit the health check URL first to warm it up.
๐๏ธ Architecture
src/
โโโ index.ts # Express server โ SSE + health endpoints
โโโ server.ts # MCP server factory โ reads tool registry, dispatches
โโโ db/
โ โโโ index.ts # PostgreSQL connection pool and executeTransaction logic
โ โโโ schema.sql # DDL for all 9 tables and UNIQUE constraints
โ โโโ seed.ts # Database seeding script for testing
โโโ tools/
โโโ index.ts # Tool registry barrel
โโโ getOrder.ts # get_order_details tool
โโโ checkStock.ts # check_inventory tool
โโโ processRefund.ts # process_refund tool
โโโ requestReplacement.ts # request_replacement tool๐งช Local Setup & Verification
# Install dependencies
npm install
# Setup your local PostgreSQL and provide a .env file
# DATABASE_URL=postgresql://localhost:5432/diligence_mcp_test
# Run automated runtime verification (Testing all DB Constraints & Idempotency)
npm run testExpected test output:
๐งช Running MCP Tool Verification Tests...
1. Testing get_order_details... โ
2. Testing process_refund (Valid Amount)... โ
3. Testing process_refund (Stable Intent - Idempotency)... โ
4. Testing process_refund (Distinct Legitimate Intent)... โ
5. Testing process_refund (Guardrail: Exceed Balance)... โ
6. Testing request_replacement... โ
7. Testing request_replacement (Stable Intent)... โ
8. Testing process_refund (Stable-Intent Lookup)... โ
โ
All PostgreSQL verification tests executed successfully!๐ Product Decisions & Scope
What's in scope
Order investigation and status lookup using PostgreSQL JOINs.
Safe refund processing with strict atomic transactions.
Hardened database idempotency rules using PostgreSQL
SAVEPOINT.Automated manager escalations for replacements and denied refunds.
What's intentionally out of scope
Authentication / user management โ a production version would use API keys or OAuth
Frontend / UI โ the MCP is consumed by AI agents (Claude, Cursor) directly
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI agents to manage e-commerce operations across multiple platforms (Shopify, WooCommerce, Stripe, MercadoLibre) through a conversational interface.Last updated13MIT
- Alicense-qualityCmaintenanceEnables AI agents to manage a customer-support inbox with guardrails, including replying safely, handling escalations, and leveraging upsell opportunities for e-commerce stores.Last updatedMIT
- Flicense-qualityBmaintenanceEnables AI agents to investigate and resolve operational exceptions across orders, payments, inventory, and fulfillment through a multi-system truth and guarded actions.Last updated
- Flicense-qualityBmaintenanceEnables AI agents to investigate why paid orders have not reached shipment creation and create persistent human-review escalations.Last updated2
Related MCP Connectors
Policy review and purchase discovery for AI-agent commerce actions.
KYC, KYB, AML, wallet screening, transaction monitoring, and fraud workflows for AI agents.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Akash5908/diligence-mcp-ops'
If you have feedback or need assistance with the MCP directory API, please join our Discord server