Magento 2 MCP server

Connects Claude to Magento 2 e-commerce platforms for querying product information, customer data, order statistics, and revenue metrics using natural language date expressions and geographical filtering.
Back to servers
Provider
Bold Commerce
Release date
Apr 17, 2025
Language
TypeScript
Stats
13 stars

The Magento 2 MCP Server allows Claude and other MCP clients to access and manipulate product information from a Magento store through a Model Context Protocol server. This integration enables natural language interactions with your Magento 2 store data including product details, customer orders, and revenue statistics.

Prerequisites

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

Installation

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

Running the Server

Basic Execution

Start the server directly with:

node mcp-server.js

Test with the Built-in Client

To verify everything works correctly:

node test-mcp-server.js

Connecting with Claude Desktop

  1. Determine your Node.js path:
which node
  1. Navigate to Claude Desktop's Developer settings and click "Edit config"
  2. Add this configuration within the mcpServers section:
"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 placeholder values:
    • /path/to/your/node with the actual Node.js path
    • /path/to/mcp-server.js with the full path to the server file
    • Replace your domain and API token (available under System > Integrations in Magento admin)
  2. Restart Claude Desktop

Available Functionality

Product Tools

  • Get product details by SKU or ID
  • Search products with filtering and sorting
  • View product categories and related products
  • Check product stock information
  • Retrieve and update product attributes

Customer Tools

  • View ordered products by customer email

Order and Revenue Tools

  • Count orders for specific time periods
  • Calculate revenue with date range filtering
  • Analyze revenue by country
  • View product sales statistics

Example Queries

Once connected to Claude, you can ask natural language questions like:

Product Questions

  • "What products do you have that are shirts?"
  • "Tell me about product with SKU SKU-xxx"
  • "Are there any related products to SKU-xxx?"
  • "Show me all products sorted by price"
  • "Update the price of product SKU-xxx to $49.99"

Customer Questions

Order and Revenue Questions

  • "How many orders do we have today?"
  • "What was our total revenue last month?"
  • "How much revenue did we make in The Netherlands this year to date?"
  • "What are our top-selling products this year?"
  • "Which products generated the most revenue in the US this month?"

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later