shopify-forecast-mcp

shopify-forecast-mcp

Enables AI assistants to forecast revenue and demand for Shopify stores using Google's TimesFM model. Provides tools for revenue forecasting, demand analysis, promotion analysis, and anomaly detection.

Category
访问服务器

README

shopify-forecast-mcp

⚠️ v0.1.0 Alpha — Early release. API surface may change before v0.2. Feedback welcome: open an issue.

Merchant-native MCP server that connects Google's TimesFM 2.5 time-series foundation model to your Shopify store — so your AI assistant can answer "what does next month look like?" with a real forecast grounded in your order history.

No dashboards, no exports, no per-store training. Works with Claude Desktop, Claude Code, Cursor, and any MCP-compatible AI client.


Why

Shopify has four official MCP servers, all buyer-facing or developer-facing. None serve merchant operations: forecasting, demand planning, promo analysis, anomaly detection.

Existing third-party tools either use weak models (moving averages, Prophet) or lock insights inside closed SaaS dashboards. This one:

  • Runs TimesFM 2.5 (Google's 200M-param foundation model) — state of the art on the GIFT-Eval retail benchmark
  • Pulls directly from Shopify Admin GraphQL with bulk operations, refund-aware normalization, multi-currency, and cost-based rate limiting
  • Returns markdown tables with confidence bands that render natively in your MCP client
  • Ships as a single uvx command — zero manual Python setup
  • Is MIT licensed, free forever

Quick start

Three steps to a working forecast in under 5 minutes:

1. Install uv (once)

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex

2. Get a Shopify Admin API access token

Follow docs/SETUP.md to create a custom app, enable the required scopes (read_orders, read_all_orders, read_products, read_inventory), and generate an access token.

3. Add to Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add:

{
  "mcpServers": {
    "shopify-forecast": {
      "command": "uvx",
      "args": ["shopify-forecast-mcp"],
      "env": {
        "SHOPIFY_FORECAST_SHOP": "mystore.myshopify.com",
        "SHOPIFY_FORECAST_ACCESS_TOKEN": "shpat_xxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Restart Claude Desktop, then ask: "What does next month look like?"

First run downloads TimesFM 2.5 weights (~400MB, one-time). Subsequent forecasts are <10 seconds.

Prefer the terminal first? You can verify your setup before wiring Claude Desktop by running uvx shopify-forecast-mcp directly — it launches the MCP server on stdio and will exit cleanly on Ctrl-C when no client is attached. Or exercise the CLI: uvx --from shopify-forecast-mcp shopify-forecast revenue --horizon 7.

Alpha pre-release: if installing v0.1.0-rc1, use "args": ["--prerelease=allow", "shopify-forecast-mcp@0.1.0rc1"] instead.

See also: docs/SETUP.md for Claude Code + generic MCP client setup, Docker install, and multi-store configuration.


Examples

Drop these into your AI client after setup:

Revenue forecasting"What does next month look like?" Returns a daily-granularity revenue forecast for the next 30 days with an 80% confidence band (q10–q90).

Demand + reorder alerts"Which SKUs need to be reordered in the next 2 weeks?" Returns top-N SKUs with projected demand vs current inventory, flagging stockout risk.

Promo analysis"How did Black Friday perform vs last year?" Returns revenue lift, order lift, AOV change, discount depth, and post-promo hangover estimate for both windows side by side.

Scenario planning"Compare 3 promo scenarios for December: 10% off, 20% off + free shipping, and BOGO." Returns 3 differentiated forecasts in one markdown response with per-scenario revenue, units, and margin implications.


Tools

Seven MCP tools, full reference in docs/TOOLS.md:

Tool Purpose
forecast_revenue Store-level revenue forecast with confidence bands
forecast_demand Product/collection/SKU demand + reorder alerts
analyze_promotion Past promo vs baseline — lift, AOV, hangover
detect_anomalies Flag days outside forecast quantile bands
compare_periods Year-over-year / month-over-month comparison
compare_scenarios What-if forecasting across 2-4 scenarios
get_seasonality Explain learned seasonal patterns

Architecture

Two-layer design: a pure-Python core library (Shopify client, time-series shaping, TimesFM forecaster, analytics, covariates) wrapped by a thin MCP server and a matching CLI. Core is importable and testable without the MCP runtime.

Dual-backend Shopify access: DirectBackend (httpx + access token, used in Docker and when SHOPIFY_FORECAST_ACCESS_TOKEN is set) or CliBackend (shopify store execute — browser OAuth, no token required, host-only).

Full diagrams + design decisions in docs/ARCHITECTURE.md.


Configuration

Minimum required env vars:

Variable Purpose
SHOPIFY_FORECAST_SHOP Your store domain (e.g. mystore.myshopify.com)
SHOPIFY_FORECAST_ACCESS_TOKEN Admin API access token (from custom app)

See docs/SETUP.md for the full env var table, multi-store config, Docker env passing, and optional tuning knobs.


CLI

A standalone shopify-forecast CLI wraps the same core library without the MCP runtime — useful for scripting, cron, and CI:

uvx --from shopify-forecast-mcp shopify-forecast revenue --horizon 30
uvx --from shopify-forecast-mcp shopify-forecast demand --group-by product --top-n 10
uvx --from shopify-forecast-mcp shopify-forecast promo --start 2025-11-24 --end 2025-11-30
uvx --from shopify-forecast-mcp shopify-forecast compare --period-a 2024-11:2024-12 --period-b 2025-11:2025-12

Add --json to any verb for machine-readable output. See docs/SETUP.md#cli-usage for the full CLI reference.


Docker

Run the MCP server (or any CLI verb) without installing Python:

docker run --rm -i \
  -e SHOPIFY_FORECAST_SHOP=mystore.myshopify.com \
  -e SHOPIFY_FORECAST_ACCESS_TOKEN=shpat_xxx \
  ghcr.io/mcostigliola321/shopify-forecast-mcp:latest

Two image variants:

  • :latest — lazy model download on first call (smaller image, ~1.5GB)
  • :bundled — TimesFM weights baked in (larger image, ~2.5GB, offline-capable)

Browser-based OAuth does NOT work in containers; Docker mode requires the access-token env var. See docs/SETUP.md#docker.


Roadmap

v0.1.0 is the first public alpha, covering the full MVP (7 MCP tools + 4 CLI verbs + dual-backend). Future: see .planning/ROADMAP.md.


Contributing

Feedback and bug reports welcome at GitHub Issues. For code contributions, see docs/ARCHITECTURE.md for the two-layer design and open a draft PR early.


License

MIT. TimesFM 2.5 weights are Apache 2.0 (compatible).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选