The most comprehensive MCP server for the Shopify GraphQL API
Shopify GraphQL MCP Server
A Model Context Protocol (MCP) server that provides comprehensive access to the Shopify Admin GraphQL API via cURL. This server exposes all major Shopify resources as MCP tools, allowing AI assistants like Claude to interact with your Shopify store programmatically.
🚧 Project Status: This project is currently in active development. New tools and features are being added regularly.
Prerequisites
- Node.js 18+
- npm or yarn
- A Shopify store with Admin API access
- Shopify Admin API access token
Installation
1. Clone or Create Project
mkdir shopify-graphql-mcp
cd shopify-graphql-mcp
2. Install Dependencies
npm install
3. Build the Server
npm run build
Configuration
Environment Variables
Create a .env file or set these environment variables:
SHOPIFY_ACCESS_TOKEN=shpat_xxxxx
SHOPIFY_STORE_URL=your-store.myshopify.com
SHOPIFY_STORE_API_URL=https://your-store.myshopify.com/admin/api/2025-01/graphql.json
Getting Your Access Token
- Log in to your Shopify Admin
- Go to Settings > Apps and sales channels > Develop apps
- Create a new app or use an existing one
- Click Configure Admin API scopes
- Select the required scopes based on TOOLS.md
- Install the app to your store
- Copy the Admin API access token
MCP Client Configuration
Add this server to your MCP client configuration (e.g., Claude Desktop, Cursor):
macOS/Linux:
{
"mcpServers": {
"shopify-graphql": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/shopify-graphql-mcp/dist/index.js"],
"env": {
"SHOPIFY_ACCESS_TOKEN": "shpat_xxxxx",
"SHOPIFY_STORE_URL": "your-store.myshopify.com",
"SHOPIFY_STORE_API_URL": "https://your-store.myshopify.com/admin/api/2025-01/graphql.json"
}
}
}
}
Windows:
{
"mcpServers": {
"shopify-graphql": {
"command": "node",
"args": ["C:\\PATH\\TO\\shopify-graphql-mcp\\dist\\index.js"],
"env": {
"SHOPIFY_ACCESS_TOKEN": "shpat_xxxxx",
"SHOPIFY_STORE_URL": "your-store.myshopify.com",
"SHOPIFY_STORE_API_URL": "https://your-store.myshopify.com/admin/api/2025-01/graphql.json"
}
}
}
}
Available Tools
🏪 Core Store Operations
Orders (3 tools)
get_orders- Fetch orders with filtering and paginationget_order- Get a specific order by IDcancel_order- Cancel an order
Products (5 tools)
get_products- Fetch products with filteringget_product- Get a specific product by IDcreate_product- Create a new productupdate_product- Update an existing productdelete_product- Delete a product
Customers (5 tools)
get_customers- Fetch customers with filteringget_customer- Get a specific customer by IDcreate_customer- Create a new customerupdate_customer- Update an existing customerdelete_customer- Delete a customer
Collections (5 tools)
get_collections- Fetch collectionsget_collection- Get a specific collectioncreate_collection- Create a manual or smart collectionupdate_collection- Update a collectiondelete_collection- Delete a collection
Inventory (3 tools)
get_inventory_levels- Fetch inventory levelsadjust_inventory- Adjust inventory quantitiesset_inventory_quantity- Set on-hand inventory quantity
Draft Orders (5 tools)
get_draft_orders- Fetch draft ordersget_draft_order- Get a specific draft ordercreate_draft_order- Create a draft ordercomplete_draft_order- Convert draft order to orderdelete_draft_order- Delete a draft order
Discounts (5 tools)
get_discount_codes- Fetch discount codescreate_discount_code- Create a discount codeupdate_discount_code- Update a discount codedelete_discount_code- Delete a discount codeget_discount_code- Get a specific discount code
Locations (2 tools)
get_locations- Fetch store locationsget_location- Get a specific location
Metaobjects (5 tools)
get_metaobject_definitions- Fetch metaobject definitionsget_metaobject_definition- Get a specific metaobject definitionget_metaobjects- Fetch metaobjects by typecreate_metaobject- Create a metaobjectupdate_metaobject- Update a metaobjectdelete_metaobject- Delete a metaobject
📊 Analytics & Reporting (2 tools)
get_analytics_report- Fetch analytics reports and metricsrun_shopifyql_query- Execute ShopifyQL queries for custom analytics
🏢 Shop Management (3 tools)
get_shop_info- Get general shop informationget_shop_policies- Get shop policieshealth_check- Check server status and configuration
🚚 Fulfillment & Shipping (6 tools)
get_fulfillments- Fetch fulfillmentsget_fulfillment- Get a specific fulfillmentcreate_fulfillment- Create a fulfillmentupdate_tracking- Update tracking informationcancel_fulfillment- Cancel a fulfillmentget_fulfillment_orders- Fetch fulfillment orders
🏬 B2B Commerce (5 tools)
get_companies- Fetch companiesget_company- Get a specific companycreate_company- Create a companyupdate_company- Update a companydelete_company- Delete a company
💳 Payment & Checkout (6 tools)
get_checkouts- Fetch checkoutsget_checkout- Get a specific checkoutcreate_checkout- Create a checkoutupdate_checkout- Update a checkoutcomplete_checkout- Complete a checkoutget_payment_methods- Get available payment methods
🎯 Shopify Functions (20+ tools)
Cart Functions (5 tools)
get_cart_transforms- Fetch cart transformscreate_cart_transform- Create a cart transformupdate_cart_transform- Update a cart transformdelete_cart_transform- Delete a cart transformget_all_cart_transforms- Fetch all cart transforms
Delivery Functions (4 tools)
get_delivery_customizations- Fetch delivery customizationscreate_delivery_customization- Create a delivery customizationupdate_delivery_customization- Update a delivery customizationdelete_delivery_customization- Delete a delivery customization
Discount Functions (4 tools)
get_discount_functions- Fetch discount functionscreate_discount_function- Create a discount functionupdate_discount_function- Update a discount functiondelete_discount_function- Delete a discount function
Fulfillment Functions (4 tools)
get_fulfillment_constraints- Fetch fulfillment constraintscreate_fulfillment_constraint- Create a fulfillment constraintupdate_fulfillment_constraint- Update a fulfillment constraintdelete_fulfillment_constraint- Delete a fulfillment constraint
Validation Functions (4 tools)
get_cart_validations- Fetch cart validationscreate_cart_validation- Create a cart validationupdate_cart_validation- Update a cart validationdelete_cart_validation- Delete a cart validation
🔧 Advanced Features (25+ tools)
Apps & Extensions (6 tools)
get_apps- Fetch installed appsget_app- Get a specific appget_app_proxy- Get app proxy configurationcreate_app_proxy- Create an app proxyupdate_app_proxy- Update an app proxydelete_app_proxy- Delete an app proxy
Files & Media (6 tools)
get_files- Fetch filesget_file- Get a specific filecreate_file- Upload a fileupdate_file- Update a filedelete_file- Delete a fileget_file_upload_url- Get upload URL for large files
Price Rules (5 tools)
get_price_rules- Fetch price rulesget_price_rule- Get a specific price rulecreate_price_rule- Create a price ruleupdate_price_rule- Update a price ruledelete_price_rule- Delete a price rule
Audit & Events (2 tools)
get_audit_events- Fetch audit events (staff actions, app installations)get_customer_events- Fetch customer events (page views, product views)
Cash Tracking (4 tools)
get_cash_tracking_sessions- Fetch cash tracking sessions for POSget_cash_tracking_session- Get a specific cash tracking sessioncreate_cash_tracking_session- Create a cash tracking sessionupdate_cash_tracking_session- Update a cash tracking session
Custom Pixels (6 tools)
get_custom_pixels- Fetch custom pixelsget_custom_pixel- Get a specific custom pixelcreate_custom_pixel- Create a custom pixelupdate_custom_pixel- Update a custom pixeldelete_custom_pixel- Delete a custom pixelget_custom_pixel_data- Get custom pixel data
Customer Management (3 tools)
merge_customers- Merge two customer recordsrequest_customer_data_erasure- Request customer data deletion (GDPR)get_customer_payment_methods- Get customer payment methods
Custom Fulfillment Services (4 tools)
get_custom_fulfillment_services- Fetch custom fulfillment servicesget_custom_fulfillment_service- Get a specific custom fulfillment servicecreate_custom_fulfillment_service- Create a custom fulfillment serviceupdate_custom_fulfillment_service- Update a custom fulfillment service
Discovery & Search (3 tools)
discover_resources- Discover available resourcessearch_resources- Search across resourcesget_resource_schema- Get schema for a resource type
Channels (5 tools)
get_channels- Fetch sales channelsget_channel- Get a specific channelcreate_channel- Create a channelupdate_channel- Update a channeldelete_channel- Delete a channel
Total Tools: 100+ comprehensive tools covering all major Shopify operations
Usage Examples
Get Orders
"Get the last 10 orders from my store"
Create Product
"Create a new product called 'Summer T-Shirt' with a $29.99 price"
Update Inventory
"Set the inventory for variant ID gid://shopify/ProductVariant/123 to 100 at location ID gid://shopify/Location/456"
Get Analytics
"Show me my store's total sales for last month using ShopifyQL"
Development
Project Structure
shopify-graphql-mcp/
├── src/
│ ├── index.ts # Server entry point
│ ├── tools/ # Tool implementations
│ │ ├── index.ts # Tool registration
│ │ ├── orders.ts
│ │ ├── products.ts
│ │ ├── customers.ts
│ │ └── ...
│ ├── utils/
│ │ ├── graphql-client.ts
│ │ └── scope-mapper.ts
│ └── types/
│ └── index.ts
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── mcp.json # Example MCP config
Adding New Tools
- Define the tool in the appropriate category file in
src/tools/ - Use the
server.registerTool()pattern - Include Zod schema validation for inputs
- Handle errors gracefully
Example:
server.registerTool(
"my_new_tool",
{
description: "Description of what this tool does",
inputSchema: {
param1: z.string().describe("Parameter description"),
},
},
async ({ param1 }) => {
// Implementation
}
);
Building
npm run build
Type Checking
npm run typecheck
Troubleshooting
Environment Variables Not Found
Make sure all three environment variables are set:
SHOPIFY_ACCESS_TOKENSHOPIFY_STORE_URLSHOPIFY_STORE_API_URL
GraphQL Errors
Check that your access token has the required scopes for the operations you're trying to perform.
cURL Not Found
Ensure cURL is installed on your system:
# macOS
brew install curl
# Ubuntu/Debian
sudo apt-get install curl
# Windows
curl is included in Windows 10+
Permission Denied (macOS/Linux)
Make sure the compiled file is executable:
chmod +x dist/index.js
Security Notes
- Never commit your
SHOPIFY_ACCESS_TOKENto version control - Use environment variables or a secure secrets manager
- The access token provides full API access to your store - keep it secure
- Consider using separate tokens for different environments (development, staging, production)
Required Shopify Admin API Scopes
Based on the TOOLS.md file, the following scopes may be required depending on which tools you use:
read_orders,write_draft_ordersread_products,write_productsread_customers,write_customersread_inventory,write_inventoryread_draft_orders,write_draft_ordersread_discounts,write_discountsread_locations,write_locationsread_metaobject_definitions,write_metaobject_definitionsread_metaobjects,write_metaobjectsread_analytics
License
MIT
Contributing
Contributions are welcome! Please ensure:
- TypeScript strict mode compliance
- Zod schema validation for all tool inputs
- Error handling for all GraphQL operations
- Updated documentation for new tools
Support
For issues or questions:
- Check the troubleshooting section
- Verify your Shopify API credentials
- Ensure your access token has the required scopes
- Review the Shopify Admin GraphQL API documentation