AI Ops Agent with Human Approval and MCP
Claude agent that reads and acts on billing, CRM, orders, support and a KPI sheet through tool calls, pauses for human approval before every write, enforces policy limits, and serves the same tools over MCP.
Open live demoThe problem
Ops teams in small businesses spend their days jumping between tools. A ticket says “charged twice”, so someone opens the payment dashboard, finds the charges, checks the order, issues a refund, replies to the customer and logs it. Most of that is lookup and copy-paste work that an AI agent can do. But nobody wants an agent that can refund money or email customers on its own judgement.
What I built
An operations agent for a fictional outdoor-gear store. It works across five simulated systems: Stripe-style billing, a CRM with a wholesale pipeline, orders and shipping, a support inbox, and a weekly KPI sheet.
- 14 tools: 8 read tools (search customers, a 360° customer view, charges, orders, tickets, deals, KPI sheet) and 6 write tools (refund, email, update ticket, create task, update deal, write a KPI row).
- Human approval for every write: the agent loop pauses and shows an approval card with a preview of the exact change (amount, recipient, status before → after, email body). Approved actions run. Rejected ones are reported back to the agent, which doesn’t retry them.
- Policy guardrails in code, not in the prompt: refunds over $300 are blocked and must be escalated to Finance, there are at most 3 emails per request, emails go only to the address on file and never contain card numbers, and every input is schema-checked. Policy is checked again at execution time.
- Audit log: every write records who approved it, when, and with what input.
- MCP server: the same tools are served over the Model Context Protocol (Streamable HTTP), so Claude, ChatGPT or Cursor can use them directly.
The live demo
Each visitor gets a private copy of the company data, so approvals change only their own sandbox. The systems panel flashes every row the agent changes. Try “Ticket T-1042 says the customer was double charged”: the agent reads the ticket, compares the charges, finds the duplicate, and asks to refund it and reply to the customer. “Handle ticket T-1045” asks for a $668 refund. The agent sees the $300 policy, escalates to the Finance lead instead and tells the customer what happens next.
The chat shows every tool call with its input and output, plus the tokens, cache hits and cost of each turn. A typical task takes 3–5 model calls, 10–20 seconds and about $0.05. The public endpoint has the same abuse limits as my other AI demos: signed cookies, an origin check, limits per browser and per IP, and daily caps on messages and tokens.
Details
The agent loop is a manual Messages API loop in Node.js, streamed to the browser over Server-Sent Events. It runs Claude Opus 5.5 with adaptive thinking, progress notes between tool calls, server-side refusal fallback and prompt caching (most input tokens in a turn are cache reads). Pausing for approval keeps the transcript append-only: the tool results, approved or rejected, go back to the model in one message, and the loop resumes. If a request fails mid-loop, the transcript rolls back to its last valid state.
The MCP endpoint is stateless JSON-RPC (initialize, tools/list, tools/call). In the public sandbox, read tools return live demo data and write tools are dry runs that return the change they would make.
Offline tests cover the planted scenarios, input validation, every policy rule and the MCP protocol.