Magento 2 MCP
Magento 2 MCP Server connects to Magento 2 REST API, enabling product queries, orders, and revenue insights. It supports advanced search, stock info, customer orders, and date-filtered sales statistics.
How to Install and Use Magento 2 MCP
Magento 2 MCP is a handy server tool that connects to a Magento 2 REST API. It helps you get product information and more from your Magento store. Below is a simple guide to install and start using Magento 2 MCP with examples.
Prerequisites Before Installation
Before you install Magento 2 MCP, make sure you have a few things ready. These are needed so the tool works correctly.
- You need Node.js version 14 or higher installed on your computer.
- You should have a Magento 2 store set up with REST API access.
- You must have an API token from your Magento 2 store. This token allows Magento 2 MCP to access your store data securely.
With these prepared, you’re ready to install Magento 2 MCP.
Installing Magento 2 MCP Step-by-Step
To get Magento 2 MCP working, follow these steps carefully:
- Clone the Repository:
First, download the code by cloning the Magento 2 MCP GitHub repository. Open your terminal or command prompt and run:git clone https://github.com/boldcommerce/magento2-mcp.git - Install Dependencies:
After cloning, go inside the folder and install required packages using npm:cd magento2-mcp npm install
This sets up all the necessary files and modules Magento 2 MCP needs.
Running the Magento 2 MCP Server
Once it’s installed, you want to start the MCP server so it can talk to your Magento store.
Use this command in the terminal inside the cloned folder:
node mcp-server.js
This runs the server directly on your machine.
Testing the Server with a Client
If you want to test that the MCP server works, run the provided test client like this:
node test-mcp-server.js
This will let you try example queries to see Magento 2 MCP in action.
Connecting Magento 2 MCP with Claude Desktop
You can also use Magento 2 MCP with Claude Desktop to ask questions about your store easily.
Follow these steps:
- Find your Node.js path by running:
which node
- Open Claude Desktop, go to Developer settings, and click “Edit config.” This opens a JSON file.
- Add this snippet inside the
mcpServerssection, replacing paths and tokens where needed:
"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"
}
}
- Replace
/path/to/your/nodewith the Node.js path from step 1. - Replace
/path/to/mcp-server.jswith the folder path where you cloned Magento 2 MCP. - Get your API token from the Magento admin under System > Integrations.
- Restart Claude Desktop.
Now, Claude can answer questions about your Magento products and orders.
Following this guide will have Magento 2 MCP installed and ready for you to get useful information from your Magento store easily. Use the commands and setup steps exactly as shown above for the best results.