home / mcp / magento 2 mcp server

Magento 2 MCP Server

A MCP server for Magento 2

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "boldcommerce-magento2-mcp": {
      "command": "node",
      "args": [
        "mcp-server.js"
      ],
      "env": {
        "MAGENTO_BASE_URL": "https://YOUR_DOMAIN/rest/V1",
        "MAGENTO_API_TOKEN": "your-api-token"
      }
    }
  }
}

You can connect to a Magento 2 REST API from Claude and other MCP clients through this MCP server to query product, customer, and revenue data. It acts as a bridge that lets you retrieve and manage Magento information via MCP endpoints with a straightforward local or remote setup.

How to use

You run the local MCP server with Node.js and then connect your MCP client to it. The server exposes a set of product, customer, and order/revenue tools that you can invoke from your MCP client by name. Use the tools to fetch products by SKU or ID, search products with filters, read categories and stock information, update product attributes, retrieve a customer’s ordered products, and obtain order counts and revenue over time. The server uses your Magento 2 REST API endpoint and an API token to access data.

To start querying Magento data, first ensure your Magento REST API URL and token are available as environment variables on the MCP server process. Then initiate a request from your MCP client to the corresponding tool, using the tool name and required parameters. For example, you can ask for a product’s details by SKU, fetch category data for a product, or retrieve revenue for a date range. The available tool names map one-to-one with the features described in the server’s capabilities.

How to install

Prerequisites: you need Node.js version 14 or higher and a Magento 2 instance with REST API access. You also need a Magento API token.

Step 1: Install Node.js if it is not already installed. You can download it from the official Node.js site and verify with node -v.

Step 2: Install dependencies for the MCP server by running the package manager in the project directory.

npm install

Running the server directly

Start the MCP server with Node.js using the local script designated for the server.

node mcp-server.js

Using with Claude Desktop

Prepare your Claude Desktop configuration to run the MCP server locally. You will provide the runtime command and the environment variables needed to reach Magento.

Environment variables you should provide to the MCP server process include the Magento base URL and the Magento API token.

{
  "magento2": {
    "command": "node",
    "args": ["mcp-server.js"],
    "env": {
      "MAGENTO_BASE_URL": "https://YOUR_DOMAIN/rest/V1",
      "MAGENTO_API_TOKEN": "your-api-token"
    }
  }
}

Notes on security and usage

For development, the server may bypass SSL certificate verification, but you should enable proper SSL in production. Ensure you protect your Magento API token and limit access to the MCP server with appropriate network controls.

Troubleshooting and tips

If you cannot reach Magento or your tokens are rejected, double-check that MAGENTO_BASE_URL and MAGENTO_API_TOKEN are correct and that the Magento REST API is accessible from the MCP server host.

Available 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.

get_customer_ordered_products_by_email

Get all ordered products for a customer by email address.

get_order_count

Get the number of orders for a given date range.

get_revenue

Get the total revenue for a given date range.

get_revenue_by_country

Get revenue filtered by country for a given date range.

get_product_sales

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