Shopify Analytics MCP Server
Provides read-only Shopify analytics and reporting, enabling natural-language queries about orders, revenue, top products, inventory, customers, discounts, refunds, sales geography, channels, and custom ShopifyQL analytics for a Shopify store.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Shopify Analytics MCP Server How did we do last week vs the week before?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Shopify Analytics MCP Server
Ask Claude about your Shopify store — orders, revenue, top products, inventory — for free.
An open-source MCP server that gives Shopify store owners natural-language analytics through Claude Desktop, Cursor, Claude Code, or any MCP-compatible host. Runs locally via npx — no hosting, no server, no recurring cost.
Quick Start
1. Create a Shopify App
Create App → Start from Dev Dashboard → name it (e.g. "Claude Analytics")
Versions tab → Create version with these scopes:
read_ordersread_productsread_customersread_inventoryread_analyticsread_reports
Release the version
Home → Install app → select your store
Settings → copy your Client ID and Client Secret
2. Connect to Claude Desktop
Open Claude Desktop → Settings → Developer → Edit Config and paste:
{
"mcpServers": {
"shopify-analytics": {
"command": "npx",
"args": ["-y", "@scooperai/shopify-analytics-mcp"],
"env": {
"SHOPIFY_STORE": "your-store-subdomain",
"SHOPIFY_CLIENT_ID": "your-client-id",
"SHOPIFY_CLIENT_SECRET": "your-client-secret"
}
}
}
}Replace the three values with your own. SHOPIFY_STORE is the subdomain from your-store-subdomain.myshopify.com.
Restart Claude Desktop. Done.
Already have other MCP servers?
If your config already has other servers, add shopify-analytics alongside them inside the existing mcpServers block (don't create a second one):
{
"mcpServers": {
"some-other-mcp": {
"command": "npx",
"args": ["-y", "some-other-mcp"]
},
"shopify-analytics": {
"command": "npx",
"args": ["-y", "@scooperai/shopify-analytics-mcp"],
"env": {
"SHOPIFY_STORE": "your-store-subdomain",
"SHOPIFY_CLIENT_ID": "your-client-id",
"SHOPIFY_CLIENT_SECRET": "your-client-secret"
}
}
}
}Just add a comma after the existing server's closing } and paste the "shopify-analytics" block after it.
Legacy Auth (existing custom apps)
If you have an existing custom app with a shpat_ access token:
{
"mcpServers": {
"shopify-analytics": {
"command": "npx",
"args": ["-y", "@scooperai/shopify-analytics-mcp"],
"env": {
"SHOPIFY_STORE": "your-store-subdomain",
"SHOPIFY_ACCESS_TOKEN": "shpat_xxxxx"
}
}
}
}Related MCP server: lightspeed-x
Available Tools
Tool | Description | Example Prompt |
| Revenue, orders, AOV with period comparison | "How did we do last week vs the week before?" |
| Best sellers by revenue or units | "What are our top 5 products this month?" |
| Daily/weekly/monthly trend breakdown | "Show me revenue trends for the last 90 days" |
| Latest orders with status and details | "Any big orders come in today?" |
| Full details for a specific order | "What happened with order #1042?" |
| Customer count, top spenders, aggregates | "Who are our top spenders?" |
| Stock levels, low-stock and out-of-stock alerts | "Are we out of stock on anything?" |
| Deep dive on a specific product or comparison | "How is the Premium Widget doing this quarter?" |
| Revenue by country, region, or city | "Where are our customers coming from?" |
| Revenue by sales channel | "Which sales channels are performing best?" |
| Discount code usage and effectiveness | "How are our discount codes performing?" |
| Refund totals and rates, optionally by product | "What's our refund rate this month?" |
| Flexible order search with filters | "Show me all refunded orders from last week" |
| Run any custom ShopifyQL query | "What are sales by day of week for the last quarter?" |
| RFM segmentation: Champions, Loyal, At Risk, Lost | "Show me my customer segments" |
| Identify customers at risk of churning | "Which customers am I about to lose?" |
| Customer lifetime value projections | "What's the lifetime value of my customers?" |
| Full customer health diagnosis with actions | "How are my customers doing?" |
Example Conversations
Daily check-in:
"How did we do yesterday?"
Yesterday: $1,842 revenue from 12 orders (AOV $153.50). Down 8% vs the day before. Net revenue after refunds/discounts: $1,720.
Weekly review:
"What are our top selling products this week?"
Top 10 products by revenue (this week):
Premium Widget ($2,450)
Starter Kit ($1,890)
Pro Bundle ($1,230) ...
Inventory alert:
"Are we running low on anything?"
3 out-of-stock and 7 low-stock variants (threshold: 10 units). Out of stock: Premium Widget - Large, Starter Kit - Blue, ...
Custom query:
"What does our hourly sales pattern look like?"
(Uses
run_shopifyqlwithFROM sales SHOW total_sales, orders TIMESERIES hour_of_day DURING last_week)
Ad-hoc investigation:
"Show me all orders from jane@example.com"
Found 4 orders matching "email:jane@example.com": #1089: $245.00 — Jane Doe (PAID, FULFILLED) ...
Customer health check:
"How are my customers doing?"
Customer health report (last 12 months): 342 customers, $89,450 total revenue. 1 high-severity finding: 23 valuable customers at churn risk, representing $12,340 in historical spend. 1 medium-severity finding: Top 10% of customers drive 52% of revenue. Action: Reach out to your top at-risk customers immediately.
Churn risk:
"Which customers am I about to lose?"
23 customers at churn risk, representing $12,340 in historical revenue. Most valuable at-risk: Jane Doe ($2,450, 45 days overdue).
How It Works
This MCP server uses two Shopify APIs:
ShopifyQL (
shopifyqlQuery) for all aggregated analytics — sales summaries, trends, top products, geographic breakdowns, channel performance. Shopify does the aggregation server-side and returns tabular data directly.GraphQL Admin API for entity-level lookups — specific orders, inventory quantities, order search.
Every tool returns a dual-format response:
summary— a human-readable string the LLM can relay directlydata— structured JSON for follow-up analysis
The server is read-only by design. No write operations. No creating products, updating orders, or deleting anything. Analytics only.
Authentication
The server supports two auth methods, detected automatically from environment variables:
Variables | Method | Notes |
| Client credentials grant | Recommended. Tokens auto-refresh every 24h. |
| Legacy static token | For existing custom apps with |
Client credentials grant requires the app and store to be in the same Shopify organization. This is the standard setup for merchants querying their own stores.
Troubleshooting
"Authentication failed"
Verify your Client ID and Client Secret in the Shopify Dev Dashboard under Settings.
Make sure you released a version of the app and installed it on your store.
"Client credentials auth requires the app and store to be in the same organization"
The Dev Dashboard app must be created under the same organization that owns the store. Log into dev.shopify.com with the same account that manages your store.
"Missing required API scope"
Go to your app's Versions tab in the Dev Dashboard, add the missing scope, release a new version, then re-approve in your store admin.
"ShopifyQL parse error"
If using
run_shopifyql, check your query syntax. The error message from Shopify will describe what went wrong. Claude can usually fix and retry automatically.
"Shopify API rate limit reached"
The server auto-retries with backoff, but if you're hitting limits consistently, try narrower date ranges or fewer concurrent queries.
Requirements
Node.js 18+
A Shopify store with a Dev Dashboard app (or legacy custom app)
An MCP-compatible host (Claude Desktop, Cursor, Claude Code, etc.)
Development
git clone https://github.com/scooperai/shopify-analytics-mcp.git
cd shopify-analytics-mcp
npm install
npm run buildTo test locally, set the environment variables and run:
SHOPIFY_STORE=your-store SHOPIFY_CLIENT_ID=xxx SHOPIFY_CLIENT_SECRET=yyy node dist/index.jsLicense
MIT
Built by Scooper AI. We build custom AI workflows for e-commerce teams. This MCP server is a free taste of what we do.
Available Tools
18 toolsget_customer_churn_riskA
Identify customers at risk of churning based on their purchase patterns. Finds customers who have gone significantly longer than usual without ordering, sorted by lifetime spend.
Inputs: limit, period.
get_customer_health_reportA
Get a full customer health diagnosis for your store. Analyzes RFM segments, churn risk, and lifetime value in one report with severity-ranked findings and recommended actions.
Inputs: period.
get_customer_insightsB
Get customer analytics: total customers, top spenders, and aggregate metrics.
Inputs: period.
get_customer_ltv_summary
Get customer lifetime value (LTV) projections. Shows annualized revenue run-rate per customer, top customers by projected LTV, and LTV breakdown by RFM segment.
Inputs: period.
get_customer_rfm_segmentsB
Segment customers by Recency, Frequency, and Monetary value (RFM analysis). Identifies Champions, Loyal, At Risk, Lost, and other segments.
Inputs: period.
get_discount_performanceB
Get performance of discount codes — revenue, orders, and discount amounts.
Inputs: period, discount_code.
get_inventory_statusC
Get current stock levels with low-stock and out-of-stock alerts.
Inputs: include_all, low_stock_threshold.
get_order_details
Get full details for a specific order — line items, shipping, billing, transactions, fulfillments, refunds.
Inputs: order_number (required).
get_order_trendsB
Get daily/weekly/monthly revenue and order count breakdown for trend analysis.
Inputs: period, compare_to, granularity.
get_product_performanceA
Get detailed analytics for a specific product or compare all products. Shows revenue, units sold, AOV with optional period comparison.
Inputs: period, compare_to, product_title.
get_recent_orders
Get the most recent orders with key details — customer, amount, status, items.
Inputs: limit, status, financial_status.
get_refunds_summaryB
Get refund metrics — total refunds, refund rate, and optionally by product.
Inputs: period, group_by.
get_sales_by_channelC
Get revenue breakdown by sales channel (Online Store, Shop app, POS, etc.).
Inputs: period, compare_to.
get_sales_by_geographyC
Get revenue breakdown by country, region, or city.
Inputs: limit, period, group_by.
get_sales_summary
Get revenue, orders, AOV, and period comparison for your Shopify store. Works with natural date ranges like 'last_7d', 'this_month', 'last_quarter'.
Inputs: period, compare_to.
get_top_productsC
Get best-performing products ranked by revenue or order count.
Inputs: limit, period, sort_by.
run_shopifyqlA
Run a raw ShopifyQL query for custom analytics not covered by other tools. Example: FROM sales SHOW total_sales, orders TIMESERIES day SINCE -7d
Inputs: query (required).
search_ordersB
Search orders using Shopify query syntax. Examples: 'financial_status:refunded', 'email:jane@example.com', 'tag:rush', 'created_at:>2026-03-01'.
Inputs: query (required), limit, sort_by.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
MerchantFlow is a hosted, read-only ecommerce analytics MCP server for Shopify and WooCommerce. It gives AI assistants tenant-scoped access to revenue, profit and loss, product and SKU profitability, COGS coverage, fulfillment costs, advertising spend, ROAS, marketing performance, cohorts, LTV, and business valuation across connected commerce and marketing platforms. Connect with OAuth over Streamable HTTP. No local server installation is required.
Ask Claude or ChatGPT about your WooCommerce sales, stock and orders. Safe edits with undo.
Odoo MCP connector for ChatGPT and Claude: ask sales, invoices and stock in plain words. Read-only.
Related MCP Servers
- AlicenseCqualityDmaintenanceConnects your Shopify store data to Claude Desktop, enabling access to products, orders, customers, inventory, and more through natural language.154MIT
- AlicenseAqualityCmaintenanceEnables read-only access to Lightspeed X retail data (sales, inventory, products, customers) with aggregated reporting on revenue, COGS, profit, and other metrics for MCP clients like Claude.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables secure, read-only access to WooCommerce store data through MCP-compatible assistants, letting users query products, orders, sales summaries, and inventory alerts without exposing store credentials.-
- AlicenseNot gradedqualityCmaintenanceEnables Claude and other MCP clients to query live online-store product, order, sales, stock, and customer data in plain English, with secure read-only defaults, masked customer information, capped results, and audit logging.MIT