Creating a Free E-Commerce AI Agent to Manage Your Store
Using MCP Server for E-Commerce Management with Claude Desktop and Shopify
Introduction
Recently, Sam Altman stirred up the tech world with a post about OpenAI introducing support for the Model Context Protocol (MCP). But what exactly does this mean for you as an e-commerce shop owner or a technical maintainer?
In this article, we'll break down how you can set up an MCP server using Claude Desktop to manage your Shopify store. Imagine having an AI-powered assistant that handles tasks like inventory management, shop data analysis and order tracking - just one of many exciting AI agent use cases in the e-commerce space.
Let's dive in.
What is MCP (Model Context Protocol)?
MCP, or Model Context Protocol, is a standardized way for AI models to connect to external systems, providing them with additional context for better decision-making. By using an MCP server, you can give your AI agent the ability to read and manage data from your Shopify store using the Shopify Admin API. This is one of the most practical model context protocol examples you'll find for business applications.
Why MCP is a Game Changer for E-Commerce
- Efficiency Boost: Automate repetitive tasks and spend less time and money on them, a key benefit of automation in e-commerce.
- Data-Driven Decisions: Leverage AI insights for smarter business moves.
- Easy to set up AI assistants: As you'll see in this article, it's quite easy to build your own AI agent.
- Changing the way how we shop online: MCP is not only a game changer for admins of stores, but also for customers! Learn here how it's gonna revolutionize the online shopping experience and impact future e-commerce trends.
Prerequisites
Before getting started, make sure you have:
- Technical Curiosity: We will be using developer tooling to set this process up. Don't be intimidated, the setup is not hard to do and you don't need any programming knowledge. Just follow the instructions step by step! In case you get stuck, don't be shy to ask the AI of your choice to help you!! :)
- A Shopify Store: Ensure you have admin access.
- 30-60 min of time: While this set up is easy, it does take some time!
One more good thing to know, this set up is completely free πΈ.
Claude will limit you with the free messages you can send, though.
Step 0: Setting up Node.js, Git and GitHub
We will be using Node.js to run the MCP server locally.
Please set up Node.js and Git.
Verify, that both are installed by running the Terminal application (macOS) or Command Prompt (Windows, cmd.exe) and then executing the following commands one by one.
node --version
git --version
This should give you an output such as the following. The exact version numbers are not important.
~ β― node --version
v20.0.0
~ β― git --version
git version 2.39.0
π Great, you successfully set up Node.js and Git!
Step 1: Clone and Set Up the MCP Server
We'll be using the open-source Shopify MCP Server for this setup, which is hosted on GitHub. This is a great example of AI agent opensource technology that you can leverage right away.
-
Cloning the repository
- Clone the repository via GitHub Desktop
- Open GitHub Desktop and sign in with your GitHub account
- Click on "Clone a repository from the Internet..." which appears on the initial screen
- Paste this URL
https://github.com/agent-ready/shopify-mcp-server-main
in the "URL" tab - Choose where to save it on your computer and copy the path to the directory to your clipboard.
- Click "Clone"
- Clone the repository via CLI
git clone https://github.com/agent-ready/shopify-mcp-server-main.git
- Clone the repository via GitHub Desktop
-
Access directory and install dependencies
Run the following commands. Be sure to replace the path with your clipboard contents.
This will switch the terminal directory to the cloned repository and install its code dependencies.
cd /REPLACE/PATH/TO/DIRECTORY/shopify-mcp-server-main.git npm install
-
Create your Shopify API credentials
Now we create API credentials to give your MCP Server access to your Shopify store's Admin API. No need to worry, the set up is all local and only you can access your store data.
-
Log in to your Shopify admin dashboard
-
Go to Settings β Apps and channels
-
Click on "Develop Apps" β "Create an App" and enter a name such as "MCP Admin Access" β "Create"
-
"Configure Admin API Scopes"
-
Select the permissions you want your MCP Server to have. You can start with limiting the scope, experiment and then add more capabilities later.
For a start, to just dip your toes into the water carefully, you could go for "read_orders" to ask your e-commerce AI agent about the most recent or specific orders.
Be very mindful that adding scopes here means giving admin access to your store to an AI agent. If you don't trust the AI agent, you can limit the scope to only the functions you need.
-
Don't forget to click "Save" on the bottom of the page.
-
-
Get your credentials
After configuring scopes, click on "API credentials" and "Install App".
Then, "Reveal token once" and copy your token(!).
Be careful where you paste it, since it is like the password to your store.
-
-
Add generated credentials to MCP Server
If you followed this tutorial, your terminal / command prompt should still be in the directory of the MCP server. If not
If not, please change the directory there again by running:
cd /REPLACE/PATH/TO/DIRECTORY/shopify-mcp-server-main.git
To give your MCP Server access to the Shopify store, we need to add the credentials to the
.env
file. To do this, copy the following command, replace the values (after the=
sign) with the token we copied before and your Shopify domain (the base url of your store).For macOS:
cat > .env << 'EOF' SHOPIFY_ACCESS_TOKEN=your_token MYSHOPIFY_DOMAIN=your-store.com EOF
For Windows:
@" SHOPIFY_ACCESS_TOKEN=your_token MYSHOPIFY_DOMAIN=your-store.com "@ | Out-File -FilePath .env -Encoding utf
Now, you can run your MCP Server by executing:
npm run build npm run start
This should lead to the following output:
Shopify MCP Server running on stdio Connected to shop: yourstore.com
ππ₯³ Your local MCP server is up and running and connected to your Shopify store. This is a working model context protocol server that's ready to enhance your e-commerce operations!
Press
Ctrl + C
to stop the server. It will be automatically run by Claude Desktop in the future.Now, let's connect the AI agent.
Step 2: Configure Claude Desktop for MCP
-
Download from Claude's official website.
-
Open Claude Desktop.
-
Navigate to "Settings" > "Developer" β "Edit Config" β Open
claude_desktop_config.json
with the editor of your choice.Now, replace the variables in the following snippet and paste it into the file.
{ "mcpServers": { "shopify-admin-api": { "command": "node", "args": ["/PATH_TO_YOUR_REPO/shopify-mcp-server-main/build/index.js"], "env": { "SHOPIFY_ACCESS_TOKEN": "your_token", "MYSHOPIFY_DOMAIN": "your-store.com" } } }, "globalShortcut": "" }
Save the file.
-
Restart Claude Desktop
On the bottom of the chat window, you should now see a π¨ symbol with a number. You can click on it and see the MCP Server methods Claude Desktop now has access too.
While writing this article, a total of 12 methods are available through the MCP Server repo that we used in this set up. In the future, Shopify might release an official MCP Server with full access to all Admin API methods, or another repo will have more extensive coverage.
Step 3: Start Managing Your E-Commerce Store with an AI Agent
In the standard Claude Desktop chat window, you can now ask your e-commerce AI assistant to help you with managing your store. It's like having your own AI agent demo right on your desktop, ready to assist with various tasks.
Example prompts you can try:
- "Hey Claude, can you find me the five most recent unfulfilled orders?"
- "Please find the best selling products in my shop"
- "Check the orders of the last half year and analyze trends. Act as a sales expert, do you have recommendations on the pricing?"
- "I got an support request from customer with e-mail X. What did he order again? What's the status of that order?"
Have fun managing your store with an e-commerce AI agent! π
Conclusion
Setting up an MCP server using Claude Desktop and Shopify Admin API is a practical way to bring AI into your e-commerce operations. By following this guide, you've created what is essentially an AI agent OpenAI alternative using Claude, demonstrating the AI agent definition in practice: a software entity that can perceive its environment and take actions to achieve specific goals.
While the technology is still young and there is no great Shopify MCP server yet, this setup can give you a glimpse on what will be possible in just a few months from today, as automation in e-commerce continues to advance rapidly.
Did you give it a try? Do you need help? Any suggestions to improve the article?
Feel free to email us via dev@agent-ready.ai!