Shopify MCP Server
(please leave a star if you like!)
MCP Server for Shopify API, enabling interaction with store data through GraphQL API. This server provides tools for managing products, customers, orders, and more.
📦 Package Name: shopify-mcp
🚀 Command: shopify-mcp (NOT shopify-mcp-server)
🌟 Nuevas Características
- 🔄 Modo Dual: Soporta tanto STDIO (para IDEs) como HTTP (para acceso remoto)
- 🌐 Servidor HTTP: Acceso remoto con autenticación por API key
- 🔒 Seguridad: Autenticación robusta y soporte CORS
- 🛠 Compatible: Funciona con Cursor, VS Code, Claude Desktop y más
Features
- Product Management: Search and retrieve product information
- Customer Management: Load customer data and manage customer tags
- Order Management: Advanced order querying and filtering
- GraphQL Integration: Direct integration with Shopify's GraphQL Admin API
- Comprehensive Error Handling: Clear error messages for API and authentication issues
Prerequisites
- Node.js (version 16 or higher)
- Shopify Custom App Access Token (see setup instructions below)
🚀 Modos de Operación
Este servidor MCP ahora soporta dos modos:
📱 Modo STDIO (Por Defecto)
- Compatible con IDEs como Cursor, VS Code, Claude Desktop
- Comunicación directa proceso a proceso
- Configuración tradicional MCP
🌐 Modo HTTP (Nuevo)
- Servidor HTTP remoto con autenticación por API key
- Acceso desde cualquier herramienta que soporte HTTP
- Ideal para equipos distribuidos y acceso remoto
Setup
Shopify Access Token
To use this MCP server, you'll need to create a custom app in your Shopify store:
- From your Shopify admin, go to Settings > Apps and sales channels
- Click Develop apps (you may need to enable developer preview first)
- Click Create an app
- Set a name for your app (e.g., "Shopify MCP Server")
- Click Configure Admin API scopes
- Select the following scopes:
-read_products,write_products
-read_customers,write_customers
-read_orders,write_orders - Click Save
- Click Install app
- Click Install to give the app access to your store data
- After installation, you'll see your Admin API access token
- Copy this token - you'll need it for configuration
📋 Configuración Rápida
Modo STDIO (Tradicional)
Claude Desktop
Add this to your claude_desktop_config.json:```json
{
"mcpServers": {
"shopify": {
"command": "npx",
"args": [
"shopify-mcp",
"--accessToken",
"<YOUR_ACCESS_TOKEN>",
"--domain",
"<YOUR_SHOP>.myshopify.com"
]
}
}
}
#### Cursor / VS Code```json
{
"mcpServers": {
"shopify": {
"command": "node",
"args": ["/ruta/a/shopify-mcp/dist/index.js"],
"env": {
"SHOPIFY_ACCESS_TOKEN": "tu_token",
"MYSHOPIFY_DOMAIN": "tu-tienda.myshopify.com"
}
}
}
}
Modo HTTP (Remoto)
1. Iniciar el servidor HTTP```bash
Instalar dependencias
npm install
Compilar
npm run build
Ejecutar en modo HTTP
SHOPIFY_ACCESS_TOKEN=tu_token \
MYSHOPIFY_DOMAIN=tu-tienda.myshopify.com \
SERVER_MODE=http \
API_KEY=tu-clave-api-segura \
npm run start:http
#### 2. Configurar IDE para acceso remoto```json
{
"mcpServers": {
"shopify-remote": {
"transport": "http",
"url": "http://localhost:3000/mcp",
"headers": {
"X-API-Key": "tu-clave-api-segura"
}
}
}
}
Locations for the Claude Desktop config file:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
Alternative: Run Locally with Environment Variables
If you prefer to use environment variables instead of command-line arguments:
-
Create a
.envfile with your Shopify credentials:SHOPIFY_ACCESS_TOKEN=your_access_token MYSHOPIFY_DOMAIN=your-store.myshopify.com -
Run the server with npx:
npx shopify-mcp
Direct Installation (Optional)
If you want to install the package globally:```
npm install -g shopify-mcp
Then run it:```
shopify-mcp --accessToken=<YOUR_ACCESS_TOKEN> --domain=<YOUR_SHOP>.myshopify.com
⚠️ Important: If you see errors about "SHOPIFY_ACCESS_TOKEN environment variable is required" when using command-line arguments, you might have a different package installed. Make sure you're using shopify-mcp, not shopify-mcp-server.
Available Tools
Product Management
get-products
- Get all products or search by title
- Inputs:
searchTitle(optional string): Filter products by titlelimit(number): Maximum number of products to return
-
get-product-by-id
- Get a specific product by ID
- Inputs:productId(string): ID of the product to retrieve
-
create-product- Create new product in store
- Inputs:
title(string): Title of the productdescriptionHtml(string): Description of the productvendor(string): Vendor of the productproductType(string): Type of the producttags(array): Tags of the productstatus(string): Status of the product "ACTIVE", "DRAFT", "ARCHIVED". Default "DRAFT"
-
create-order- Create new order with customer data, products, and billing information
- Inputs:
customer(object, required): Customer informationemail(string, required): Customer email addressfirstName(string): Customer first namelastName(string): Customer last namephone(string): Customer phone numberlineItems(array, required): Products to include in the ordervariantId(string, required): Product variant IDquantity(number, required): Quantity to orderprice(number): Custom price per unit (optional)billingAddress(object): Billing address informationshippingAddress(object): Shipping address informationnote(string): Order notestags(array): Order tagsfinancialStatus(string): Financial status ("pending", "paid", etc.)fulfillmentStatus(string): Fulfillment statussendReceipt(boolean): Send receipt email to customerinventoryBehaviour(string): How to handle inventory
Customer Management
get-customers
- Get customers or search by name/email
- Inputs:
searchQuery(optional string): Filter customers by name or emaillimit(optional number, default: 10): Maximum number of customers to return
-
create-customer
- Create a new customer with personal information, addresses, and preferences
- Inputs:email(string, required): Customer email address (must be unique)firstName(string): Customer first namelastName(string): Customer last namephone(string): Customer phone numberacceptsMarketing(boolean): Whether customer accepts marketing emailsmarketingOptInLevel(string): Marketing opt-in level ("SINGLE_OPT_IN", "CONFIRMED_OPT_IN", "UNKNOWN")state(string): Customer account state ("DISABLED", "INVITED", "ENABLED", "DECLINED")taxExempt(boolean): Whether customer is tax exemptnote(string): Internal note about the customertags(array): Customer tags for organizationaddresses(array): Customer addresses with address1, city, country, zip requiredmetafields(array): Custom metafields for the customer
-
update-customer
- Update a customer's information
- Inputs:
id(string, required): Shopify customer ID (numeric ID only, like "6276879810626")firstName(string, optional): Customer's first namelastName(string, optional): Customer's last nameemail(string, optional): Customer's email addressphone(string, optional): Customer's phone numbertags(array of strings, optional): Tags to apply to the customernote(string, optional): Note about the customertaxExempt(boolean, optional): Whether the customer is exempt from taxesmetafields(array of objects, optional): Customer metafields for storing additional data
get-customer-orders
- Get orders for a specific customer
- Inputs:customerId(string, required): Shopify customer ID (numeric ID only, like "6276879810626")limit(optional number, default: 10): Maximum number of orders to return
Order Management
get-orders
- Get orders with optional filtering
- Inputs:
status(optional string): Filter by order statuslimit(optional number, default: 10): Maximum number of orders to return
get-order-by-id
- Get a specific order by ID
- Inputs:
orderId(string, required): Full Shopify order ID (e.g., "gid://shopify/Order/6090960994370")
update-order
- Update an existing order with new information
- Inputs:
id(string, required): Shopify order IDtags(array of strings, optional): New tags for the orderemail(string, optional): Update customer emailnote(string, optional): Order notescustomAttributes(array of objects, optional): Custom attributes for the ordermetafields(array of objects, optional): Order metafieldsshippingAddress(object, optional): Shipping address information
📚 Documentación Adicional
- USAGE.md: Guía detallada de uso en ambos modos
- IDE_CONFIG.md: Configuraciones específicas para diferentes IDEs y herramientas
🔧 Scripts Disponibles```bash
Desarrollo
npm run dev # Modo STDIO (por defecto)
npm run dev:http # Modo HTTP
npm run dev:stdio # Modo STDIO explícito
Producción
npm run build # Compilar TypeScript
npm run start # Modo STDIO (por defecto)
npm run start:http # Modo HTTP
npm run start:stdio # Modo STDIO explícito
## 🌐 Endpoints HTTP (Modo HTTP)
- **Health Check**: `GET /health`
- **MCP Endpoint**: `GET /mcp` (Server-Sent Events)
## Debugging
### Modo STDIO
If you encounter issues, check Claude Desktop's MCP logs:```bash
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
Modo HTTP
Check server logs and test endpoints:```bash
Verificar salud del servidor
curl -H "X-API-Key: tu-clave-api" http://localhost:3000/health
Ver logs del servidor
npm run start:http
```
License
MIT
