CS

cesarjoquin/shopify-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

143 stars 400 forks 品質 84 トレンド 24MIT

Claude Desktop、Claude Code、または任意のMCP互換クライアント用Shopify MCPサーバーで、製品、顧客、注文、在庫、メタフィールドをShopify MCPのタイプ付きツールインターフェースを通じて管理します

概要

本番環境向けのModel Context Protocolサーバーで、Shopify管理GraphQL APIをAIアシスタントに公開します。Claude Desktop、Claude Code、またはMCP対応クライアントと接続し、タイプ付きツールインターフェースを通じて製品、顧客、注文、在庫、メタフィールドを管理できます。 このサーバーはMCPツールの呼び出しをShopify管理GraphQL操作に変換します。静的アクセストークンやOAuthクライアント認証(Devダッシュボードアプリ)、オプションのRedisバックアップトークン永続化、構造化JSONログ、そして優雅なシャットダウンをサポートしています。 すべてのリストツールはカーソルページ付け、ソート、Shopify検索の構文フィルタリングをサポートしています。 - 18以降 - カスタムアプリと管理者APIスコープ付き - (任意) OAuthトークンの再始動間での永続化 read_products、write_products、read_customers、write_customers、read_orders、write_orders(必要に応じてインベントリやメタフィールドのスコープも含む)。 設定場所:~/Library/Application Support/Claude/claude_desktop_config.json - %APPDATA%/Claude/claude_desktop_config。

概要(AI 翻訳)

本番環境向けのModel Context Protocolサーバーで、Shopify管理GraphQL APIをAIアシスタントに公開します。Claude Desktop、Claude Code、またはMCP対応クライアントと接続し、タイプ付きツールインターフェースを通じて製品、顧客、注文、在庫、メタフィールドを管理できます。


目次

  • 概要
  • 建築
  • 特徴
  • 要件
  • 設置
  • 構成
  • 開発
  • 試験
  • プロジェクト構成
  • トラブルシューティング
  • 貢献 -FAQ
  • ライセンス

概要

このサーバーはMCPツールの呼び出しをShopify管理GraphQL操作に変換します。静的アクセストークンやOAuthクライアント認証(Devダッシュボードアプリ)、オプションのRedisバックアップトークン永続化、構造化JSONログ、そして優雅なシャットダウンをサポートしています。


建築

ランタイムレイヤー

レイヤー 責任
src/index.ts プロセスエントリ、エラー境界
src/server/ ブートストラップ、MCP配線、シャットダウンフック
src/config/ 環境およびCLI構成
src/lib/ 認証、ログ、Redis、共有ユーティリティ
src/tools/ 40のMCPツール(製品、注文、顧客など)

リクエストワークフロー

認証フロー


特徴

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Shopify MCP Server

A production-oriented Model Context Protocol server that exposes the Shopify Admin GraphQL API to AI assistants. Connect Claude Desktop, Claude Code, or any MCP-compatible client to manage products, customers, orders, inventory, and metafields through a typed tool interface.


Table of Contents


Overview

This server translates MCP tool calls into Shopify Admin GraphQL operations. It supports static access tokens and OAuth client-credentials (Dev Dashboard apps), optional Redis-backed token persistence, structured JSON logging, and graceful shutdown.

flowchart LR
  Client[MCP Client] -->|stdio JSON-RPC| Server[MCP Server]
  Server --> Tools[Tool Registry]
  Tools --> GraphQL[Shopify Admin GraphQL]
  Server --> Auth[OAuth Token Manager]
  Auth --> Redis[(Redis Cache)]
  Auth --> GraphQL

Architecture

Runtime layers

Layer Responsibility
src/index.ts Process entry, error boundary
src/server/ Bootstrap, MCP wiring, shutdown hooks
src/config/ Environment and CLI configuration
src/lib/ Auth, logging, Redis, shared utilities
src/tools/ 40 MCP tools (products, orders, customers, …)

Request workflow

sequenceDiagram
  participant C as MCP Client
  participant M as McpServer
  participant T as Tool
  participant S as Shopify API

  C->>M: tools/call
  M->>T: execute(args)
  T->>T: Zod schema validation
  T->>S: GraphQL request
  S-->>T: Response
  T-->>M: Formatted JSON
  M-->>C: MCP content block

Authentication flow

sequenceDiagram
  participant S as Server
  participant R as Redis
  participant SH as Shopify OAuth

  S->>R: Check cached token
  alt Valid cache hit
    R-->>S: access_token
  else Cache miss
    S->>SH: client_credentials grant
    SH-->>S: access_token + expires_in
    S->>R: Store token with TTL
  end
  Note over S: Auto-refresh 5 min before expiry

Features

Category Capabilities
Products CRUD, variants, options, collections
Customers CRUD, merge, address management
Orders Query, cancel, fulfill, refund, draft orders
Metafields Read, write, delete on any resource
Inventory Set quantities, read levels and items
Discovery Shop info, locations, markets, price lists
Platform Redis token cache, structured logging, graceful shutdown, strict TypeScript

All list tools support cursor pagination, sorting, and Shopify search syntax filtering.


GitHub で README 全文を見る

インストール

npx shopify-mcp --clientId <CLIENT_ID> --clientSecret <CLIENT_SECRET> --domain <store>.myshopify.com
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "shopify": { "command": "npx", "args": [ "shopify-mcp", "--clientId", "<CLIENT_ID>", "--clientSecret", "<CLIENT_SECRET>", "--domain", "<store>.myshopify.com" ] } } }