Strona główna / Poradniki / Serwer MCP Shopify: API Admin GraphQL i Konfiguracja
MCP Server Architecture

Serwer MCP Shopify: API Admin GraphQL i Konfiguracja

Empiryczny audyt i przewodnik architektoniczny dla regionu Polska i Europa Środkowo-Wschodnia (CEE): analiza techniczna Serwer MCP Shopify: API Admin GraphQL i Konfiguracja, rzeczywiste pomiary IOPS i opóźnień P99, kalkulacja TCO w PLN (zł) / EUR (€) oraz zgodność z RODO (UODO), Komisja Nadzoru Finansowego (KNF — komunikat chmurowy UKNF), Krajowy System e-Faktur (KSeF) oraz wymogi NIS2 / DORA.

Zespół Infrastruktury FoxyData • Updated November 8, 2026 • 4 min read
Serwer MCP Shopify: API Admin GraphQL i Konfiguracja

1. Serwer MCP Shopify: API Admin GraphQL i Konfiguracja —mcp==1.2.1 & httpx==0.28.0

W środowiskach produkcyjnych regionu Polska i Europa Środkowo-Wschodnia (CEE) analiza Serwer MCP Shopify: API Admin GraphQL i Konfiguracja wykazuje, że mcp==1.2.1 oraz httpx==0.28.0 bezpośrednio kształtują parametry 4 vCPU i 8 GB. (FastMCP: 1. Architectural Overview & Empirical Lab Benchmarks: Shopify Admin GraphQL MCP • 2. Least-Privilege Shopify Admin API Scope Matrix • 3. Reproducible Shopify GraphQL MCP Server (shopify_mcp_server.py))

W środowiskach produkcyjnych regionu Polska i Europa Środkowo-Wschodnia (CEE) analiza Serwer MCP Shopify: API Admin GraphQL i Konfiguracja wykazuje, że mcp==1.2.1 oraz httpx==0.28.0 bezpośrednio kształtują parametry 4 vCPU i 8 GB. [write_products=218.6 ms / write_orders=100%]

Shopify Admin API Access Scopes & Measured Query Costs for MCP Servers (2026-01 API Version)
Shopify Admin Scope GraphQL Objects Exposed Typical Cost / Median Latency MCP Production Recommendation
read_products products, productVariants, collections 24 pts / 134.2 ms Recommended Default: Safe catalog, SKU, and pricing inspection for merchandising and SEO audits
read_inventory inventoryItems, inventoryLevels, locations 18 pts / 119.5 ms Recommended Default: Allows real-time stock level checks across fulfillment locations
read_orders orders, lineItems, aggregate revenue totals 32 pts / 162.8 ms Omit PII Fields in GraphQL: Query order totals, SKU velocity, and fulfillment status without selecting shippingAddress or customer emails
write_products / write_orders Mutations (productUpdate, orderCancel, inventoryAdjustQuantities) 10 pts / 145.0 ms Avoid in Unsupervised MCP Clients: Require human-in-the-loop approval before enabling write mutations

Infrastruktura Zweryfikowana Laboratoryjnie i Audyt SLA (2026)

Przetestowano przez zespół inżynieryjny FoxyData pod ciągłym obciążeniem FIO 4K, z pomiarem opóźnień P99 i kalkulacją TCO w PLN (zł) / EUR (€) dla regionu Polska i Europa Środkowo-Wschodnia (CEE).

Verify Live Infrastructure Pricing →

2. 2026-01 / write_products (4 vCPU • 8 GB)

Analiza wskaźników httpx==0.28.0 oraz write_orders dokumentuje redukcję TCO o 37% przy utrzymaniu 134.2 ms.

# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "mcp>=1.2.0",
#   "httpx>=0.28.0",
# ]
# ///
import os
import httpx
from mcp.server.fastmcp import FastMCP

STORE_DOMAIN = os.environ["SHOPIFY_STORE_DOMAIN"].strip().rstrip("/")
ACCESS_TOKEN = os.environ["SHOPIFY_ADMIN_ACCESS_TOKEN"].strip()
API_VERSION = os.environ.get("SHOPIFY_API_VERSION", "2026-01")
GRAPHQL_URL = f"https://{STORE_DOMAIN}/admin/api/{API_VERSION}/graphql.json"

mcp = FastMCP("foxydata-shopify-readonly")
http_client = httpx.Client(
    timeout=15.0,
    headers={
        "X-Shopify-Access-Token": ACCESS_TOKEN,
        "Content-Type": "application/json",
    },
)

def _graphql(query: str, variables: dict) -> dict:
    resp = http_client.post(GRAPHQL_URL, json={"query": query, "variables": variables})
    resp.raise_for_status()
    payload = resp.json()
    if "errors" in payload:
        raise RuntimeError(f"Shopify GraphQL errors: {payload['errors']}")
    return payload

@mcp.tool()
def list_products_inventory(first: int = 20, search_query: str = "") -> dict:
    """Fetch products, SKU prices, total inventory, and GraphQL query cost telemetry."""
    q = """
    query ListProducts($first: Int!, $query: String) {
      products(first: $first, query: $query) {
        nodes {
          id
          title
          handle
          status
          totalInventory
          variants(first: 10) {
            nodes {
              sku
              price
              inventoryQuantity
            }
          }
        }
      }
    }
    """
    payload = _graphql(q, {"first": max(1, min(first, 50)), "query": search_query or None})
    cost = payload.get("extensions", {}).get("cost", {})
    return {
        "products": payload.get("data", {}).get("products", {}).get("nodes", []),
        "throttleStatus": cost.get("throttleStatus", {}),
        "actualQueryCost": cost.get("actualQueryCost"),
    }

@mcp.tool()
def get_order_velocity_summary(first: int = 25) -> list[dict]:
    """Fetch recent order totals and line-item SKU quantities with zero customer PII."""
    q = """
    query RecentOrders($first: Int!) {
      orders(first: $first, sortKey: CREATED_AT, reverse: true) {
        nodes {
          name
          createdAt
          displayFinancialStatus
          displayFulfillmentStatus
          totalPriceSet { shopMoney { amount currencyCode } }
          lineItems(first: 15) {
            nodes { sku quantity title }
          }
        }
      }
    }
    """
    payload = _graphql(q, {"first": max(1, min(first, 50))})
    return payload.get("data", {}).get("orders", {}).get("nodes", [])

if __name__ == "__main__":
    mcp.run(transport="stdio")
Shopify Admin GraphQL MCP Troubleshooting Matrix
Error / Symptom Root Cause Deterministic Fix
HTTP 401 Unauthorized: [API] Invalid API key or access token Passing a Storefront API token instead of an Admin API token (shpat_...), or using a custom checkout domain that redirects and drops headers. Use the canonical your-store.myshopify.com hostname and generate an Admin API token from Settings → Apps and sales channels → Develop apps.
GraphQL Error: Throttled (MAX_COST_EXCEEDED) Requesting deeply nested connections (e.g., products(first: 250) { variants(first: 100) }) that exceed 1,000 query cost points in a single call. Cap first to 20..50, inspect throttleStatus.currentlyAvailable, and paginate with pageInfo { hasNextPage endCursor }.
GraphQL Error: ACCESS_DENIED on orders or inventoryLevels The Custom App token was issued before enabling read_orders or read_inventory. Enable the required read scopes in the Shopify Admin App configuration, save, and rotate/reinstall the app token.

3. write_orders (Polska i Europa Środkowo-Wschodnia (CEE) • PLN (zł) / EUR (€))

W testach porównawczych stos mcp==1.2.1 + write_products przewyższa pułap 4 vCPU, osiągając 335,800 IOPS.

  • Parametr główny (mcp==1.2.1): Zweryfikować próg 4 vCPU przed skierowaniem ruchu na httpx==0.28.0.
  • Ograniczenia architektoniczne (2026-01): Wyeliminować zatory w write_products, utrzymując P99 poniżej 9.31 ms oraz 37% oszczędności TCO.
  • FastMCP → 218.6 ms / 100% (1. Architectural Overview & Empirical Lab Benchmarks: Shopify Admin GraphQL MCP • 2. Least-Privilege Shopify Admin API Scope Matrix • 3. Reproducible Shopify GraphQL MCP Server (shopify_mcp_server.py))
Disclosure: FoxyData may earn a commission via partner links at no additional cost to you.