Commerce Operations 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 Operations MCP ServerCheck order ORD-2024-001 and process a refund if eligible."
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 Operations MCP Server
AI-native solution for commerce operations teams to independently investigate and resolve order issues, particularly refund processing.
Problem Statement
Operations teams in e-commerce businesses frequently depend on engineers to:
Investigate order issues across multiple systems
Determine refund eligibility
Process refunds safely without risking duplicate refunds or fraud
This MCP server makes ops teams more independent by providing AI agents with safe, structured access to commerce operations.
Related MCP server: velora-mcp-copilote
Solution Overview
An MCP server that exposes commerce operations tools for AI agents:
Order Investigation: Search and retrieve order details
Refund Eligibility: Check if orders qualify for refunds based on business rules
Safe Refund Processing: Execute refunds with built-in safety checks
Audit Trail: Track all refund operations
Architecture
AI Agent (Claude/Gemini)
↓
MCP Protocol (stdio/SSE)
↓
TypeScript MCP Server
↓
SQLite Database (mock commerce data)Key Design Decisions
MCP as Core Architecture: The MCP server is the primary interface for all operations. It's not a wrapper - it implements:
Business logic for refund eligibility
Safety checks and validation
Audit logging
Transactional integrity
Tool Design: Five focused tools that map to real operations workflows:
search_orders- Find orders by various criteriaget_order_details- Retrieve complete order informationcheck_refund_eligibility- Validate refund eligibility before processingprocess_refund- Execute refund with safety checksget_refund_history- Audit trail for refunds
Safety First:
Prevents duplicate refunds
Validates refund amounts don't exceed order total
Enforces 90-day refund window
Requires detailed reasons (audit trail)
Read-only tools for investigation, single destructive tool with guards
Setup
Prerequisites
Node.js 18+
npm or yarn
Installation
npm install
npm run buildRunning Locally
npm run devThe server runs on stdio and communicates via MCP protocol.
Running Tests
npm run build
node dist/test.jsTests verify:
Order search and retrieval
Refund eligibility rules
Refund processing safety checks
Multiple partial refunds
Audit logging
MCP Tools
1. search_orders
Search for orders with filters:
email: Customer emailorderId: Specific order IDstatus: Order status (pending, confirmed, shipped, delivered, cancelled)paymentStatus: Payment status (pending, paid, failed, refunded, partially_refunded)
2. get_order_details
Retrieve complete order information including items, shipping, payment, and refund history.
Input: orderId
3. check_refund_eligibility
Validate if an order qualifies for refund.
Business Rules:
Payment must be completed (paid status)
Not already fully refunded
Within 90 days of purchase
Returns max refundable amount
Input: orderId
4. process_refund
Execute a refund with safety checks.
Safety Checks:
Validates eligibility first
Prevents duplicate full refunds
Prevents excess refunds
Requires detailed reason (min 10 characters)
Creates audit log
Input:
orderId: Order to refundamount: Refund amount (supports partial refunds)reason: Detailed reason for audit trail
5. get_refund_history
Retrieve all refund transactions for an order.
Input: orderId
Example Workflow
Scenario: Customer reports they received a damaged laptop
Search for customer orders:
search_orders({ email: "alice@example.com" })Get order details:
get_order_details({ orderId: "ORD-2024-001" })Check refund eligibility:
check_refund_eligibility({ orderId: "ORD-2024-001" })Process refund (if eligible):
process_refund({ orderId: "ORD-2024-001", amount: 1299.99, reason: "Customer received damaged laptop, verified with photos" })Verify refund:
get_refund_history({ orderId: "ORD-2024-001" })
Deployment
Railway Deployment
Create Railway project:
railway initAdd start command to Procfile or use npm start
Deploy:
railway upExpose via SSE transport for remote access
Environment Variables
For production deployment:
NODE_ENV=productionPORT- Railway will set automatically
Sample Data
The system includes 6 sample orders with various states:
Delivered paid orders (eligible for refund)
Already refunded order (not eligible)
Pending payment order (not eligible)
Shipped orders
Various payment methods
Safety Considerations
Implemented
✅ No duplicate full refunds
✅ Amount validation (positive, <= remaining)
✅ Eligibility checks before processing
✅ Audit logging for all refunds
✅ Transaction atomicity
✅ Required refund reasons
Production Requirements (Out of Scope)
Authentication/authorization
Rate limiting
Fraud detection
Payment gateway integration
Multi-currency support
Role-based access control
Assumptions
Data: Using synthetic SQLite data; real systems would connect to production databases via read replicas
Payments: Mock refund processing; real systems integrate with Stripe/PayPal/etc.
Authentication: Assumes trusted environment; production needs auth
Single-tenant: One database; real system would be multi-tenant
Business Rules: 90-day refund window is configurable; simplified from real-world policies
Limitations & Future Work
Current Limitations
No actual payment gateway integration
No email notifications
No approval workflows
Single database (no scaling)
No fraud detection
Next Steps (Priority Order)
Add SSE transport for remote hosting
Implement authentication using API keys or OAuth
Add approval workflows for refunds over threshold
Integrate payment gateway (Stripe API)
Add notification system (email customers)
Implement rate limiting and fraud detection
Add analytics tools (refund metrics, trends)
Multi-tenant support with organization isolation
Trade-offs
Why SQLite? Fast to set up, no external dependencies, perfect for demo. Production would use PostgreSQL with read replicas.
Why stdio transport? Simplest MCP transport for initial development. SSE transport needed for remote hosting.
Why synchronous processing? Simpler to implement and test. Production would use async job queues for refunds.
Why embedded business logic? Keeps MCP server as single source of truth. Alternative would be separate service layer.
Tech Stack
TypeScript - Type safety and better developer experience
@modelcontextprotocol/sdk - MCP protocol implementation
better-sqlite3 - Fast embedded database
zod - Runtime type validation for tool inputs
Railway/Render - Hosting platform
License
MIT
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
- Flicense-qualityCmaintenanceProvides order lookup, customer lookup, and refund issuance tools with categorized errors to ensure accurate routing and distinguish access failures from valid empty results.Last updated
- Flicense-qualityBmaintenanceEnables AI agents to assist sales advisors of the fictional e-commerce Velora by providing tools to search products, check stock, get order status, and handle returns.Last updated
- Flicense-qualityBmaintenanceEnables AI assistants to handle payment support tasks by orchestrating between Stripe and an internal orders database, with human approval required for refunds.Last updated
- Flicense-qualityBmaintenanceEnables AI agents to investigate and resolve e-commerce order exceptions like damages, lost shipments, refunds, and replacements through a unified interface with built-in guardrails.Last updated
Related MCP Connectors
Policy review and purchase discovery for AI-agent commerce actions.
SEO research, audits, backlinks, GSC, and content workflow tools for AI agents.
AI-agent search API: Google, YouTube, Amazon, Reddit, TikTok, TikTok Shop, Instagram, X, LinkedIn
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/maheshsingh20/Commerce-Operations-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server