Skip to main content
Glama
Packrift

Packrift MCP Server

Official
by Packrift

Packrift 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

ツール

ツール

用途

search_products(query, limit?)

カタログ全体のキーワード検索。KVで5分間キャッシュされます。

get_product(handle)

バリエーション、寸法メタフィールド、重量を含む製品詳細の取得。

get_pricing(variant_ids[], quantity?)

リアルタイムの単価と合計金額。キャッシュされません。

check_inventory(variant_ids[])

リアルタイムの在庫数。キャッシュされません。

recommend_packaging(dims, weight, use_case)

0.5~2インチの余裕を持たせた、ランク付けされた最大5つのバリエーション提案。

get_shipping_estimate(zip, country, items[])

Shopifyの draftOrderCalculate を介した配送業者レート。

create_cart_url(items[], discount_code?, ref?)

packrift.com/cart/...?ref=mcp[&discount=...] を構築します。

Related MCP server: UPS MCP Server

ローカル開発

Node 24以上をインストールし、依存関係をインストールします:

cd ~/Downloads/packrift-mcp-server
npm install

ローカルのシークレット — .dev.vars に作成済み(gitignored):

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 は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-envelopesboxes-mailerscorrugated-boxesbubble-wrap-foamcushioningecommerce-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)
A
license - permissive license
-
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
1dRelease cycle
5Releases (12mo)
Commit activity

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

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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