BM

boldcommerce/magento2-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

68 stars 26 forks 质量 63 趋势 0GPL-3.0

boldcommerce/magento2-mcp 是从 https://github.com/boldcommerce/magento2-mcp. 导入的 MCP 服务器候选服务器。

概览

boldcommerce/magento2-mcp 是从 https://github.com/boldcommerce/magento2-mcp. 导入的 MCP 服务器候选服务器。

概述(AI 翻译)

这是一个模型上下文协议(MCP)服务器,连接到 Magento 2 的 REST API,允许 Claude 和其他 MCP 客户端从 Magento 存储中查询产品信息。

特色

产品特色

  • 按SKU或ID查询产品信息
  • 使用多种标准搜索产品
  • 获取产品类别
  • 获取相关产品
  • 获取产品库存信息
  • 获取产品属性
  • 通过指定属性代码和数值来更新产品属性
  • 带有筛选和排序功能的高级产品搜索

客户特色

  • 通过电子邮件地址获取客户的所有订购产品

订单与收入特征

  • 获取特定日期范围的订单数量
  • 针对特定日期范围获取收入
  • 按国家筛选特定日期范围的收入
  • 获取产品销售统计数据,包括销售数量和畅销产品
  • 支持相对日期表达,如“今天”、“昨天”、“上周”、“本月”、“年初至今”
  • 支持使用国家代码和国家名称进行国家筛选

先修条件

  • Node.js(v14或更高)
  • 一个支持 REST API 的 Magento 2 实例
  • Magento 2 实例的 API 令牌

安装

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Magento 2 MCP Server

This is a Model Context Protocol (MCP) server that connects to a Magento 2 REST API, allowing Claude and other MCP clients to query product information from a Magento store.

Features

Product Features

  • Query product information by SKU or ID
  • Search for products using various criteria
  • Get product categories
  • Get related products
  • Get product stock information
  • Get product attributes
  • Update product attributes by specifying attribute code and value
  • Advanced product search with filtering and sorting

Customer Features

  • Get all ordered products for a customer by email address

Order and Revenue Features

  • Get order count for specific date ranges
  • Get revenue for specific date ranges
  • Get revenue filtered by country for specific date ranges
  • Get product sales statistics including quantity sold and top-selling products
  • Support for relative date expressions like “today”, “yesterday”, “last week”, “this month”, “YTD”
  • Support for country filtering using both country codes and country names

Prerequisites

  • Node.js (v14 or higher)
  • A Magento 2 instance with REST API access
  • API token for the Magento 2 instance

Installation

  1. Clone this repository
  2. Install dependencies:
npm install

Usage

Running the server directly

node mcp-server.js

Testing with the test client

node test-mcp-server.js

Using with Claude Desktop

  1. Check your path node with which node
  2. Go to the Developer settings and click “Edit config”. This will open a JSON file.
  3. Add the following snippet within the 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. Replace /path/to/your/node with the path you checked in step 1
  2. Replace /path/to/mcp-server.js with the path where you cloned this repo
  3. You can get an API token from System > Integrations in the Magento admin
  4. Restart Claude Desktop.
  5. You should now be able to ask Claude questions about products in your Magento store.

Available Tools

The server exposes the following tools:

Product Tools

  • get_product_by_sku: Get detailed information about a product by its SKU
  • search_products: Search for products using Magento search criteria
  • get_product_categories: Get categories for a specific product by SKU
  • get_related_products: Get products related to a specific product by SKU
  • get_product_stock: Get stock information for a product by SKU
  • get_product_attributes: Get all attributes for a product by SKU
  • get_product_by_id: Get detailed information about a product by its ID
  • advanced_product_search: Search for products with advanced filtering options
  • update_product_attribute: Update a specific attribute of a product by SKU

Customer Tools

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →