Skip to content
Post

Connect Magento 2 with ChatGPT and Claude Using MCP

· By Anna Hyva · 6 min read

Running a Magento store often means jumping between admin grids, reports, and settings just to answer simple questions. Which orders haven’t shipped? Which products have no images? Which items are running low on stock?

Connect Magento 2 with ChatGPT and Claude Using MCP

With the Model Context Protocol (MCP), you can ask an AI assistant these questions in plain language and get answers pulled directly from your store. The free, self-hosted hyvago Magento 2 MCP Connector makes this possible by linking Magento to ChatGPT, Claude, and other MCP-compatible clients. Here is how it works, what it can do, and how to use it safely.

What Is MCP?

Model Context Protocol is an open standard that lets AI applications connect to external tools and data sources. Without it, an assistant only knows what it was trained on or what you paste into the chat. With MCP, it can retrieve live data, search records, and run approved actions in connected systems.

For Magento, MCP acts as a bridge between your store and the AI. You describe what you need, and the assistant uses Magento’s own backend functionality to get it done.

How the Magento MCP Connector Works?

The connector turns your Magento installation into an MCP server. AI clients connect to a public HTTPS endpoint and discover the tools you’ve made available.

A typical request flows like this:

  1. You ask the assistant a question or request an action.
  2. The assistant picks the right Magento tool.
  3. The request travels through the MCP connection.
  4. Magento checks authentication and permissions.
  5. The tool runs and returns the result.
  6. The assistant presents it in a readable format.

The AI never gets raw database access. Everything runs through Magento’s own functionality, authorization rules, and your configured permissions.

Key Features

The connector supports Magento Open Source, Adobe Commerce, and compatible Mage OS installs (2.4.8 or newer). It runs entirely on the backend, so it works with Hyvä and any other storefront theme. It includes more than 130 tools, plus:

  • Bearer Token and OAuth 2.1 (with PKCE) authentication
  • Role-based permissions tied to Magento admin users
  • Write-access controls and per-tool restrictions
  • Audit logs with PII redaction

What Can AI Do in Your Store?

Orders: Find pending or unshipped orders, review invoices and shipments, or ask why a specific order hasn’t shipped. With write access enabled, you can also add comments, create shipments, or issue refunds.

Catalog: Spot products with missing images, descriptions, or metadata. Update prices, create simple products, or manage categories and images.

Inventory: Check salable quantities, investigate reservations, and manage sources and stock transfers. The inventory module requires Multi Source Inventory.

Customers: Look up accounts by email, review addresses and groups, resend confirmation emails, or trigger password resets.

CMS and marketing: Find disabled pages, update content, review active cart price rules, and generate coupon codes for existing rules. Note that the connector manages existing rules; it doesn’t create new ones.

Reports: Ask for best sellers, 30-day revenue comparisons, abandoned carts, top customers, or zero-result search terms.

System diagnostics: Check invalid indexers, cache status, cron errors, and logs, or list installed modules.

Installation Overview

You’ll need Magento 2.4.8+, Composer, terminal access, and HTTPS. Then, from your Magento root:

composer require hyvago/magento2-mcp-connector

bin/magento module:enable hyvago_PiiRedactor hyvago_Mcp hyvago_McpInventoryTools hyvago_McpReportTools hyvago_McpTaxTools

bin/magento setup:upgrade

bin/magento setup:di:compile

bin/magento cache:flush

If you don’t use Multi Source Inventory, disable hyvago McpInventoryTools before running setup upgrade. Always test on staging first.

Authentication Options

Bearer Tokens suit developer tools and coding agents:

bin/magento hyvago:mcp:token:create --admin-user admin --name "AI Assistant"

The token inherits that admin’s permissions and is shown only once. Add allow writes only when needed, and use -s flags to limit a token to specific tools.

OAuth 2.1 is the better choice for hosted assistants like ChatGPT and Claude. An administrator signs in and approves access through an interactive flow. Register a client through the CLI or Magento Admin, and check available presets with list presets.

Connecting ChatGPT and Claude

For both, you add a custom MCP connection pointing to your store’s endpoint, configure the OAuth details, then sign in to Magento Admin and approve access. In ChatGPT, this may require Developer Mode, depending on your plan. In Claude, you add a custom connector in the connector settings.

Because these interfaces change often, follow the official setup guide at hyvago.com/magento-mcp for current steps.

Coding agents such as Claude Code and Cursor can connect with a bearer token:

claude mcp add --transport http magento https://your-store.com/mcp --header "Authorization: Bearer YOUR_TOKEN"

Security Best Practices

Connecting AI to your store deserves the same care as any admin access:

  • Start read-only. Explore on staging before allowing any changes.
  • Require layered write permissions. Writes need global enablement, a write-capable token or scope, and the right admin permission.
  • Restrict tools. Expose only what each workflow needs.
  • Use separate tokens per user or app, and revoke unused ones.
  • Configure allowed origins and make sure your firewall, CDN, or WAF permits the MCP endpoint.
  • Review audit logs regularly.

Configuration writing is disabled by default and limited to allowlisted paths. Also review any AI-generated content before it goes live.

Custom MCP Tools

The connector is extensible. Developers can implement its tool interface and register tools via dependency injection, for example to check ERP sync status, query marketplace orders, or expose custom product attributes. Custom tools should respect Magento’s service contracts and ACL rules.

Conclusion

MCP gives Magento merchants and developers a practical way to bring AI into daily store operations, from order lookups and catalog audits to inventory checks and diagnostics. The hyvago connector pairs that convenience with real controls: admin permissions, read-only mode, tool restrictions, and audit logging. Start small on staging, keep access tight, and expand only as your team gains confidence.

Need Help with Magento AI Integration?

Whether you want to set up the MCP connector, secure your configuration, or build custom AI tools for your store, our team can help. Contact us today for support.

FAQs

1. What is a Magento MCP connector?

It’s an extension that turns your Magento store into an MCP server, so AI assistants like ChatGPT and Claude can securely retrieve data and perform approved actions using natural language.

2. Is the hyvago Magento 2 MCP Connector free?

Yes. It’s a free, self-hosted extension available on GitHub, supporting Magento Open Source, Adobe Commerce, and Mage OS.

3. Is it safe to connect AI to my Magento store?

It can be, when configured carefully. The connector uses admin role permissions, optional read-only mode, per-tool restrictions, and PII-redacted audit logs. Start on staging with read-only access.

4. Does it work with Hyva themes?

Yes. It operates on the backend, so it’s independent of your storefront theme, including Hyva.

5. Can AI make changes to my products and orders?

Only if you allow it. Write access needs global enablement, a write-capable token or OAuth scope, and the matching admin permission. Otherwise it stays read-only.

Leave a Reply

Your email address will not be published. Required fields are marked *