Skip to main content
Glama
Magento 2 MCP Server

Magento 2 MCP Server

by boldcommerce

Magento 2 MCP サーバー

これは、Magento 2 REST API に接続するモデル コンテキスト プロトコル (MCP) サーバーであり、Claude や他の MCP クライアントが Magento ストアから製品情報を照会できるようにします。

特徴

製品の特徴

  • SKUまたはIDで製品情報を照会する

  • さまざまな条件で製品を検索する

  • 製品カテゴリを取得する

  • 関連商品を入手する

  • 製品在庫情報を取得する

  • 製品属性を取得する

  • 属性コードと値を指定して製品属性を更新します

  • フィルタリングと並べ替えによる高度な製品検索

顧客の特徴

  • 顧客の注文したすべての商品をメールアドレスで取得する

注文と収益機能

  • 特定の日付範囲の注文数を取得する

  • 特定の日付範囲の収益を取得する

  • 特定の日付範囲で国別にフィルタリングされた収益を取得します

  • 販売数量や売れ筋商品などの商品販売統計を取得します

  • 「今日」、「昨日」、「先週」、「今月」、「YTD」などの相対的な日付表現のサポート

  • 国コードと国名の両方を使用した国フィルタリングのサポート

Related MCP server: keycrm-mcp

前提条件

  • Node.js (v14以上)

  • REST APIアクセスを備えたMagento 2インスタンス

  • Magento 2インスタンスのAPIトークン

インストール

  1. このリポジトリをクローンする

  2. 依存関係をインストールします:

npm install

使用法

サーバーを直接実行する

node mcp-server.js

テストクライアントによるテスト

node test-mcp-server.js

Claude Desktopでの使用

  1. パスノードをwhich nodeで確認するか

  2. 開発者設定に移動し、「設定を編集」をクリックします。JSONファイルが開きます。

  3. mcpServers内に次のスニペットを追加します。

    "magento2": {
      "command": "/path/to/your/node",
      "args": ["/path/to/mcp-server.js"],
      "env": {
        "MAGENTO_BASE_URL": "https://YOUR_DOMAIN/rest/V1",
        "MAGENTO_API_TOKEN": "your-api-token"
      }
    }
  1. /path/to/your/node手順 1 で確認したパスに置き換えます。

  2. /path/to/mcp-server.js 、このリポジトリをクローンしたパスに置き換えます。

  3. Magento管理画面の「システム」>「統合」からAPIトークンを取得できます。

  4. Claude Desktop を再起動します。

  5. これで、Magento ストア内の製品について Claude に質問できるようになります。

利用可能なツール

サーバーは次のツールを公開します。

製品ツール

  • get_product_by_sku : SKU別に製品の詳細情報を取得する

  • search_products : Magentoの検索条件を使用して製品を検索する

  • get_product_categories : SKU で特定の商品のカテゴリを取得します

  • get_related_products : SKUで特定の商品に関連する商品を取得する

  • get_product_stock : SKU別に商品の在庫情報を取得する

  • get_product_attributes : SKU別に製品のすべての属性を取得する

  • get_product_by_id : IDで製品の詳細情報を取得します

  • advanced_product_search : 高度なフィルタリングオプションを使用して製品を検索します

  • update_product_attribute : SKU別に商品の特定の属性を更新する

顧客ツール

  • get_customer_ordered_products_by_email : 顧客の注文したすべての商品をメールアドレスで取得する

注文と収益ツール

  • get_order_count : 指定された日付範囲の注文数を取得する

  • get_revenue : 指定された日付範囲の合計収益を取得します

  • get_revenue_by_country : 指定した日付範囲の国別にフィルタリングした収益を取得します。

  • get_product_sales : 指定された日付範囲で販売された製品の数量に関する統計を取得します。

クロードのクエリ例

MCP サーバーが Claude Desktop に接続されると、次のような質問をすることができます。

製品に関する問い合わせ

  • 「シャツにはどんな商品がありますか?」

  • 「SKU SKU-xxxの製品について教えてください」

  • 「製品 SKU-xxx はどのカテゴリに属しますか?」

  • 「SKU-SKU-xxxに関連する商品はありますか?」

  • 「商品SKU-xxxの在庫状況はどうですか?」

  • 「価格順にすべての商品を表示」

  • 「製品SKU-xxxの価格を49.99ドルに更新します」

  • 「商品 ABC-123 の説明を、耐水性と変更してください」

  • 「製品XYZ-456のステータスを「有効」に設定する」

顧客からの問い合わせ

注文と収益のクエリ

  • 「今日の注文は何件ですか?」

  • 「先週の注文数はどれくらいですか?」

  • 「昨日はどれくらいの収益を上げましたか?」

  • 「先月の総収益はいくらでしたか?」

  • 「今年これまでにオランダでどれだけの収益を上げましたか?」

  • 「先週のドイツでの収益はいくらですか?」

  • 「今月の米国とカナダの収益を比較してください」

  • 「今月完了した注文の平均注文額はいくらですか?」

  • 「先月は商品をいくつ販売しましたか?」

  • 「今年最も売れた商品は何ですか?」

  • 「1 回の注文あたりの平均商品数はどれくらいですか?」

  • 「前四半期にドイツでXYZ-123製品を何ユニット販売しましたか?」

  • 「今月、米国で最も収益を生み出した製品はどれですか?」

発達

SSL証明書の検証

開発目的では、サーバーはSSL証明書の検証をバイパスするように設定されています。本番環境では、適切なSSL証明書を使用し、 callMagentoApi関数からhttpsAgent設定を削除する必要があります。

新しいツールの追加

新しいツールを追加するには、既存のコードのパターンに従ってください。各ツールは次のように定義されています。

  1. ユニークな名前

  2. 説明

  3. Zodを使用した検証による入力パラメータ

  4. リクエストを処理してレスポンスを返す非同期ハンドラ関数

ライセンス

ISC

Available Tools

14 tools
get_customer_ordered_products_by_emailC

Get all ordered products for a customer by email address

Inputs: email (required).

get_order_countC

Get the number of orders for a given date range

Inputs: date_range (required), status.

get_product_attributesC

Get all attributes for a product by SKU

Inputs: sku (required).

get_product_by_idB

Get detailed information about a product by its ID

Inputs: id (required).

get_product_by_skuC

Get detailed information about a product by its SKU

Inputs: sku (required).

get_product_categoriesC

Get categories for a specific product by SKU

Inputs: sku (required).

get_product_salesB

Get statistics about the quantity of products sold in a given date range

Inputs: date_range (required), status, country.

get_product_stockC

Get stock information for a product by SKU

Inputs: sku (required).

get_revenueB

Get the total revenue for a given date range

Inputs: date_range (required), status, include_tax.

get_revenue_by_countryC

Get revenue filtered by country for a given date range

Inputs: date_range (required), country (required), status, include_tax.

search_productsC

Search for products using Magento search criteria

Inputs: query (required), page_size, current_page.

update_product_attributeC

Update a specific attribute of a product by SKU

Inputs: sku (required), attribute_code (required), value.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have distinct purposes focused on specific data retrieval or updates, but there is some overlap between 'advanced_product_search' and 'search_products' which could cause confusion as both search for products. The other tools are clearly differentiated by their target resources (products, orders, customers, revenue) and actions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, with verbs like 'get', 'search', and 'update' clearly indicating actions. This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming conventions.

    Tool Count5/5

    With 14 tools, the server is well-scoped for a Magento 2 e-commerce platform, covering key areas like products, orders, customers, and revenue. Each tool serves a specific purpose without bloat, making the count appropriate for the domain's complexity.

    Completeness4/5

    The tool set provides strong coverage for data retrieval and some updates in the e-commerce domain, including product details, sales, and revenue. However, there are minor gaps such as the lack of tools for creating or deleting products or orders, which agents might need to work around for full CRUD operations.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that lets Claude manage keyCRM catalogue, stock, orders, customers, pipelines, and more via natural language.
      3
      ISC
    • F
      license
      Not graded
      quality
      B
      maintenance
      Freento MCP is a native Magento 2 extension that implements the Model Context Protocol (MCP) — an open standard for connecting AI assistants to external data sources. This server acts as a secure, direct bridge between your Adobe Commerce / Magento 2 store and LLM-powered assistants (like Claude, ChatGPT, and others), allowing you to manage and audit your store using natural language.
      18
      -