Skip to main content

Shopify Analytics MCP

商店运营 MCP 服务器让你管理产品和订单。Analytics MCP 服务器 更进一步——它们提供对销售报告、流量数据、营销绩效和跨平台商业智能的访问。无需在 Shopify Analytics、Google Analytics 和广告平台仪表板之间切换,你可以通过 MCP 以对话方式查询所有数据。

Analytics MCP 全景

多个 MCP 服务器为 Shopify 商家和开发者提供分析功能:

服务器重点数据源传输方式
Adzviser MCP营销和销售分析Shopify、Google Ads、Meta Ads、GA4stdio
CData Code Assist数据库式查询Shopify + 200 个连接器stdio
Composio Tool Router多平台编排Shopify + 100 多个集成stdio/HTTP
Custom MCP你的特定需求你构建的任何数据源任意

Adzviser MCP 用于 Shopify 分析

Adzviser 提供了一个 MCP 服务器,将 Shopify 的分析与营销平台连接起来,通过自然语言查询为你提供商店绩效的统一视图。

Adzviser 提供的功能

  • 销售分析:按时间段的收入、订单、平均订单价值、转化率
  • 产品绩效:畅销品、滞销品、按产品/产品系列的收入
  • 营销归因:Google Ads、Meta Ads、TikTok Ads 的广告支出与收入对比
  • 客户分析:新客与回头客、生命周期价值估算、地理分布
  • 流量分析:会话数、页面浏览量、跳出率、流量来源(通过 GA4 集成)

设置

安装 Adzviser MCP
claude mcp add adzviser -- npx -- -y @adzviser/mcp-server

安装后,你需要使用 Adzviser 账户进行身份验证,该账户处理与各种数据源(Shopify、Google Ads 等)的 OAuth 连接。

Claude Desktop 配置
{
"mcpServers": {
"adzviser": {
"command": "npx",
"args": ["-y", "@adzviser/mcp-server"],
"env": {
"ADZVISER_API_KEY": "your-api-key"
}
}
}
}

示例查询

连接后,你可以用自然语言提出分析问题:

销售绩效
> What was our total revenue, order count, and average order value
for the last 30 days? Compare it to the previous 30-day period.
产品分析
> Which 10 products generated the most revenue this month?
Include units sold and average selling price for each.
营销 ROI
> Compare our Google Ads and Meta Ads performance for Q1.
Show spend, revenue attributed, ROAS, and cost per acquisition
for each platform.
客户洞察
> What percentage of our revenue comes from returning customers
vs first-time buyers? Show the trend over the last 6 months.
数据新鲜度

通过 MCP 获取的分析数据通常每隔几小时更新一次,不是实时的。对于实时订单通知或库存警报,请直接使用 Shopify Webhook。MCP 分析最适合用于报告、趋势分析和战略决策。

构建报告

你可以让 Claude Code 使用分析数据编制结构化报告:

每周报告生成
> Generate a weekly performance report covering:
1. Revenue and order summary (vs last week and vs same week last year)
2. Top 5 products by revenue
3. Marketing spend and ROAS by channel
4. Customer acquisition cost trend
5. Inventory alerts (products with < 2 weeks of stock)

Format it as a Markdown document I can share with the team.

CData Code Assist MCP

CData 提供了一种不同的分析方法——它不是预构建的仪表板,而是为你提供对 Shopify 数据(以及 200 多个其他数据源)的类 SQL 查询能力。

CData 提供的功能

CData Code Assist MCP 将 Shopify 视为可查询的数据库。你可以使用熟悉的类 SQL 语法对产品、订单、客户和其他 Shopify 资源运行结构化查询。

设置

安装 CData Code Assist
claude mcp add cdata -- npx -- -y @cdata/code-assist-mcp

配置需要连接到你的 CData Cloud 实例:

CData 配置
{
"mcpServers": {
"cdata": {
"command": "npx",
"args": ["-y", "@cdata/code-assist-mcp"],
"env": {
"CDATA_INSTANCE_URL": "https://your-instance.cdata.com",
"CDATA_AUTH_TOKEN": "your-auth-token"
}
}
}
}

使用场景

CData 在你需要超越简单报告查询的复杂数据分析时表现出色:

群组分析
> Query our Shopify order data to build a monthly cohort analysis.
Group customers by their first order month, then show retention
(repeat purchase rate) for each subsequent month.
跨平台关联
> Join our Shopify order data with our Google Analytics session
data to calculate true conversion rate by traffic source,
accounting for multi-session purchase journeys.
库存预测数据
> Pull the last 12 months of daily sales velocity for our top
50 products. I want to calculate reorder points based on
average daily sales and lead time.
何时使用 CData 与 Adzviser

Adzviser 更适合标准的营销和销售报告——它提供针对常见商家问题优化的预构建分析。CData 更适合自定义分析、跨平台数据关联,以及你需要以标准报告不支持的方式查询数据时。许多团队两者都使用。

Composio Tool Router

Composio 采用更广泛的方式——它是一个工具路由层,将 AI 代理连接到 100 多个平台,包括 Shopify、Slack、Google Sheets、电子邮件和 CRM。

Composio 提供的功能

Composio 不是专注于 Shopify,而是让你构建多平台分析工作流:

  • 拉取 Shopify 销售数据 将摘要推送到 Slack
  • 查询订单数据 用结果更新 Google Sheet
  • 监控库存水平 在项目管理工具中创建任务
  • 将多个 Shopify 商店的数据聚合到统一视图中

设置

安装 Composio MCP
claude mcp add composio -- npx -- -y composio-mcp
Composio 配置
{
"mcpServers": {
"composio": {
"command": "npx",
"args": ["-y", "composio-mcp"],
"env": {
"COMPOSIO_API_KEY": "your-composio-key"
}
}
}
}

多平台工作流示例

销售到 Slack
> Pull today's Shopify sales total, top 3 selling products,
and any orders over $500. Format this as a daily digest
and post it to our #sales-updates Slack channel.
库存到 Sheets
> Check inventory levels for all products. Export any products
with less than 20 units in stock to our "Reorder Alerts"
Google Sheet, including product name, SKU, current stock,
and 30-day average sales velocity.
多店聚合
> I manage 3 Shopify stores (US, UK, EU). Pull this week's
revenue from each store, convert to USD, and create a
comparison table showing performance by region.
Composio 的范围

Composio 功能强大但范围广泛。对于 Shopify 特定的分析,专用服务器(Adzviser、CData)提供更深入的功能。Composio 最适合你的工作流本质上需要跨多个平台的场景。

使用 MCP 数据构建自定义分析仪表板

对于成熟的 Shopify 企业来说,最强大的方法是将 MCP 数据访问与自定义仪表板相结合。

架构模式

自定义分析架构
1. Claude Code(配合 MCP 服务器)从多个来源查询数据
2. 数据被处理并结构化为标准格式
3. 结果写入本地数据库或 JSON 文件
4. 前端仪表板(React、Next.js,甚至简单的 HTML)可视化数据

使用 Claude Code 实现

构建仪表板数据管道
> Create a data pipeline script that:
1. Uses the Shopify MCP to pull the last 30 days of orders
2. Calculates daily revenue, order count, and AOV
3. Groups products by collection and calculates revenue per collection
4. Computes customer segmentation (new vs returning)
5. Writes all results to JSON files in data/analytics/
6. Create a simple React dashboard component that reads and
visualizes these JSON files using Recharts

计划数据刷新

对于生产环境仪表板,将 MCP 数据收集与定时任务相结合:

scripts/refresh-analytics.ts
import { exec } from 'child_process';

// Run via cron: 0 */4 * * * (every 4 hours)
// This script asks Claude Code to refresh analytics data
// using MCP servers and write updated JSON files

async function refreshAnalytics() {
// Fetch order data via Shopify Store MCP
const orders = await fetchRecentOrders(30); // last 30 days

// Calculate metrics
const dailyRevenue = aggregateByDay(orders);
const topProducts = rankByRevenue(orders);
const customerSegments = segmentCustomers(orders);

// Write to data files for dashboard consumption
await writeJSON('data/daily-revenue.json', dailyRevenue);
await writeJSON('data/top-products.json', topProducts);
await writeJSON('data/customer-segments.json', customerSegments);

console.log(`Analytics refreshed: ${orders.length} orders processed`);
}
从简单开始,逐步扩展

不要试图在第一天就构建一个全面的分析平台。从单个指标(每日收入)开始,验证数据是否准确,然后逐步添加更多指标。每个 MCP 查询都会消耗 token 和时间——渐进式地构建。

选择合适的 Analytics MCP

场景推荐方案
快速销售查看Shopify Store MCP(直接订单查询)
营销 ROI 报告Adzviser MCP
自定义数据分析CData Code Assist MCP
多平台工作流Composio Tool Router
生产仪表板自定义 MCP + 数据管道
一次性深度分析Claude Code + Store MCP(手动会话)

限制和注意事项

Token 成本

处理大型数据集的分析查询会消耗大量 token。一个获取 1,000 个订单并进行分析的查询可能花费 1-3 美元的 API token。对于频繁的分析,请考虑:

  • 缓存结果以避免冗余获取
  • 在服务器端预聚合数据
  • 对标准指标使用 Shopify 内置的分析功能

数据准确性

MCP 分析查询 Shopify 的 API,提供准确的交易数据。但是:

  • 收入数字 可能因时间和时区差异而与 Shopify 的仪表板不同
  • 流量数据 需要单独的 GA4 或类似集成
  • 跨营销渠道的 归因 本质上是近似的
  • 始终将重要的财务数据与 Shopify 的官方报告进行交叉验证

速率限制

大量分析查询可能会触发 Shopify 的 API 速率限制。Admin API 允许大约每秒 40 个 REST 请求或每秒 2,000 个 GraphQL 成本点。相应地规划批量数据获取:

注意速率限制的查询
> Fetch all orders from last quarter, but pace the API calls
to stay under 50% of the rate limit. I don't need real-time
speed -- accuracy and completeness matter more.

下一步

分析部分介绍完毕,你现在拥有了完整的 MCP 工具包:开发知识(Dev MCP)、商店运营(Store MCP)和商业智能(Analytics MCP)。最后一个环节是构建你自己的自定义 MCP 服务器。继续学习 构建自定义 MCP 服务器 了解详情。