Reference architecture: an AI operations agent for e-commerce
How an AI operations agent connects to Magento 2 and an ERP through MCP servers — with read-only tools, approval gates, and audit logging.
This is an illustrative scenario based on situations we commonly see. It does not describe a specific client, and it contains no client results.
The scenario
This is a reference architecture, not a client engagement. It shows how we design an AI operations agent for a merchant running Magento 2 with an ERP for inventory and purchasing. You can try a simulated version on our interactive demo page.
The problem the agent solves
An operations team fields questions like these all day:
- Which products will sell out before the next delivery?
- Why is this order late?
- Which new products are missing data?
- What did we sell in the outdoor category last week compared with last year?
Each answer needs data from the store, the ERP, and sometimes a carrier. The work isn’t difficult. It is constant, and it interrupts everything else.
Architecture
Two MCP servers, one agent
- Store MCP server (Magento 2):
search_products,get_product,check_product_completeness,get_order,list_orders, andpropose_product_update. - ERP MCP server:
get_stock_by_warehouse,get_sales_velocity,list_open_purchase_orders, anddraft_expedite_request.
The agent runs in Slack for the operations team. Each tool is narrow, described in plain language, and validates its inputs. There is no tool that accepts arbitrary queries.
Read by default, write by proposal
Every tool that would change data creates a proposal instead. Proposals appear in Slack with Approve and Reject buttons. Only after approval does the MCP server perform the write, using its own scoped credentials. The agent never sees raw API keys.
Guardrails
| Control | How it works |
|---|---|
| Authentication | Team members sign in with the company identity provider; tools are scoped by role |
| Least privilege | Store credentials allow product and order reads, plus product writes only through the approval flow |
| Limits | Bulk tools are capped, so no single request can change hundreds of records |
| Audit log | Every request, tool call, parameter, approval, and result is logged |
| Prompt injection | Product descriptions and customer notes are treated as data and cannot trigger tool calls |
Evaluation before launch
Before go-live, the agent is tested against a set of real questions collected from the operations team, with known correct answers. Accuracy is measured again whenever tools, prompts, or the model change.
Rollout plan
- Week 1–2: Read-only store tools, internal pilot with two people.
- Week 3–4: Add ERP tools and the stockout analysis.
- After review: Enable proposals for product updates and expedite requests, with approvals.
What we would measure
- Time spent answering routine operational questions
- Response time to stockout risks
- Catalog completeness over time
- Agent accuracy on the evaluation set