# AI Agent Checkout in Magento 2: Claude Places a Real Order via MCP

> Source: <https://dev.to/angeo/ai-agent-checkout-in-magento-2-claude-places-a-real-order-via-mcp-2jbi>
> Published: 2026-07-09 16:57:32+00:00

AI agents can already *find* products. But can they actually *buy* them — placing a real order in a live Magento 2 store, without browser automation or scraping?

I built `angeo/module-mcp-checkout`

to answer that, and the short version is: yes. This post walks through the full flow, the architecture, and the one problem everyone asks about — payments.

```
User (Claude.ai)
      ↓
  MCP Client
      ↓
Magento MCP Endpoint  ←  Bearer auth + rate limiter
      ↓
Magento Service Layer
      ↓
  Quote / Cart
      ↓
    Order ✓
```

Every checkout runs the same tool sequence. Each call maps directly to a Magento service layer operation — no browser, no session, no cookies.

```
Claude
  ↓
search_products()          — find product by keyword
  ↓
get_product()              — verify SKU, price, stock
  ↓
create_cart()              — open guest cart, get cart_id
  ↓
add_to_cart()              — add item by child SKU
  ↓
get_shipping_methods()     — estimate delivery options
  ↓
set_shipping_information() — apply address + method
  ↓
[User confirms total]
  ↓
place_order()              — submit cart → order_number
```

The module exposes these as six MCP tools over a JSON-RPC endpoint:

`create_cart`

— opens a new guest cart`add_to_cart`

— adds a product by SKU`get_cart`

— reads current items and totals`get_shipping_methods`

— estimates available delivery options`set_shipping_information`

— sets address, email, and chosen method`place_order`

— submits the order after user confirmationNo browser automation, no scraping. The agent talks directly to the Magento backend through a secure, rate-limited MCP endpoint.

`place_order`

is never called autonomouslyReal session against [demo.angeo.dev](https://demo.angeo.dev). The prompt: *"I want to buy a Fusion Backpack."*

**Step 1 — Product discovery.** Claude called `search_products`

, then `get_product`

. It identified the Fusion Backpack (SKU: `24-MB02`

), in-stock at $59.

**Step 2 — Cart.** `create_cart`

returned a fresh `cart_id`

. `add_to_cart`

confirmed the item — subtotal $59.

**Step 3 — Shipping.** `get_shipping_methods`

returned Flat Rate — Fixed at $10.

**Step 4 — Address.** `set_shipping_information`

applied name, street, postcode, city, country, phone, email. Total: $69.

**Step 5 — Confirm & place.** After explicit user confirmation, `place_order`

submitted the cart:

```
{
  "order_number": "000000005",
  "status": "pending",
  "grand_total": 69,
  "currency": "USD"
}
```

A real order, in a real Magento store, placed entirely by an AI agent through MCP — with the user in control at every step.

This is the question everyone asks, and it deserves an honest answer.

MCP agents can't process card payments directly. Card tokenization requires a PCI-compliant browser form (Stripe.js / Payment Element) — fundamentally incompatible with a server-side MCP tool call. This is the same constraint that killed OpenAI's native agentic checkout: collecting card details through an agent violates PCI scope.

My approach sidesteps this by design. The agent places the order with a deferred payment method (status `pending`

). Payment happens separately:

No extra platform fees — only standard gateway rates apply. A dedicated `get_payment_link`

tool (Stripe, Mollie, Adyen) is planned for v2.0.0.

**Is browser automation required?** No. JSON-RPC MCP endpoint — no headless browser, no Selenium, no Playwright.

**Is MCP faster than browser automation?** Significantly. No page rendering, no DOM parsing. A full checkout completes in under 5 seconds.

**Does this work with Adobe Commerce?** Yes — Magento Open Source and Adobe Commerce 2.4.x.

**Does the agent act autonomously?** No. `place_order`

only fires after explicit user confirmation.

```
composer require angeo/module-mcp-checkout
bin/magento module:enable Angeo_McpCheckout
bin/magento setup:upgrade
```

MIT-licensed, part of the open-source [angeo.dev](https://angeo.dev) Agentic Readiness Suite for Magento 2.

*Disclosure: I built this module. It's open-source MIT. Genuinely curious what other Magento devs think about agentic checkout as a direction — happy to answer anything about the architecture or MCP tool design in the comments.*
