home / mcp / magento 2 mcp server
A MCP server for Magento 2
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.
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.
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 installStart the MCP server with Node.js using the local script designated for the server.
node mcp-server.jsPrepare 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"
}
}
}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.
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.
Get detailed information about a product by its SKU.
Search for products using Magento search criteria.
Get categories for a specific product by SKU.
Get products related to a specific product by SKU.
Get stock information for a product by SKU.
Get all attributes for a product by SKU.
Get detailed information about a product by its ID.
Search for products with advanced filtering options.
Update a specific attribute of a product by SKU.
Get all ordered products for a customer by email address.
Get the number of orders for a given date range.
Get the total revenue for a given date range.
Get revenue filtered by country for a given date range.
Get statistics about the quantity of products sold in a given date range.