Packrift MCP Server
OfficialPackrift MCPサーバー
Shopifyの梱包用品ストア「Packrift」向けのプロダクション用MCP(Model Context Protocol)サーバーです。AIエージェントがカタログ検索、リアルタイムの価格・在庫取得、商品に適した箱の推奨、送料見積もり、チェックアウトURLの生成を行えるようにします。
スタック: Cloudflare Workers, TypeScript (strict), Hono, Zod, Streamable HTTP transport
バックエンド: Shopify Admin GraphQL API (
2025-04), ストアpackrift.myshopify.comエンドポイント:
POST /mcp,GET /mcp(SSE),GET /(ヘルスチェック),GET /.well-known/mcp/server-card.json
ツール
ツール | 用途 |
| カタログ全体のキーワード検索。KVで5分間キャッシュされます。 |
| バリエーション、寸法メタフィールド、重量を含む製品詳細の取得。 |
| リアルタイムの単価と合計金額。キャッシュされません。 |
| リアルタイムの在庫数。キャッシュされません。 |
| 0.5~2インチの余裕を持たせた、ランク付けされた最大5つのバリエーション提案。 |
| Shopifyの |
|
|
Related MCP server: USA Logistics MCP
ローカル開発
Node 24以上をインストールし、依存関係をインストールします:
cd ~/Downloads/packrift-mcp-server
npm installローカルのシークレット — .dev.vars に作成済み(gitignored):
SHOPIFY_PACKRIFT_TOKEN=shpat_...サーバーの実行:
npx wrangler dev --port 8787 --localcurlで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はAdmin APIではなくStorefront APIのミューテーションです。 要件には配送レート取得のためのcartCreate+cartBuyerIdentityUpdateが含まれていましたが、これらは本サーバーが使用するAdmin GraphQL APIには存在しません。サポートされているAdminのパスはdraftOrderCalculateであり、get_shipping_estimateはこれを使用しています。実際の注文を作成することなく、同じ配送業者レートデータを返します。寸法の解析。 Packriftの製品寸法は、
custom.specN_nameが「Dimensions」または「Size」であるcustom.specN_valueメタフィールドに格納されています。形式は人間が読める形式(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を使用します(2026年4月29日にcollectionsクエリで確認済み)。ユースケースのマッピング は
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)Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Multi-carrier shipping for AI agents: compare rates, buy labels, track packages, validate addresses
Live product search for AI agents across Shopify merchants and major retailers.
Product search for AI agents: Amazon + Shopify, cart-to-checkout buy path. Pay-per-call, no API key.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to create shipments, track packages, get rates, validate addresses, schedule pickups, and find UPS locations via the UPS API.912 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to buy US shipping labels (USPS, UPS, FedEx) with automatic cheapest-rate selection, track parcels, and refund unused labels via the EasyPost API. Stateless, bring-your-own API key, free test keys available.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to browse product catalogs, search products with filters, and initiate checkouts, generating order summaries and checkout URLs.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to track packages, rate and create shipments, manage pickups and customs documentation, and perform international shipping logistics checks through natural language.MIT