Magento MCP Server

Magento MCP Server

Enables AI assistants to manage Adobe Commerce and Magento 2 instances through business-level tools for catalog, promotions, CMS, and SEO. It features secure OAuth 1.0 authentication, safety guardrails for bulk operations, and built-in diagnostic reports for store health.

Category
访问服务器

README

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

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选