angeo / module-mcp-reorder
Signed-in customer tools for the Angeo MCP Server (Magento 2 / Adobe Commerce): an AI agent reads the buyer's own order history, reorders past orders and turns a SKU list into the buyer's own cart, at the buyer's own prices. The buyer checks out on the store. B2B-ready: quick order, repeat purchases
Package info
github.com/angeo-dev/module-mcp-reorder
Type:magento2-module
pkg:composer/angeo/module-mcp-reorder
Requires
- php: ~8.1.0||~8.2.0||~8.3.0||~8.4.0||~8.5.0
- angeo/module-mcp-server: ^2.4.0
- magento/framework: >=103.0.6 <104
- magento/module-catalog: >=104.0.6 <105
- magento/module-configurable-product: >=100.4.6 <101
- magento/module-customer: >=103.0.6 <104
- magento/module-quote: >=101.2.6 <102
- magento/module-sales: >=103.0.6 <104
- magento/module-store: >=101.1.6 <102
Requires (Dev)
- bitexpert/phpstan-magento: ^0.43
- magento/magento-coding-standard: ^40.0 || ^41.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^9.6
Suggests
- angeo/module-mcp-checkout: Guest cart and checkout tools for shoppers who are not signed in
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-17 15:52:47 UTC
README
Let an AI agent fill a buyer's cart from their order history — and leave checkout to the buyer.
Business buyers order the same things again and again. With this module, a buyer can tell Claude (or any MCP client) "order the same as last month, but double the gloves" or paste a list of SKUs. The agent reads their own orders, puts the lines in their own cart at their own prices, and reports what is out of stock or more expensive now. The buyer then checks out on your store as usual.
The tools never place an order. Payment, purchase orders, approvals and company rules stay exactly where they are today: in your checkout.
Extends angeo/module-mcp-server.
For shoppers who are not signed in, see
angeo/module-mcp-checkout.
Contents
- Tools
- How it works
- Security model
- Requirements
- Installation
- Configuration
- Connecting a signed-in buyer
- Adobe Commerce B2B
- Known limits
Tools
| Tool | What it does | Changes data |
|---|---|---|
list_my_orders |
The buyer's orders, newest first. sku finds orders that contain a product. |
no |
get_my_order |
Every line of one order: SKU, options, quantity, price then. | no |
reorder_to_cart |
Put an order into the cart: all lines, a multiplier, or chosen items. Reports price changes and lines that cannot be added. |
cart |
add_items_to_my_cart |
Quick order: a list of {sku, qty} into the cart in one call. |
cart |
update_my_cart_item |
Change a line's quantity, or remove it with qty: 0. |
cart |
get_my_cart |
The buyer's cart with totals and a checkout_url. |
no |
get_my_prices |
The buyer's own unit price and quantity breaks for up to 50 SKUs. | no |
reorder_to_cart and add_items_to_my_cart take "preview": true: same
result, prices and stock check, but the cart is not saved.
Two conversation starters (MCP prompts) are added for signed-in buyers: Reorder from {store} and Quick order at {store}.
Example flow:
list_my_orders → order 000000123, 14 lines
reorder_to_cart {order_number: "000000123", multiplier: 2, preview: true}
→ 13 lines OK, 1 out of stock, gloves +8 %
(buyer confirms)
reorder_to_cart {order_number: "000000123", multiplier: 2}
→ cart saved, checkout_url
How it works
- The buyer's normal cart. Changes go into the same active cart the buyer sees in the minicart when they log in. Nothing new to learn.
- Today's prices and rules. Lines are added with Magento's own reorder logic (the stored buy request), so options, variants and bundles come back as bought. Prices, tier prices, catalog rules and stock are today's, for the buyer's customer group.
- All or nothing per change. Lines are added, totals are collected, the limits are checked, and only then is the cart saved. If a limit is broken, nothing is saved.
- Partial success is reported. A line Magento rejects (out of stock, minimum quantity, no longer sold) is listed with the reason. The other lines still go in.
Security model
- Only for a verified buyer. The tools appear in
tools/listonly when the request carries a customer token that Magento's token services verified (see module-mcp-server: Signed-in customers). Anonymous and integration-only connections do not see them, andexecute()refuses them anyway. - No identity in arguments. No tool accepts a customer id, email or login. The buyer comes only from the verified token.
- Own data only. Order lookups are filtered by the buyer's id and by the store views of the current website. Someone else's order number looks exactly like one that does not exist.
- Narrow output. Orders show SKUs, names, quantities, prices and status. No addresses, email or payment data.
- Storefront rules for products. Disabled products, products of another
website, and hidden products without a parent are refused — both in the
cart and in
get_my_prices, so prices of products a buyer cannot see on the store are not revealed. An oldcustom_pricefrom an admin-created order is never carried over. - Limits. Lines per call, quantity per line, lines in the cart, and an optional cart subtotal cap (base currency). All checked on the resulting cart, before saving.
- No order placement. There is no tool that places an order.
- Audit log. Every cart change is written to
var/log/angeo_mcp_reorder.log: tool, customer id, store, line counts. No product data or prices.
Requirements
- Magento Open Source, Mage-OS or Adobe Commerce 2.4.6+
- PHP 8.1 – 8.5
angeo/module-mcp-server^2.4.0 (customer tokens,CallerContextInterfaceand account linking, which is how connectors such as Claude reach a signed-in buyer)
Installation
composer require angeo/module-mcp-reorder bin/magento module:enable Angeo_McpReorder bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
Then, in Stores → Configuration → Angeo → MCP Server:
- Security → Accept Customer Tokens = Yes
- Customer Account Tools → Enable = Yes
Test from the shell, as a real customer, without a token:
bin/magento angeo:mcp:tools list_my_orders -c buyer@example.com
bin/magento angeo:mcp:tools reorder_to_cart -c buyer@example.com \
-a '{"order_number":"000000123","preview":true}'
Configuration
Stores → Configuration → Angeo → MCP Server → Customer Account Tools
| Setting | Default | Notes |
|---|---|---|
| Enable Customer Account Tools | No | per store view |
| Max Lines per Call | 50 | ceiling 100 |
| Max Quantity per Line | 1000 | resulting quantity of one cart line |
| Max Cart Lines | 100 | ceiling 500 |
| Max Cart Subtotal | 0 | base currency; 0 = no cap |
| Orders per Page | 10 | ceiling 50 |
Reordering also follows Magento's own Sales → Reorder → Allow Reorder.
Connecting a signed-in buyer
The buyer's Magento customer token must reach /mcp:
-
Through an MCP connector with account linking (how Claude connects, e.g. mcp.angeo.dev): the buyer signs in on your store and approves. The connector receives an MCP-only token (
amc_…) that works at/mcponly, and sends it asX-Customer-Tokennext to its Integration token. See module-mcp-server: Account linking. -
Directly, for testing only (Claude Code, MCP Inspector). Turn on Security → Accept Storefront Customer Tokens (testing) first, and off again afterwards: an ordinary customer token was issued for REST and GraphQL, not for MCP.
TOKEN=$(curl -s -X POST https://your-store.example/rest/V1/integration/customer/token \ -H 'Content-Type: application/json' \ -d '{"username":"buyer@example.com","password":"…"}' | tr -d '"') claude mcp add --transport http my-store https://your-store.example/mcp \ -H "Authorization: Bearer $TOKEN"
Adobe Commerce B2B
The module works on Magento Open Source and Mage-OS with customer groups and
tier prices. On Adobe Commerce with the B2B extension, carts are changed
through the core cart (Quote::addProduct), so B2B rules that hook into the
cart apply. Negotiable quotes, requisition lists and purchase-order approval
are not touched: the buyer uses them at checkout as usual. Dedicated tools for
requisition lists are planned as an optional adapter.
Known limits
add_items_to_my_cartadds simple, virtual and configurable products. Bundles and grouped products: reorder them from a past order, or add them on the store.get_my_pricesshows prices before cart rules and tax, in base currency. The cart total is final.- A search by
skulooks at the latest 100 orders. - Multi-currency stores: price changes are only flagged when the order and the cart use the same currency.
License
MIT — see LICENSE.