Packrift MCP Server
OfficialPackrift MCP 服务器
用于 Packrift(一家 Shopify 包装用品商店)的生产级 MCP(模型上下文协议)服务器。允许 AI 代理搜索目录、获取实时价格和库存、为商品推荐包装盒、估算运费并生成结账 URL。
技术栈: Cloudflare Workers, TypeScript (严格模式), Hono, Zod, Streamable HTTP 传输
后端: Shopify Admin GraphQL API (
2025-04), 商店packrift.myshopify.com端点:
POST /mcp,GET /mcp(SSE),GET /(健康检查),GET /.well-known/mcp/server-card.json
工具
工具 | 用途 |
| 在整个目录中进行关键词搜索。在 KV 中缓存 5 分钟。 |
| 获取完整产品详情,包括变体、尺寸元字段、重量。 |
| 实时单价 + 行总价。从不缓存。 |
| 实时库存数量。从不缓存。 |
| 最多 5 个排名靠前的变体建议,包含 0.5–2 英寸的填充空间。 |
| 通过 Shopify |
| 构建 |
Related MCP server: UPS MCP Server
本地开发
安装 Node 24+ 和依赖项:
cd ~/Downloads/packrift-mcp-server
npm install本地密钥 — 已在 .dev.vars 中创建(已忽略 git):
SHOPIFY_PACKRIFT_TOKEN=shpat_...运行服务器:
npx wrangler dev --port 8787 --local使用 curl 对 MCP 端点进行冒烟测试:
# initialize
curl -s -X POST http://127.0.0.1:8787/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
# list tools
curl -s -X POST http://127.0.0.1:8787/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# search
curl -s -X POST http://127.0.0.1:8787/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"search_products","arguments":{"query":"poly mailer","limit":3}}}'类型检查:
npx tsc --noEmit部署
Cloudflare 账户正在单独的流程中创建。准备就绪且 wrangler 已登录 (wrangler login) 后,按顺序运行以下命令:
cd ~/Downloads/packrift-mcp-server
# 1. Create the KV namespace and copy the printed id into wrangler.toml
# (replace both `id` and `preview_id` with the same value).
npx wrangler kv namespace create CATALOG_CACHE
# 2. Set the Shopify Admin token as a secret (paste shpat_... when prompted).
npx wrangler secret put SHOPIFY_PACKRIFT_TOKEN
# 3. Deploy. Initial deploy puts the worker on
# https://packrift-mcp.<account>.workers.dev
npx wrangler deploy
# 4. (Once mcp.packrift.com is CNAME'd to the worker) uncomment the [[routes]]
# block in wrangler.toml and redeploy.
npx wrangler deploy部署后,MCP 端点为 https://packrift-mcp.<account>.workers.dev/mcp(后续为 https://mcp.packrift.com/mcp)。服务器卡片位于 /.well-known/mcp/server-card.json。
设计说明 / 注意事项
cartCreate是 Storefront API 的变更操作,而非 Admin API。 需求中要求使用cartCreate+cartBuyerIdentityUpdate来获取运费,但本服务器使用的 Admin GraphQL API 中不存在这些功能。支持的 Admin 路径是draftOrderCalculate,这也是get_shipping_estimate所使用的。它返回相同的承运商费率数据,而无需创建实际订单。尺寸解析。 Packrift 产品尺寸位于
custom.specN_value元字段中,其中匹配的custom.specN_name显示为“Dimensions”或“Size”。格式为人类可读的 (12 1/8" L x 11 5/8" W x 2 5/8" H)。src/dimensions.ts会解析混合分数,并回退到扫描标题。推荐集合。 需求中提到了
mailer-boxes集合 — 该句柄在实时商店中不存在。我们使用mailers-envelopes、boxes-mailers、corrugated-boxes、bubble-wrap-foam、cushioning和ecommerce-fulfillment(已通过collections查询 2026-04-29 验证)。用例映射 位于
src/tools/recommend_packaging.ts(COLLECTIONS_BY_USE_CASE) 中。响应中的运费
handle是一个很长的、不透明的 JWT 风格字符串 — 这就是 Shopify 返回费率句柄的方式;如果需要,请将其传递给后续调用。错误:根据 MCP 规范,工具异常作为
{ content: [...], isError: true }返回,而不是作为 JSON-RPC-3260x错误返回。协议级错误(未知工具、错误的 JSON)确实会返回 JSON-RPC 错误。
文件映射
src/
index.ts Hono app + MCP JSON-RPC dispatcher
shopify.ts Admin GraphQL client + id helpers
dimensions.ts Spec-string -> structured dimensions
server-card.ts /.well-known card
tools/
search_products.ts
get_product.ts
get_pricing.ts
check_inventory.ts
recommend_packaging.ts
get_shipping_estimate.ts
create_cart_url.ts
wrangler.toml Worker config (KV binding, vars, route)
package.json
tsconfig.json
.dev.vars Local-only secrets (gitignored)This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceA Shopify-focused MCP server that enables AI agents to manage store operations like order tracking, product discovery, and checkout link generation. It facilitates customer-facing interactions including shipping estimates and real-time inventory searches.
- AlicenseAqualityDmaintenanceEnables AI agents to create shipments, track packages, get rates, validate addresses, schedule pickups, and find UPS locations via the UPS API.9102MIT
- AlicenseBqualityDmaintenanceEnables AI agents and automation tools to interact with the Gobox e-commerce platform, providing tools for orders, products, inventory, warehouses, reports, shipments, and webhooks.59MIT
- Flicense-qualityFmaintenanceEnables AI assistants to query and interact with Shopify store data via the Storefront API, including products, collections, carts, and customer information.9
Related MCP Connectors
Multi-carrier shipping for AI agents: compare rates, buy labels, track packages, validate addresses
Shopify MCP Pack — wraps the Shopify Admin REST API (2024-01)
India shipping for AI agents: Shiprocket courier serviceability, create orders, track AWB.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Packrift/packrift-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server