How to Let an AI Agent Complete a Magento 2 Checkout via MCP

How to Let an AI Agent Complete a Magento 2 Checkout via MCP

Leader 8 28
calendar_todayschedule2 min read
— Originally published at angeo.dev

AI agents can already find products in your store. This tutorial shows how to let them actually buy — completing a full guest checkout in Magento 2 through the Model Context Protocol (MCP), with no browser automation.

We'll use angeo/module-mcp-checkout, an open-source MIT module, and walk through the tool sequence, the payment problem, and how to install it.

What you'll build

A Magento 2 store that exposes checkout as six MCP tools, so an AI agent (Claude, ChatGPT, or any MCP client) can:

  1. Search products
  2. Create a cart and add items
  3. Get shipping methods
  4. Set the shipping address
  5. Place a real order — after user confirmation

The MCP tool sequence

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

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 SKU
get_shipping_methods()     → estimate delivery options
set_shipping_information() → apply address + method
place_order()              → submit cart → order_number

Step 1 — Install the module

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

This exposes a JSON-RPC MCP endpoint at https://your-store.com/mcp with Bearer auth, rate limiting, and logging built in.

Step 2 — Connect an AI agent

In Claude: Settings → Connectors → Add custom connector, then paste your endpoint URL. In ChatGPT: enable Developer Mode, then add it as a custom app. The same endpoint works with Perplexity, Grok, and Mistral too — MCP is an open standard.

Step 3 — Run a checkout

Ask the agent: "Find me a backpack and help me check out." It will call search_products, then walk through cart, shipping, and confirmation. Here's the response from a real place_order call:

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

The order lands in your Magento admin like any other.

The payment problem (important)

MCP agents can't process card payments directly. Card tokenization needs a PCI-compliant browser form — incompatible with a server-side MCP tool call. This is exactly what forced OpenAI to pull its native agentic checkout.

The workaround: the agent places the order with a deferred payment method (status pending), and payment is handled separately — a merchant invoice, a Stripe/Mollie/Adyen payment link, or a redirect to the store's normal checkout page. The whole agent flow stays outside PCI scope. No extra fees beyond standard gateway rates.

Security notes

  • Bearer authentication on every request
  • Configurable rate limiting
  • Operates within Magento's standard ACL
  • HTTPS only
  • place_order never fires without explicit user confirmation

Current scope (v1.0.0)

  • Guest checkout only (registered customer support planned)
  • Configurable products added by child SKU
  • Deferred payment / payment link handoff
  • Optional agent order limit in admin

Wrapping up

That's a full agentic checkout in Magento 2 — no Selenium, no Playwright, no scraping. The module is MIT-licensed and part of the open-source angeo.dev Agentic Readiness Suite for Magento 2 / Adobe Commerce.

Have you tried building MCP tools for commerce? I'd be curious how others are handling the payment handoff — drop a comment.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

MCP Is the USB-C of AI. So Why Are You Plugging Everything In?

Ken W. Algerverified - Jun 10

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

Sovereign Intelligence: The Complete 25,000 Word Blueprint (Download)

Pocket Portfolio - Apr 1
chevron_left
1.9k Points36 Badges
11Posts
12Comments
8Connections

Commenters (This Week)

5 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!