Skip to main content
Glama

Magento MCP Server

An MCP (Model Context Protocol) server for Adobe Commerce / Magento 2 administration. Connects AI assistants like Claude, Windsurf, Cursor, and other MCP-compatible clients to your Magento instance for business-level operations — catalog management, promotions, CMS, diagnostics, and more.

Features

  • 30+ tools for Magento administration via the standard MCP protocol

  • OAuth 1.0 (HMAC-SHA256) integration authentication — no 2FA prompts

  • Two-phase commit for bulk operations (prepare → review → commit)

  • Built-in guardrails — bulk caps, price change warnings, confirmation requirements

  • Multi-store aware — explicit scope handling for websites, stores, and store views

  • Audit logging — every action logged with timestamps, user, and parameters

Related MCP server: magento-sql-mcp-server

Available Tools

Auth & Scope

  • auth.login / auth.logout / auth.whoami — session management

  • scope.list_websites_stores / scope.set_default — multi-store scope

Catalog

  • catalog.search_products — search with filters, pagination, field projection

  • catalog.get_product — full product details by SKU

  • catalog.prepare_bulk_update / catalog.commit_bulk_update — two-phase bulk product updates

Pricing

  • pricing.prepare_bulk_price_update / pricing.commit_bulk_price_update — safe bulk price changes with threshold warnings

Promotions

  • promotions.search_rules / promotions.get_rule — find and inspect cart price rules

  • promotions.prepare_cart_price_rule_create / promotions.commit_cart_price_rule_create — create rules safely

  • promotions.update_rule / promotions.enable_rule / promotions.disable_rule

  • promotions.generate_coupons / promotions.export_coupons

CMS

  • cms.search_pages / cms.get_page — find and read CMS pages

  • cms.prepare_bulk_update_pages / cms.commit_bulk_update_pages

  • cms.search_blocks / cms.get_block

  • cms.prepare_bulk_update_blocks / cms.commit_bulk_update_blocks

SEO

  • seo.prepare_bulk_update_url_keys / seo.commit_bulk_update_url_keys — URL key changes with collision detection

  • seo.bulk_update_meta — bulk meta title/description/keyword updates

  • seo.report_redirect_chains — find redirect chain issues

Diagnostics

  • diagnostics.product_display_check — why isn't my product showing?

  • diagnostics.indexer_status_report — indexer health check

  • diagnostics.inventory_salable_report — MSI stock/salable quantity

Cache

  • cache.purge_by_url / cache.purge_product / cache.purge_category — targeted cache invalidation (Fastly or fallback)

Quick Start

Prerequisites

  • Node.js 18+

  • A Magento 2 / Adobe Commerce instance

  • An Integration configured in Magento with appropriate API permissions

Installation

git clone https://github.com/thomastx05/magento-mcp.git
cd magento-mcp
npm install
npm run build

Magento Integration Setup

  1. In Magento Admin, go to System > Integrations > Add New Integration

  2. Give it a name (e.g., "MCP Server")

  3. Under API, select the resources you want to expose

  4. Save and Activate the integration

  5. Copy the four OAuth credentials:

    • Consumer Key

    • Consumer Secret

    • Access Token

    • Access Token Secret

MCP Client Configuration

Add to your MCP client config (e.g., mcp_config.json for Windsurf, claude_desktop_config.json for Claude Desktop):

{
  "mcpServers": {
    "magento-mcp": {
      "command": "node",
      "args": ["C:/path/to/magento-mcp/dist/index.js"],
      "env": {
        "MAGENTO_BASE_URL": "https://your-magento-instance.com",
        "MAGENTO_OAUTH_CONSUMER_KEY": "your_consumer_key",
        "MAGENTO_OAUTH_CONSUMER_SECRET": "your_consumer_secret",
        "MAGENTO_OAUTH_TOKEN": "your_access_token",
        "MAGENTO_OAUTH_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}

Alternative: Username/Password Auth

If you prefer admin token auth instead of OAuth (requires handling 2FA if enabled):

{
  "env": {
    "MAGENTO_BASE_URL": "https://your-magento-instance.com",
    "MAGENTO_ADMIN_USERNAME": "your_admin_user",
    "MAGENTO_ADMIN_PASSWORD": "your_admin_password"
  }
}

Usage

Once configured, call auth.login first to establish a session, then use any tool:

> auth.login
Login successful (OAuth 1.0 integration)

> catalog.search_products { filters: { name: { value: "%eye drops%", condition: "like" } } }
Found 12 products...

> diagnostics.inventory_salable_report { sku: "PROD-001" }
Qty: 3,805 | In Stock: Yes | Backorders: Enabled

Architecture

src/
  index.ts              # MCP server entry point (McpServer + StdioServerTransport)
  config/index.ts       # Configuration & guardrail defaults
  actions/              # Tool handlers (one file per domain)
    auth.ts
    catalog.ts
    pricing.ts
    promotions.ts
    cms.ts
    seo.ts
    diagnostics.ts
    cache.ts
    scope.ts
  client/
    magentoRest.ts      # REST client with OAuth 1.0 signing
    fastlyClient.ts     # Optional Fastly CDN integration
  session/
    sessionStore.ts     # In-memory session & OAuth credential storage
    planStore.ts        # Two-phase commit plan storage
    idempotencyLedger.ts
  validation/
    schemas.ts          # Zod input schemas for all tools
    guardrails.ts       # Safety checks (bulk caps, price thresholds, confirmations)
  protocol/
    types.ts            # TypeScript interfaces
  audit/
    auditLogger.ts      # Action audit trail (JSONL)

Security

  • No credentials stored on disk — OAuth tokens are passed via environment variables and kept in memory only

  • Magento ACL enforced — the integration's API permissions control what the server can do

  • Guardrails on top — bulk operation caps, price change thresholds, and confirmation requirements provide defense-in-depth

  • Two-phase commit — destructive bulk operations require explicit review and confirmation

  • Audit trail — every action is logged with timestamp, user, parameters, and result

Configuration

Guardrails and limits are configurable in src/config/index.ts:

Setting

Default

Description

maxSkusPerBulkCommit

500

Max products per bulk update

maxCouponQtyPerGeneration

1000

Max coupons per generation

priceChangeThresholdPercent

50

Warning threshold for price changes (%)

maxDiscountPercent

50

Max percent discount without override

allowedCatalogUpdateFields

name, description, status, visibility, ...

Whitelist for bulk catalog updates

Optional: Fastly CDN Integration

For targeted cache purge via Fastly, add these environment variables:

{
  "env": {
    "FASTLY_SERVICE_ID": "your_service_id",
    "FASTLY_API_TOKEN": "your_api_token"
  }
}

License

MIT

Available Tools

38 tools
auth_loginB

Authenticate with Magento Admin credentials and establish a session.

Inputs: params.

auth_logoutB

Destroy the current session.

Inputs: params.

auth_whoamiB

Return current admin user info for the active session.

Inputs: params.

cache_purge_by_urlB

Purge specific URLs from CDN cache.

Inputs: params.

cache_purge_categoryC

Purge cache for a specific category.

Inputs: params.

cache_purge_productC

Purge cache for a specific product by SKU.

Inputs: params.

catalog_commit_bulk_updateB

Execute a previously prepared bulk product update.

Inputs: params.

catalog_get_productA

Get full product details by SKU.

Inputs: params.

catalog_prepare_bulk_updateB

Prepare a bulk product update. Returns a plan with affected count and sample diffs.

Inputs: params.

catalog_search_productsC

Search products with filters, pagination, and optional scope.

Inputs: params.

cms_commit_bulk_update_blocksB

Execute a previously prepared CMS block bulk update.

Inputs: params.

cms_commit_bulk_update_pagesB

Execute a previously prepared CMS page bulk update.

Inputs: params.

cms_get_blockC

Get a CMS block by ID.

Inputs: params.

cms_get_pageB

Get a CMS page by ID.

Inputs: params.

cms_prepare_bulk_update_blocksC

Prepare a bulk update for CMS blocks.

Inputs: params.

cms_prepare_bulk_update_pagesC

Prepare a bulk update for CMS pages.

Inputs: params.

cms_search_blocksC

Search CMS blocks by query string.

Inputs: params.

cms_search_pagesC

Search CMS pages by query string.

Inputs: params.

diagnostics_indexer_status_reportC

Report on the status of all Magento indexers.

Inputs: params.

diagnostics_inventory_salable_reportC

Report on MSI salable quantity for a product.

Inputs: params.

diagnostics_product_display_checkB

Check why a product may not be displaying correctly on the storefront.

Inputs: params.

pricing_commit_bulk_price_updateC

Execute a previously prepared bulk price update.

Inputs: params.

pricing_prepare_bulk_price_updateA

Prepare a bulk price update. Returns plan with affected count, diffs, and warnings.

Inputs: params.

promotions_commit_cart_price_rule_createA

Execute a previously prepared cart price rule creation.

Inputs: params.

promotions_disable_ruleC

Disable a cart price rule.

Inputs: params.

promotions_enable_ruleC

Enable a cart price rule.

Inputs: params.

promotions_export_couponsC

Export coupon codes for a rule in CSV format.

Inputs: params.

promotions_generate_couponsC

Generate coupon codes for an existing cart price rule.

Inputs: params.

promotions_get_ruleC

Get details of a specific cart price rule.

Inputs: params.

promotions_prepare_cart_price_rule_createB

Validate and prepare a cart price rule for creation. Returns a plan for review.

Inputs: params.

promotions_search_rulesB

Search cart price rules by query, website, or enabled status.

Inputs: params.

promotions_update_ruleB

Update an existing cart price rule.

Inputs: params.

scope_list_websites_storesC

List all websites, stores, and store views configured in Magento.

Inputs: params.

scope_set_defaultC

Set the default store view scope for the current session.

Inputs: params.

seo_bulk_update_metaC

Bulk update meta fields (title, description, keywords) for products.

Inputs: params.

seo_commit_bulk_update_url_keysB

Execute a previously prepared bulk URL key update.

Inputs: params.

seo_prepare_bulk_update_url_keysC

Prepare a bulk URL key update with collision validation and redirect plan.

Inputs: params.

seo_report_redirect_chainsC

Report on URL redirect chains up to a configurable depth.

Inputs: params.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 38 tools

    Disambiguation5/5

    All 38 tools are grouped by domain prefix (auth_, cache_, catalog_, etc.) and each tool within its group has a distinct purpose, e.g., cache_purge_by_url vs cache_purge_category. No two tools overlap in functionality.

    Naming Consistency5/5

    Tool names consistently follow the pattern <domain>_<verb>_<object?>, all in snake_case. Verbs are uniform (e.g., get, search, prepare, commit, enable, disable) with no mixing of styles or conventions.

    Tool Count4/5

    38 tools is slightly above the typical range but justified by the broad domain of Magento e-commerce administration. Each tool serves a clear, non-redundant purpose, though consolidation could be explored.

    Completeness3/5

    Covers authentication, cache, catalog (bulk operations only), CMS, diagnostics, pricing, promotions, scope, and SEO. Missing individual CRUD for products, delete operations, customer management, and order management, which are notable gaps for a Magento server.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to interact with a Magento 2 or Adobe Commerce MySQL database through 50+ read-only tools for orders, catalog, customers, CMS, configuration, indexers, and diagnostics, with support for local DDEV, Commerce Cloud, and remote/SSH connections.
      44
      11 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to shop and query Magento/Mage-OS stores via the storefront GraphQL API, including product search, stock checks, category browsing, cart management, and customer order status.
      11
      MIT