Shopify MCP Server

A Model Context Protocol (MCP) server for Shopify order management

README.md

Shopify MCP Server

A Model Context Protocol (MCP) server for Shopify order management using the official MCP Python SDK.

Features

  • MCP-Compliant: Follows official MCP specification
  • 🛠️ Two Tools: Create orders and check order status via Shopify Admin REST API
  • 🌐 Remote Access: SSE transport for cloud deployment
  • 🔒 Secure: Environment-based credential management

Available Tools

1. `create_order`

Create new Shopify orders with line items and customer information.

Parameters:

  • line_items (array, required): Product items to order
  • customer_email (string, optional): Customer email
  • financial_status (string, optional): Payment status (default: "pending")
  • test (boolean, optional): Create as test order (default: true)

2. `get_order_status`

Retrieve complete order details by order ID.

Parameters:

  • order_id (integer, required): Shopify order ID

Quick Start

Prerequisites

  • Python 3.10 or higher
  • Shopify Admin API access token
  • Shopify store URL

Local Setup

# Clone the repository
cd mcp-server

# Create and activate virtual environment (recommended)
python -m venv mcpserver
mcpserver\Scripts\activate  # Windows
# source mcpserver/bin/activate  # macOS/Linux

# Install dependencies
pip install -r requirements.txt

# Configure environment variables
# Create .env file with:
SHOPIFY_ADMIN_API_BASE_URL=https://your-store.myshopify.com/admin/api/2025-07
SHOPIFY_ACCESS_TOKEN=your_access_token_here
USE_DUMMY_RESPONSES=true  # Optional: returns mock data when API fails (for testing)

# Run the server
python shopify_mcp_server.py

Testing Mode (Dummy Responses)

For development and testing without valid Shopify credentials, enable dummy response mode:

# In .env file
USE_DUMMY_RESPONSES=true

When enabled:

  • ✅ API errors return realistic mock data instead of error messages
  • ✅ Test tools without valid Shopify store credentials
  • ✅ See what successful responses look like
  • ✅ All responses include "dummy_mode": true flag

Demo:

python demo_dummy_responses.py

Example dummy response:

{
  "success": true,
  "dummy_mode": true,
  "order_id": 9999999999,
  "order_number": 1001,
  "financial_status": "paid",
  "total_price": "79.97",
  "note": "This is a dummy response for testing purposes"
}

Disable for production:

USE_DUMMY_RESPONSES=false  # or remove the variable entirely

Usage with MCP Clients

Claude Desktop Integration

Add to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "shopify": {
      "command": "python",
      "args": ["C:\\path\\to\\mcp-server\\shopify_mcp_server.py"],
      "env": {
        "SHOPIFY_ADMIN_API_BASE_URL": "https://your-store.myshopify.com/admin/api/2025-07",
        "SHOPIFY_ACCESS_TOKEN": "your_access_token_here"
      }
    }
  }
}

Restart Claude Desktop, and you'll see the Shopify tools available.

MCP Inspector (Testing)

Test your server with the official MCP Inspector:

npx @modelcontextprotocol/inspector python shopify_mcp_server.py

This opens a web interface to test tool discovery and execution.

Remote Deployment

The server uses SSE (Server-Sent Events) transport for remote access, making it compatible with cloud platforms.

Railway Deployment

  1. Fork/Clone this repository

  2. Connect to Railway:

    • Go to Railway.app
    • Click "New Project" → "Deploy from GitHub repo"
    • Select this repository
  3. Set Environment Variables in Railway dashboard:

    SHOPIFY_ADMIN_API_BASE_URL=https://your-store.myshopify.com/admin/api/2025-07
    SHOPIFY_ACCESS_TOKEN=your_access_token_here
    
  4. Deploy: Railway auto-deploys from Procfile

Your MCP server will be available at: https://your-app.up.railway.app

Render Deployment

  1. Connect GitHub repo to Render
  2. Create new Web Service
  3. Set environment variables
  4. Set start command: python shopify_mcp_server.py

Other Platforms (Fly.io, Heroku, etc.)

The server works on any platform supporting Python web services. Use the start command:

python shopify_mcp_server.py

Transport Options

The server supports two transport modes (configured in code):

# SSE Transport (remote access, default)
mcp.run(transport="sse")

# STDIO Transport (local only, for Claude Desktop)
mcp.run(transport="stdio")

Current configuration: SSE (remote deployment)

Environment Variables

Variable Description Example
SHOPIFY_ADMIN_API_BASE_URL Shopify Admin API endpoint https://store.myshopify.com/admin/api/2025-07
SHOPIFY_ACCESS_TOKEN Admin API access token shpat_xxxxx
USE_DUMMY_RESPONSES Enable mock responses for testing (opt

Tools 2

create_orderCreate new Shopify orders with line items and customer information.
get_order_statusRetrieve complete order details by order ID.

Environment Variables

SHOPIFY_ADMIN_API_BASE_URLrequiredShopify Admin API endpoint
SHOPIFY_ACCESS_TOKENrequiredAdmin API access token
USE_DUMMY_RESPONSESEnable mock responses for testing

Try it

Create a new order for 2 units of product ID 12345 for customer test@example.com.
Check the status of Shopify order ID 9999999999.
Create a test order with a pending financial status.

Frequently Asked Questions

What are the key features of Shopify MCP Server?

MCP-compliant server for Shopify Admin REST API. Create new orders with line items and customer details. Retrieve detailed order status by ID. Supports SSE transport for remote cloud deployment. Includes dummy response mode for development and testing.

What can I use Shopify MCP Server for?

Automating order creation workflows directly from an AI assistant. Quickly querying order status without logging into the Shopify dashboard. Testing Shopify integration logic using mock data without live API credentials.

How do I install Shopify MCP Server?

Install Shopify MCP Server by running: pip install -r requirements.txt

What MCP clients work with Shopify MCP Server?

Shopify MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Shopify MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare