Shopify Content Engine MCP Server
Enables agents to validate product content drafts and trigger the Shopify AI content engine workflow to generate complete marketing kits including SEO, ads, blog posts, and images.
README
Shopify Product Content Engine
An n8n pipeline that turns a bare product (product_name, product_description) into a complete,
review-ready marketing kit — SEO research, product-page copy, a blog post, Google + Meta ads,
social posts, an email and a hero image — and writes one row per product to a review sheet.
Nothing publishes automatically; a human approves.
Alongside the workflow this repo ships the two things that make it operable rather than a demo: an eval harness that scores every generated kit against the engine's own rules (length caps, banned words, invented facts) and an MCP server so any agent — Claude Desktop, Claude Code, Cursor, your own — can validate drafts and trigger runs.
product_name + product_description
│
▼
┌────────────── n8n ──────────────┐
│ idempotency gate → 3 LLM calls │──▶ Review sheet (status=done | failed)
│ strict JSON → validate → map │──▶ hero image → Drive
│ dry-run · retry · dead-letter │──▶ batch summary email
└─────────────────────────────────┘
▲ │
MCP server eval harness
(validate / run) (rules + LLM judge, gates CI)
Why it's built this way
| Concern | What the engine does |
|---|---|
| Hallucinated specs | Every prompt is facts-only; the eval flags any number/unit or claim word (clinically, certified, vegan, …) not present in the product input. |
| Fragile parsing | All three model calls use OpenAI Structured Outputs (strict: true) — schema-valid JSON, no regex. |
| Re-runs / cost | An idempotency gate skips anything already status=done; forceRegenerate overrides. Bulk model is gpt-4o-mini. |
| One bad product | Per-call retry + continue-on-error. Failures are written as status=failed rows with a failure_reason (dead-letter) — the batch never stops. |
| Uncaught failures | Routed to a separate Error Handler workflow → alert email. |
| Testing without side effects | dryRun=true generates and validates but writes nothing. |
| Publishing | Never automatic. Drafts land in the Review tab and a human approves. |
| Platform limits | Hard caps (SEO title ≤ 60, meta ≤ 155, Google headline ≤ 30, X ≤ 280, …) live in config/, are enforced in the Parse node, and are re-checked by the evals. |
Flow
Manual / Schedule / Webhook ─▶ ⚙️ Config ─▶ 📥 Read Products [swap point → Shopify]
─▶ 📖 Read Done ─▶ 🚦 Idempotency Gate ─▶ 🔢 Limit ─▶ 🔁 Loop (1 product at a time)
─▶ 🤖 A: SEO + Product Page ─▶ 🤖 B: Blog ─▶ 🤖 C: Ads / Social / Email / Image prompt
─▶ 🧩 Parse, Validate & Map ─▶ 🧪 Dry run?
├─ yes ─▶ 📝 Dry-run log (no write) ─▶ loop
└─ no ─▶ 🖼️ Images? ─▶ 🎨 gpt-image-1 ─▶ ☁️ Drive ─▶ 📤 Upsert Review row ─▶ loop
🔁 done ─▶ 📊 Batch summary ─▶ ✉️ Email (optional)
(uncaught) ─▶ ⚠️ Error Handler workflow ─▶ alert email
Full Mermaid diagram: docs/architecture.mmd.
Product source is a Google Sheet today; 📥 Read Products is a marked swap point for
Shopify → Get Products (title → product_name, body_html → product_description).
Evals
python -m evals scores kits (Review-tab rows) against the rules the engine promises to keep.
Rules come straight from config/generation.config.yaml and config/brand-voice.yaml, so
changing a cap in config changes the eval.
| Check family | Examples |
|---|---|
| Completeness | status=done, all 19 content fields present |
| Hard caps | 8 character caps, 3 word ranges, ≤15 Google headlines each ≤30 chars, 5–10 hashtags |
| Structure | 4–6 bullets, H2/H3 in the blog, exactly one {PRODUCT_URL} CTA, slug format |
| SEO placement | primary keyword in title / meta / first sentence (warnings) |
| Brand voice | banned words from brand-voice.yaml |
| Facts-only | numbers+units and claim words in the output must exist in the product input |
LLM judge (--judge) |
1–5 on facts-only, brand voice, SEO quality + quoted unsupported claims (Structured Outputs, opt-in, needs OPENAI_API_KEY) |
Current golden set (real kit from a live run, evals/golden/kits.json):
| Product | Score | What it caught |
|---|---|---|
| Gentle Hydrating Gel Cleanser | 88% | description 66 words (want 150–250), blog 507 words (want 900–1200), email 28 words (want 60–120) — the model under-delivers on length; the Parse node truncates over-length text but has no minimum-length retry yet |
That finding is exactly why the harness exists — it's now an open item (see roadmap). Run it
against your own export with python -m evals --input review-export.csv --min-score 0.9; the
non-zero exit code gates CI.
MCP server
mcp_server/ exposes the engine over the Model Context Protocol (stdio):
| Tool | Purpose |
|---|---|
get_brand_voice |
voice, audience, banned words, facts-only rule |
get_generation_limits |
the hard caps + run flags |
list_sample_products |
the five fixture products |
validate_content_kit(row, product) |
score a draft with the same rules as the evals |
run_content_engine(dry_run=True, …) |
POST the workflow webhook with per-run flags — dry-run by default |
Resources: content-engine://columns (Review sheet column map), content-engine://prompts/{A|B|C}.
Claude Desktop / Claude Code config:
{
"mcpServers": {
"shopify-content-engine": {
"command": "content-engine-mcp",
"env": { "N8N_WEBHOOK_URL": "https://<your-instance>/webhook/shopify-content-engine-run" }
}
}
}
Repo layout
workflows/ shopify-content-engine.workflow.json · error-handler.workflow.json (import these)
prompts/ system prompts A / B / C + prompt library (version-controlled mirror of ⚙️ Config)
config/ brand-voice.yaml · generation.config.yaml (limits, flags)
docs/ runbook.md · architecture.mmd · output-sheet-columns.md
test/ product-fixtures.json (5 products) · dry-run checklist · a real generated kit
evals/ checks.py (rules) · judge.py (LLM judge) · golden/ · tests/
mcp_server/ server.py · tests/
scripts/ check_workflows.py — static checks on the exported JSON (runs in CI)
Quick start
Workflow
- Import
workflows/error-handler.workflow.json, thenworkflows/shopify-content-engine.workflow.json. - Re-select credentials on the OpenAI / Google Sheets / Drive / Gmail nodes (never stored in the JSON).
- Point
📥 Read Products,📖 Read Done,📤 Writeat a sheet with tabsProductsandReview. - Set Settings → Error Workflow to the imported error handler.
- Dry-run the five fixtures (
test/README.md), then run for real. Run flags can be posted in the webhook body:{"dryRun": true, "enableImages": false}.
Evals + MCP
pip install -e ".[mcp,dev]"
python -m evals # score the golden set
python -m evals --input export.csv # score your own Review-tab export
pytest # 27 tests: rules, negative cases, MCP tools in-process
content-engine-mcp # start the MCP server (stdio)
Roadmap
- Minimum-length guard + one self-correcting retry in the Parse step (the eval currently flags short copy after the fact).
- Header-auth on the webhook trigger (n8n credential) — today it relies on the unguessable path.
- Shopify Admin API as the product source and a
Draft productwrite-back behind the same approval gate. - Golden set: more real kits, one per fixture, and a nightly
--judgerun.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。