TC

tomi-claycosmos/shopify-store-assistant-mcp

浏览器自动化

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 0 forks 质量 55 趋势 14

演示MCP服务器:ChatGPT应用和Grok Bot的Shopify商店助手——OAuth 2.1(DCR+PKCE),安全受限工具,MCP应用小部件。示例数据。

概览

由 Tomi(https://ziy.one/).)制作的作品集演示,来自虚构商店(“Kopi & Co. 演示商店”)。与 Shopify 无关。 一个TypeScript MCP服务器(官方@modelcontextprotocol/sdk 1.32,可流式HTTP),允许店主通过ChatGPT、Grok Bot或Cursor查询产品、库存和订单,并草拟折扣码。每个工具都有明确的安全界限。 这些数据是用无头 Chromium(Playwright)在本地服务器上捕获的。所有工具输出都是真实的;所有存储数据都是样本数据。用 npx tsx 脚本/脚本/ screenshots.ts 重新生成它们。 涵盖用卡片搜索产品、带隐藏个人信息的订单查询、成功15%折扣的选秀、被上限阻挡的80%折扣,以及被拒退款的情况: 攻略视频:截图/walkthrough.mp4(webm) 安全限制:- 没有退款、删除、取消或客户编辑工具。- 折扣选票存储在服务器内存中,永远不会更改Shopify。- 每次通话都会附加到审计日志中(JSONL,无令牌,无原始个人身份信息)。

概述(AI 翻译)

Tomi 的作品集演示(https://ziy.one/). **默认数据为来自虚构商店(“Kopi & Co. 演示商店”)的样本数据。与 Shopify 无关。

一个TypeScript MCP服务器(官方@modelcontextprotocol/sdk 1.32,可流式HTTP),允许店主通过ChatGPT、Grok Bot或光标查询产品、库存和订单,并草拟折扣码。每个工具都有明确的安全界限。

建筑

截图

这些数据是用无头 Chromium(Playwright)在本地服务器上捕获的。所有工具输出均为实数;所有存储数据均为样本数据。用 npx tsx scripts/screenshots.ts 重新生成它们。

OAuth 同意 聊天主机中的小部件

演示文字稿涵盖了用卡片搜索产品、带有隐藏个人信息的订单查询、成功的15%折扣草稿、被瓶盖封锁的80%折扣以及被拒退款的情况:

攻略视频:截图/walkthrough.mp4(webm)

工具

工具 目的 只读 破坏性 开放世界 范围
search_products 关键词/类型/SKU 搜索 ✅ ❌ ❌ store.read
check_inventory 一个SKU的库存 ✅ ❌ ❌ store.read

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Shopify Store Assistant — MCP server demo (ChatGPT App · Grok Bot connector · Muse-ready)

Portfolio demo by Tomi (https://ziy.one/). Default data is SAMPLE data from a fictional store (“Kopi & Co. Demo Store”). Not affiliated with Shopify.

A TypeScript MCP server (official @modelcontextprotocol/sdk 1.32, Streamable HTTP) that lets a store owner query products, inventory and orders from ChatGPT, Grok Bot or Cursor, and draft discount codes. Every tool has explicit safety bounds.

Architecture

flowchart LR
  subgraph Clients
    C1[ChatGPT Developer Mode]
    C2[Grok Bot / Cursor]
    C3[Muse connector / MCP Inspector]
  end
  C1 & C2 & C3 -- "OAuth 2.1 (DCR + PKCE S256)" --> AS[Built-in demo Authorization Server/register /authorize /token]
  C1 & C2 & C3 -- "Bearer token · Streamable HTTP POST /mcp" --> MW[Bearer middleware401 + WWW-Authenticate resource_metadata]
  MW --> MCP[McpServer per request6 tools + UI resource]
  MCP --> SAFE[Safety layerscope checks · 20% discount cap · PII masking · no refund/delete]
  SAFE --> AUD[(logs/audit.jsonl)]
  SAFE --> DATA{Store adapter}
  DATA -->|default| MOCK[Mock sample store]
  DATA -->|SHOPIFY_STORE_DOMAIN + SHOPIFY_ADMIN_TOKEN| SHOP[Shopify Admin GraphQLread-only, untested live]
  MCP --> UI[ui://shopify-assistant/product-list-v1.htmltext/html;profile=mcp-app]

Screenshots

These were captured with headless Chromium (Playwright) against the local server. All tool output is real; all store data is sample data. Regenerate them with npx tsx scripts/screenshots.ts.

OAuth consent Widget in a chat host

Demo transcript covers product search with cards, order lookup with masked PII, a 15% discount draft that succeeds, an 80% discount blocked by the cap, and a rejected refund:

Walkthrough video: screenshots/walkthrough.mp4 (webm)

Tools

Tool Purpose readOnly destructive openWorld Scope
search_products keyword/type/SKU search ✅ ❌ ❌ store.read
check_inventory stock for one SKU ✅ ❌ ❌ store.read
lookup_order order details, customer PII masked ✅ ❌ ❌ store.read
get_order_status payment/fulfillment/tracking only ✅ ❌ ❌ store.read
create_discount_draft inactive draft, capped at MAX_DISCOUNT_PERCENT (20) ❌ ❌ ❌ discounts.write
render_product_list renders the widget (decoupled render tool) ✅ ❌ ❌ —

Safety bounds:

  • There are no refund, delete, cancel or customer-edit tools.
  • Discount drafts live in server memory and never change Shopify.
  • Every call is appended to an audit log (JSONL, no tokens, no raw PII).
  • Input is validated with zod.
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →