Skip to content
Tayyab Hassan
← All case studies

An MCP server that lets Claude work the ERP, with the user's own permissions

A thin adapter in front of a multi-channel e-commerce ERP: 17 tools for purchasing, inventory, finance, dispatch, mail and tasks, with no database access and no rules of its own.

17
Tools exposed
11 / 6
Read / write split
None
Own business rules or database
An MCP server that lets Claude work the ERP, with the user's own permissions

The situation

Procurement and sourcing staff spent their mornings clicking through the ERP and reading supplier email: look up a supplier, find the quote, work out what needs restocking, raise the purchase order, then retype carton sizes and ETAs from an email thread into the right screen.

The ask was to let an AI assistant do the lookups and the typing, without handing it a second set of rules or a way around the ones the business already trusts.

What I built

An MCP server that is deliberately thin. It holds no business logic and never opens the database. Every tool calls the existing ERP API as one person, using that person's own access token, so the API's role and module checks apply unchanged. If you cannot approve a purchase order in the app, the assistant cannot either.

It exposes seventeen tools:

  • Read (11): who the token acts as, personal tasks, suppliers, products, quotes per product, restock suggestions, purchase orders, dispatch jobs, and two tools that search and read an allow-listed shared purchasing mailbox.
  • Write (6): create a supplier, create a purchase order (it still lands in pending approval for a manager), update a PO status or date, raise a payment request, set logistics fees on a dispatch job, and fill in a PO's packaging card.

It runs over stdio for Claude Desktop and Claude Code, and over stateless streamable HTTP with a bearer token on every request. A Claude Code plugin bundles the server with instruction skills, and the same tools power an in-app chat assistant and scheduled jobs.

How it stays safe

  • One permission system. A fresh server instance is built per token and HTTP keeps no session, so two users can never share state and the model can never outgrow the person's role.
  • Tokens, not OAuth. Each person creates a personal access token in the ERP. Only a hash is stored, tokens can expire or be revoked, and a request made with a token cannot list, create or revoke tokens. Scheduled runs mint a throwaway token that lives at most twenty minutes and is revoked when the run ends.
  • Writes that are safe near a model. The tool descriptions force a lookup, then a shown change, then a call only after a yes. The rest is enforced in code: empty updates are rejected, the payment tool takes its supplier from the PO so it cannot be given a wrong one, a channel must match a real channel, a weight without a unit is rejected, and packed units cannot exceed the ordered quantity.
  • Fill-if-empty by default. The packaging tool writes only when the card is empty. If cartons already exist it writes nothing and returns what is there. Replacing is a separate mode that needs a confirmed request.
  • Mail is evidence, not instructions. Mailboxes are pinned to an allow-list, the tools are read-only, and message text is marked untrusted.
  • The embedded assistant cannot see write tools at all, and a second check blocks a write even if the model invents a tool name.

The hard parts

Fitting ERP data into a context window. The forecasting screen repeats a listing once per channel. The restock tool merges those rows, drops items with no sales or full cover, ranks the rest by cost value, and only then optionally looks up the cheapest quote and last price paid. Tasks are filtered locally, email is snippet first and body second, and identical cartons are grouped on the way out.

Three statuses behind one field. A purchase order has a headline status, an approval status and a post-approval workflow status. The tool exposes one status and lets the API fan it out exactly as the web app does.

Duplicate suppliers. Supplier names are not unique in the API. Rather than invent a constraint the system does not have, the guard is "search, then ask a person".

A morning with it

Ask which purchase orders to raise today. The restock tool returns critical items, already net of units on order, split into "ready to order" and "needs a price", each with the cheapest quote. Raising the PO is a separate step: the assistant shows the supplier, lines, total, currency and terms, and creates it only after a yes. A manager still approves it in the app.

A supplier replies with carton sizes in one line. The assistant finds the PO, checks whether packaging already exists, and writes it only if the card is empty and every side and unit is stated. If the email disagrees with what is stored, it reports the mismatch and leaves the data alone.

What it replaced

Opening forecasting and then each product's suppliers to decide what to order. Reading supplier threads for "shipped" and ETAs and updating each PO by hand. Typing one-line carton replies into the packaging card. Opening three morning reports to see what needs a decision. Opening task management for "what is overdue".

What I would do next

Move it to a hosted deployment, add a rate limiter on the server itself, and start recording usage so the time saved is a measurement instead of a claim.

Summarize with AI

Screens

What it looks like.

An MCP server that lets Claude work the ERP, with the user's own permissions, screen 1
An MCP server that lets Claude work the ERP, with the user's own permissions, screen 2

Keep reading

A 17-module ERP that 250 people use every day

One system replacing a decade of parallel spreadsheets at Amazify, built module by module across 18 departments without stopping the business, and maintained as their web partner for four years since.

Next step

Let's find the manual work in your business.

Thirty minutes. Bring one process that keeps breaking and we will map what it would take to automate it, whether or not you hire me.