Purpose
Shopify Storefront MCP Server is an unofficial MCP (Model Context Protocol) server designed to allow AI assistants to access the Shopify Storefront API through the MCP protocol, thereby querying and manipulating Shopify store data. It is suitable for scenarios that require integrating AI assistants with Shopify stores, such as automatically retrieving product information, managing shopping carts, or handling customer data.
Main Capabilities
- Access product, collection, and inventory data.
- Create and manage shopping carts.
- Support GraphQL queries and mutations.
- Automatically handle token verification.
- Easily integrate with MCP-compatible AI assistants.
- Provide a customer data management tool (customer_data) that supports create, read, update, and delete operations.
- Provide customer information MCP resources, such as name, email, phone, address, etc.
Usage
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt - Copy
.env.exampleas.envand configure the environment variables. - Generate a Storefront API token through the Shopify admin (steps: log in to the Shopify admin, go to Apps and sales channels > Develop apps > Create an app, configure the Storefront API scopes, select the necessary scopes, save and copy the generated access token, and add it to the
.envfile inSHOPIFY_STOREFRONT_ACCESS_TOKEN). - Run the server:
python -m shopify_storefront_mcp_server
The server exposes the following MCP tools:
shopify_discover: Detects whether a URL belongs to a Shopify store and discovers the authentication token.shopify_storefront_graphql: Executes GraphQL queries against the Storefront API.customer_data: A unified tool for all customer data operations (create, read, update, delete).
Customer data is stored in user_data/customer.json and should be managed using the customer_data tool. This file contains personal information and should not be committed to version control. The repository includes the user_data/customer.json.example template file and prevents accidental commits of actual customer data in .gitignore . During deployment, the file will be automatically created the first time the customer_data tool is used.
Applicable Scenarios
- An AI assistant needs to query product, collection, or inventory information from a Shopify store.
- Customer data management capabilities need to be provided to an AI assistant to enable personalized interactions.
- A Shopify checkout flow containing customer information needs to be created.
Limitations
- This server is an unofficial project.
- You need to generate and manage the Storefront API token yourself.
- Customer data is stored in a local file, so data privacy and security must be considered.
- Before use, ensure the token format is correct (starting with
shpsa_orshpat_), and that the store name and API version are correct. - Security considerations: never commit the
.envfile or files containing API tokens, use environment variables to store sensitive information, consider setting IP restrictions, and review token permissions.