Shopify MCP

Shopify MCP

A read-only MCP server that lets AI assistants answer Shopify store operations questions via tools like get_shop, list_products, get_product, and list_orders.

Category
Visit Server

README

Shopify MCP

A focused, read-only Model Context Protocol server for Shopify. It lets an assistant answer store operations questions without giving the model a general GraphQL console.

The four tools are get_shop, list_products, get_product, and list_orders. Mutations are left out deliberately: an inventory or price write deserves a separate approval-oriented design.

Two ways to run it

  • Local: one store, environment credentials, and stdio transport.
  • Hosted: multiple Shopify installations, OAuth, encrypted tokens, bearer-protected Streamable HTTP, cursor pagination, retries, health checks, metrics, and uninstall cleanup.

Local setup

You need Python 3.11+ and a Shopify Admin API token with read_products, read_orders, or both.

python -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env

Run shopify-mcp after loading SHOPIFY_SHOP and SHOPIFY_ACCESS_TOKEN. An MCP client entry looks like this:

{
  "mcpServers": {
    "shopify": {
      "command": "/absolute/path/to/.venv/bin/shopify-mcp",
      "env": {
        "SHOPIFY_SHOP": "your-store.myshopify.com",
        "SHOPIFY_ACCESS_TOKEN": "shpat_replace_me",
        "SHOPIFY_API_VERSION": "2026-07"
      }
    }
  }
}

Hosted setup

The hosted service uses Shopify OAuth. Each installation gets a separate MCP bearer token; the Shopify Admin token is encrypted at rest and never reaches the MCP client.

Generate an encryption key:

python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'

Copy .env.example to .env and set BASE_URL, SHOPIFY_CLIENT_ID, SHOPIFY_CLIENT_SECRET, TOKEN_ENCRYPTION_KEY, and DATABASE_PATH. Keep secrets in your hosting platform's secret manager rather than committing .env.

In Shopify, configure:

Callback:  https://your-host/auth/callback
Webhook:   https://your-host/webhooks/app-uninstalled

Start the container:

docker compose up --build

Install a store by opening:

https://your-host/install?shop=your-store.myshopify.com

The callback displays the MCP URL (https://your-host/mcp) and bearer token once. Reinstalling a store rotates that credential. Remote requests use Authorization: Bearer smcp_....

The OpenAI Responses API accepts the token through the remote MCP tool's authorization field. A ChatGPT custom connector may require a full interactive OAuth authorization server depending on workspace policy; this service is currently an OAuth resource server with provisioned bearer credentials, not a general-purpose authorization server.

Design

Each tool owns a fixed GraphQL query. List calls are capped at 50 records and return page_info.endCursor for the next call. The response includes Shopify throttle status.

The client applies timeouts and retries network failures, HTTP 429 responses, and 5xx responses with exponential backoff and jitter. Hosted MCP uses stateless JSON Streamable HTTP for easy horizontal transport scaling.

OAuth state is random, expires after ten minutes, and is consumed once. Callback and webhook HMACs use constant-time comparison. Expiring offline access and refresh tokens are encrypted and rotated before expiry; a per-store lock prevents concurrent use of Shopify's single-use refresh token. MCP tokens are stored only as SHA-256 digests. Uninstall webhooks remove all credentials.

The service emits JSON request logs, Prometheus-text metrics at /metrics, liveness at /healthz, and database readiness at /readyz. Restrict /metrics at the proxy or private network.

Development

pip install -e '.[dev]'
ruff check .
pytest

Tests use mock HTTP transports and temporary encrypted databases; no Shopify store is required.

Production boundary

This is a deployable single-node production baseline, not a compliance certification. Before serving real merchants:

  • Put it behind HTTPS, a WAF, and request-size/rate limits.
  • Use a managed secret store and define encryption-key rotation procedures.
  • Replace SQLite before running multiple replicas.
  • Ship logs and metrics to an observability platform and configure alerts.
  • Register all Shopify-required compliance webhooks and complete protected-customer-data review.
  • Add an authorization server when a target MCP client cannot supply a bearer token.
  • Run dependency, container, and application security scans and commission a security review.

Product variants remain limited to the first 25. See DEPLOYMENT.md for the operations checklist.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured