themightywolfie/shopify-storefront-mcp-server
If you are the rightful owner of shopify-storefront-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for interacting with the Shopify Storefront API, enabling seamless integration with Shopify storefronts through GraphQL queries.
Shopify Storefront MCP Server
A Model Context Protocol (MCP) server for interacting with the Shopify Storefront API. This server enables seamless integration with Shopify storefronts through GraphQL queries, providing access to products, collections, search functionality, and cart operations with both authenticated and tokenless access support.
Features
- Product Management: Fetch products with advanced filtering and sorting
- Collection Management: Access and browse product collections
- Search Functionality: Powerful product search with filters
- Cart Operations: Create, manage, and modify shopping carts
- Tokenless Access: Works without API tokens for core features (limited functionality)
- Authenticated Access: Full feature set with Storefront API access token
- Storefront Integration: Direct integration with Shopify's Storefront API
- Environment Support: Works in both local development and remote deployment (Smithery)
Access Modes
🔓 Tokenless Access (No API Token Required)
Supported Features:
- ✅ Products and Collections (without tags)
- ✅ Search functionality
- ✅ Pages, Blogs, and Articles
- ✅ Cart operations (read/write)
- ⚠️ Query complexity limited to 1,000 points
Limitations:
- ❌ Product Tags
- ❌ Metaobjects and Metafields
- ❌ Menu (Online Store navigation)
- ❌ Customer data access
🔑 Authenticated Access (API Token Required)
Full Feature Set:
- ✅ All tokenless features PLUS:
- ✅ Product Tags
- ✅ Metaobjects and Metafields
- ✅ Menu (Online Store navigation)
- ✅ Customer data access (with customer token)
- ✅ Higher query complexity limits
Prerequisites
- Node.js (version 18 or higher)
- A Shopify store
- Optional: Storefront API access token (for full functionality)
Shopify Setup
Option 1: Tokenless Mode (Quick Start)
No setup required! Just provide your store domain:
SHOPIFY_STORE_DOMAIN=your-store.myshopify.com
Option 2: Authenticated Mode (Full Features)
Get Your Storefront API Access Token
- Go to your Shopify admin panel
- Navigate to Apps > Develop apps
- Click Create an app or select an existing app
- Go to Configuration > Storefront API access
- Enable Storefront API access
- Select the required scopes:
unauthenticated_read_product_listings
unauthenticated_read_product_inventory
unauthenticated_read_product_tags
unauthenticated_read_collection_listings
unauthenticated_write_checkouts
(for cart operations)unauthenticated_read_checkouts
(for cart operations)
- Click Save and then Install app
- Copy the Storefront access token
Installation
Quick Start with npx (Recommended)
You can run the server directly without installation using npx
:
Tokenless Mode:
npx -y @wolfielabs/shopify-storefront-mcp-server --storeDomain your-store.myshopify.com
Authenticated Mode:
npx -y @wolfielabs/shopify-storefront-mcp-server --storeDomain your-store.myshopify.com --storefrontAccessToken your_storefront_access_token
Local Development
-
Clone or download this repository
-
Install dependencies:
npm install
-
Quick Setup (recommended):
npm run setup
This interactive script will help you create the
.env
file. Or manually create a.env
file with your credentials:Tokenless Mode (Core Features):
SHOPIFY_STORE_DOMAIN=your-store.myshopify.com
Authenticated Mode (Full Features):
SHOPIFY_STORE_DOMAIN=your-store.myshopify.com SHOPIFY_STOREFRONT_ACCESS_TOKEN=your_storefront_access_token
-
Build the project:
npm run build
-
Start the server:
npm start
Claude Desktop Integration
Add this configuration to your Claude Desktop config file:
Location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
Configuration:
Using npx (Recommended):
Tokenless Mode:
{
"mcpServers": {
"shopify-storefront": {
"command": "npx", "args": [
"-y",
"@wolfielabs/shopify-storefront-mcp-server",
"--storeDomain",
"your-store.myshopify.com"
]
}
}
}
Authenticated Mode:
{
"mcpServers": {
"shopify-storefront": {
"command": "npx", "args": [
"-y",
"@wolfielabs/shopify-storefront-mcp-server",
"--storeDomain",
"your-store.myshopify.com",
"--storefrontAccessToken",
"your_storefront_access_token"
]
}
}
}
Using Local Installation:
Tokenless Mode:
{
"mcpServers": {
"shopify-storefront": {
"command": "node",
"args": [
"/absolute/path/to/shopify-storefront-mcp-server/dist/index.js",
"--storeDomain",
"your-store.myshopify.com"
]
}
}
}
Authenticated Mode:
{
"mcpServers": {
"shopify-storefront": {
"command": "node",
"args": [
"/absolute/path/to/shopify-storefront-mcp-server/dist/index.js",
"--storefrontAccessToken",
"your_storefront_access_token",
"--storeDomain",
"your-store.myshopify.com"
]
}
}
}
Remote Deployment (Smithery)
- Build the project:
npm run build
- Deploy the
dist
folder to your preferred hosting service - Configure environment variables:
SHOPIFY_STORE_DOMAIN
SHOPIFY_STOREFRONT_ACCESS_TOKEN
Available Tools
Product Management
-
get-products
- Fetch multiple products with filtering and sorting
- Parameters:
first
(optional, default: 10): Number of products to fetchquery
(optional): Search query to filter productssortKey
(optional): Sort by TITLE, PRICE, CREATED_AT, etc.reverse
(optional): Reverse sort order
-
get-product-by-handle
- Get detailed information about a specific product
- Parameters:
handle
(required): Product handle/slug
Collection Management
-
get-collections
- Fetch multiple collections
- Parameters:
first
(optional, default: 10): Number of collections to fetchquery
(optional): Search query to filter collectionssortKey
(optional): Sort by TITLE, UPDATED_AT, etc.reverse
(optional): Reverse sort order
-
get-collection-by-handle
- Get detailed information about a specific collection
- Parameters:
handle
(required): Collection handle/slugproductsFirst
(optional, default: 10): Number of products to include
Search
- search-products
- Advanced product search with filters
- Parameters:
query
(required): Search queryfirst
(optional, default: 10): Number of resultssortKey
(optional): Sort by RELEVANCE, PRICE, etc.reverse
(optional): Reverse sort orderproductFilters
(optional): Additional filters for availability, price range, etc.
Cart Management
-
create-cart
- Create a new shopping cart
- Parameters:
lines
(optional): Initial cart lines with merchandise ID and quantityattributes
(optional): Custom cart attributesnote
(optional): Cart notebuyerIdentity
(optional): Buyer information
-
get-cart
- Retrieve cart details by cart ID
- Parameters:
cartId
(required): Cart ID (e.g., "gid://shopify/Cart/123")
-
add-cart-lines
- Add items to an existing cart
- Parameters:
cartId
(required): Cart IDlines
(required): Array of items to add with merchandise ID and quantity
-
update-cart-lines
- Update existing items in a cart
- Parameters:
cartId
(required): Cart IDlines
(required): Array of line updates with line ID and new quantity
-
remove-cart-lines
- Remove items from a cart
- Parameters:
cartId
(required): Cart IDlineIds
(required): Array of cart line IDs to remove
Customer Management
- get-customer
- Retrieve customer information and order history
- Parameters:
customerAccessToken
(required): Customer access tokencountry
(optional): Country code for contextlanguage
(optional): Language code for context
Configuration Options
Environment Variables
SHOPIFY_STORE_DOMAIN
: Your Shopify store domainSHOPIFY_STOREFRONT_ACCESS_TOKEN
: Your Storefront API access tokenSHOPIFY_CUSTOMER_ACCESS_TOKEN
(optional): Customer access token for authenticated operations
Command Line Arguments
--storeDomain
: Shopify store domain--storefrontAccessToken
: Storefront API access token--customerAccessToken
: Customer access token for authenticated operations
Customer Access Tokens
Customer access tokens enable personalized cart operations and customer data access. You can provide them in three ways:
- Environment Variable: Set
SHOPIFY_CUSTOMER_ACCESS_TOKEN
in your.env
file - Command Line: Use
--customerAccessToken=your_token
when starting the server - Tool Parameter: Pass
customerAccessToken
directly to cart tools that support it
Important: Customer access tokens are Storefront API specific tokens obtained through the Shopify Storefront API's customer authentication flow. They are different from:
- Storefront access tokens (app-level authentication)
- Admin API tokens (backend operations)
- Session tokens (temporary authentication)
How to obtain: Use the Storefront API's customerAccessTokenCreate
mutation to generate these tokens after customer login. See the Shopify documentation for implementation details.
Use cases: Customer access tokens provide access to customer-specific data and authenticated cart operations, enabling personalized shopping experiences.
API Differences
This server uses the Shopify Storefront API, which is different from the Admin API:
- Customer-focused: Designed for customer-facing storefronts and shopping experiences
- Public data access: Products, collections, and publicly available store information
- Cart operations: Supports cart creation and management mutations
- Customer authentication: Uses customer access tokens (not admin tokens)
- Different GraphQL schema: Uses Storefront API types and fields optimized for frontend use
- Rate limits: Different rate limiting compared to Admin API
Development
Build
npm run build
Development Mode
npm run dev
Type Checking
npm run type-check
Troubleshooting
Common Issues
-
Invalid Access Token
- Ensure you're using a Storefront API token (not Admin API)
- Verify the token has the required scopes
-
Store Domain Issues
- Use the format:
your-store.myshopify.com
- Don't include
https://
in the domain
- Use the format:
-
Build Errors
- Ensure Node.js version 18+
- Run
npm install
to install all dependencies
Debug Logs
Check Claude Desktop's MCP logs for detailed error information:
macOS:
tail -f ~/Library/Logs/Claude/mcp*.log
Windows:
Get-Content "$env:APPDATA\Claude\Logs\mcp*.log" -Wait
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure tests pass and code builds
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
- Check the troubleshooting section above
- Review Shopify's Storefront API documentation
- Open an issue in this repository