@anton.andrusenko/shopify-mcp-admin 1.1.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -4
- package/package.json +61 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -14768
- package/dist/setup-wizard-PVLOC3DU.js +0 -697
package/README.md
CHANGED
|
@@ -115,10 +115,13 @@ Tokens are automatically refreshed every 24 hours.
|
|
|
115
115
|
|
|
116
116
|
| Variable | Required | Default | Description |
|
|
117
117
|
|----------|----------|---------|-------------|
|
|
118
|
-
| `
|
|
118
|
+
| `SERVER_MODE` | No | `local` | Server mode: `local` (single-tenant) or `remote` (multi-tenant) |
|
|
119
|
+
| `SHOPIFY_STORE_URL` | ✅ (local mode) | — | Your Shopify store domain (e.g., `your-store.myshopify.com`) |
|
|
119
120
|
| `SHOPIFY_ACCESS_TOKEN` | ⚡ See below | — | Admin API access token from your Custom App |
|
|
120
121
|
| `SHOPIFY_CLIENT_ID` | ⚡ See below | — | Client ID from Dev Dashboard app |
|
|
121
122
|
| `SHOPIFY_CLIENT_SECRET` | ⚡ See below | — | Client Secret from Dev Dashboard app |
|
|
123
|
+
| `DATABASE_URL` | ✅ (remote mode) | — | PostgreSQL connection URL for multi-tenant mode |
|
|
124
|
+
| `ENCRYPTION_KEY` | ✅ (remote mode) | — | 64-char hex key for credential encryption |
|
|
122
125
|
| `SHOPIFY_API_VERSION` | No | `2025-10` | Shopify API version |
|
|
123
126
|
| `TRANSPORT` | No | `stdio` | Transport mode: `stdio` or `http` |
|
|
124
127
|
| `PORT` | No | `3000` | HTTP server port (when `TRANSPORT=http`) |
|
|
@@ -126,8 +129,36 @@ Tokens are automatically refreshed every 24 hours.
|
|
|
126
129
|
| `LOG_LEVEL` | No | `info` | Log level: `debug`, `info`, `warn`, `error` |
|
|
127
130
|
| `SHOPIFY_MCP_LAZY_LOADING` | No | `false` | Enable modular lazy loading (set to `true` for on-demand module loading) |
|
|
128
131
|
| `SHOPIFY_MCP_ROLE` | No | — | Role preset for automatic module loading (see [Role Presets](#-role-presets)) |
|
|
132
|
+
| `ALLOWED_HOSTS` | ✅ (remote mode) | — | Comma-separated list of allowed hostnames (e.g., `shopify-mcp.com,api.shopify-mcp.com`) |
|
|
133
|
+
| `ALLOWED_ORIGINS` | ✅ (remote mode) | — | Comma-separated list of allowed CORS origins (e.g., `https://shopify-mcp.com`) |
|
|
134
|
+
| `METRICS_ENDPOINT_ENABLED` | No | `false` | Enable Prometheus metrics endpoint at `/metrics` |
|
|
135
|
+
| `ENABLE_HSTS` | No | `false` | Enable HTTP Strict Transport Security headers |
|
|
136
|
+
| `SHUTDOWN_DRAIN_SECONDS` | No | `30` | Graceful shutdown drain timeout in seconds (1-300) |
|
|
137
|
+
| `LOG_FORMAT` | No | `json` | Log format: `json` (production) or `pretty` (development) |
|
|
138
|
+
| `SENTRY_DSN` | No | — | Sentry error tracking DSN (recommended for production) |
|
|
129
139
|
|
|
130
|
-
|
|
140
|
+
### Server Modes
|
|
141
|
+
|
|
142
|
+
shopify-mcp-admin supports two operating modes:
|
|
143
|
+
|
|
144
|
+
| Mode | Description | Use Case |
|
|
145
|
+
|------|-------------|----------|
|
|
146
|
+
| **local** (default) | Single-tenant with env credentials | Claude Desktop, local AI agents, development |
|
|
147
|
+
| **remote** | Multi-tenant with database storage | SaaS platform, hosted service |
|
|
148
|
+
|
|
149
|
+
**Local Mode** (default):
|
|
150
|
+
- Credentials via `SHOPIFY_STORE_URL` + `SHOPIFY_ACCESS_TOKEN` (or OAuth)
|
|
151
|
+
- All 79 tools operate on a single store
|
|
152
|
+
- No database required
|
|
153
|
+
- Works with STDIO and HTTP transports
|
|
154
|
+
|
|
155
|
+
**Remote Mode**:
|
|
156
|
+
- Multi-tenant with per-tenant credentials stored in PostgreSQL
|
|
157
|
+
- Requires `DATABASE_URL` and `ENCRYPTION_KEY`
|
|
158
|
+
- HTTP transport only (STDIO not supported for multi-tenant)
|
|
159
|
+
- Web dashboard available at `/app`
|
|
160
|
+
|
|
161
|
+
**⚡ Authentication (local mode):** Provide EITHER `SHOPIFY_ACCESS_TOKEN` (legacy) OR both `SHOPIFY_CLIENT_ID` and `SHOPIFY_CLIENT_SECRET` (Dev Dashboard).
|
|
131
162
|
|
|
132
163
|
### Required Shopify Scopes
|
|
133
164
|
|
|
@@ -963,9 +994,9 @@ shopify-mcp-admin uses a modular architecture to optimize AI agent performance.
|
|
|
963
994
|
|
|
964
995
|
## 🔄 Upgrading from Previous Versions
|
|
965
996
|
|
|
966
|
-
### What's New in
|
|
997
|
+
### What's New in v2.0.0+: Modular Tool Loading
|
|
967
998
|
|
|
968
|
-
Starting with
|
|
999
|
+
Starting with v2.0.0, shopify-mcp-admin supports **modular lazy loading** to optimize AI agent performance. Research shows that presenting more than 30 tools to an AI agent can degrade performance by up to 85%.
|
|
969
1000
|
|
|
970
1001
|
**Default Behavior (All Tools Loaded):**
|
|
971
1002
|
- All 79 domain tools are loaded at startup for maximum compatibility
|
|
@@ -1203,6 +1234,44 @@ Enable these settings for the `main` branch in **Settings → Branches**:
|
|
|
1203
1234
|
|
|
1204
1235
|
---
|
|
1205
1236
|
|
|
1237
|
+
## 🎨 Tenant Dashboard (Remote Mode)
|
|
1238
|
+
|
|
1239
|
+
When running in remote mode (`SERVER_MODE=remote`), shopify-mcp-admin includes a web-based dashboard for tenant management. The dashboard provides a modern, responsive UI for:
|
|
1240
|
+
|
|
1241
|
+
- **Shop Management** — View and connect Shopify stores
|
|
1242
|
+
- **API Key Management** — Generate, copy, and revoke API keys
|
|
1243
|
+
- **Usage Statistics** — Monitor API calls and activity
|
|
1244
|
+
- **Account Settings** — Update profile and change password
|
|
1245
|
+
|
|
1246
|
+
### Accessing the Dashboard
|
|
1247
|
+
|
|
1248
|
+
1. Start the server in remote mode:
|
|
1249
|
+
```bash
|
|
1250
|
+
SERVER_MODE=remote npm start
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
2. Navigate to `http://localhost:3000/app` in your browser
|
|
1254
|
+
|
|
1255
|
+
3. Log in with your tenant credentials
|
|
1256
|
+
|
|
1257
|
+
### Dashboard Features
|
|
1258
|
+
|
|
1259
|
+
- ✨ **Modern UI** — Built with React, Vite, and Tailwind CSS
|
|
1260
|
+
- 📱 **Responsive Design** — Works on desktop, tablet, and mobile
|
|
1261
|
+
- ♿ **Accessible** — WCAG AA compliant with keyboard navigation
|
|
1262
|
+
- 🔐 **Secure** — Session-based authentication with HttpOnly cookies
|
|
1263
|
+
- 🎯 **Optimized** — <150KB gzipped bundle size
|
|
1264
|
+
|
|
1265
|
+
### Tech Stack
|
|
1266
|
+
|
|
1267
|
+
- **Frontend:** React 18 + Vite + TypeScript
|
|
1268
|
+
- **Styling:** Tailwind CSS + shadcn/ui components
|
|
1269
|
+
- **State:** React Query for server state management
|
|
1270
|
+
- **Forms:** React Hook Form + Zod validation
|
|
1271
|
+
- **Auth:** Session cookies with automatic expiry handling
|
|
1272
|
+
|
|
1273
|
+
---
|
|
1274
|
+
|
|
1206
1275
|
## 🤝 Contributing
|
|
1207
1276
|
|
|
1208
1277
|
Contributions are welcome! Here's how to get started:
|
|
@@ -1267,3 +1336,130 @@ This project is licensed under the **MIT License** — see the [LICENSE](LICENSE
|
|
|
1267
1336
|
<strong>Made with ❤️ for the AI-powered commerce era</strong>
|
|
1268
1337
|
</p>
|
|
1269
1338
|
|
|
1339
|
+
---
|
|
1340
|
+
|
|
1341
|
+
## 🚀 Deployment
|
|
1342
|
+
|
|
1343
|
+
shopify-mcp-admin supports multiple deployment options for different environments.
|
|
1344
|
+
|
|
1345
|
+
### Production Deployment
|
|
1346
|
+
|
|
1347
|
+
For production deployment on Railway with Cloudflare, Sentry, and uptime monitoring, see the comprehensive deployment guide:
|
|
1348
|
+
|
|
1349
|
+
📖 **[Production Deployment Guide](./docs/deployment.md)**
|
|
1350
|
+
|
|
1351
|
+
The guide includes:
|
|
1352
|
+
- **Railway Setup**: Step-by-step instructions for deploying to Railway
|
|
1353
|
+
- **Cloudflare DNS**: DNS configuration and SSL/TLS setup
|
|
1354
|
+
- **Database Setup**: Prisma migrations and backup strategy
|
|
1355
|
+
- **Staging Environment**: Separate staging deployment configuration
|
|
1356
|
+
- **Monitoring**: Sentry error tracking and uptime monitoring setup
|
|
1357
|
+
|
|
1358
|
+
### Production URLs
|
|
1359
|
+
|
|
1360
|
+
The production service is available at:
|
|
1361
|
+
|
|
1362
|
+
**Root Domain:**
|
|
1363
|
+
- **Dashboard:** `https://shopify-mcp.com/` → redirects to `/app`
|
|
1364
|
+
- **Dashboard UI:** `https://shopify-mcp.com/app`
|
|
1365
|
+
- **Health Check:** `https://shopify-mcp.com/health`
|
|
1366
|
+
- **Metrics:** `https://shopify-mcp.com/metrics`
|
|
1367
|
+
- **MCP Endpoint:** `https://shopify-mcp.com/mcp`
|
|
1368
|
+
|
|
1369
|
+
**API Subdomain:**
|
|
1370
|
+
- **Dashboard:** `https://api.shopify-mcp.com/app`
|
|
1371
|
+
- **Health Check:** `https://api.shopify-mcp.com/health`
|
|
1372
|
+
- **Metrics:** `https://api.shopify-mcp.com/metrics`
|
|
1373
|
+
- **MCP Endpoint:** `https://api.shopify-mcp.com/mcp`
|
|
1374
|
+
|
|
1375
|
+
**Available Endpoints:**
|
|
1376
|
+
|
|
1377
|
+
| Endpoint | Description | Authentication |
|
|
1378
|
+
|----------|-------------|----------------|
|
|
1379
|
+
| `/` | Root path - redirects to `/app` (dashboard) | None |
|
|
1380
|
+
| `/app` | Dashboard UI (React SPA) | Session cookie |
|
|
1381
|
+
| `/health` | Health check endpoint | None |
|
|
1382
|
+
| `/metrics` | Prometheus metrics | None |
|
|
1383
|
+
| `/mcp` | MCP protocol endpoint | API key or session |
|
|
1384
|
+
| `/api/tenants` | Tenant management API | Session cookie |
|
|
1385
|
+
| `/api/shops` | Shop connection API | Session cookie |
|
|
1386
|
+
| `/api/keys` | API key management | Session cookie |
|
|
1387
|
+
|
|
1388
|
+
**Note:** The root domain (`shopify-mcp.com`) redirects to the dashboard (`/app`) for a better user experience. All API endpoints are also available on the root domain.
|
|
1389
|
+
|
|
1390
|
+
### Deployment Options
|
|
1391
|
+
|
|
1392
|
+
#### Railway (Recommended for Quick Start)
|
|
1393
|
+
|
|
1394
|
+
Deploy to [Railway](https://railway.app) with the included `railway.json` configuration:
|
|
1395
|
+
|
|
1396
|
+
1. Connect your GitHub repository to Railway
|
|
1397
|
+
2. Add environment variables (DATABASE_URL, ENCRYPTION_KEY, etc.)
|
|
1398
|
+
3. Deploy — Railway auto-detects the Dockerfile
|
|
1399
|
+
|
|
1400
|
+
#### Kubernetes
|
|
1401
|
+
|
|
1402
|
+
For self-hosted or cloud Kubernetes clusters, see the [Kubernetes Deployment Guide](docs/kubernetes.md).
|
|
1403
|
+
|
|
1404
|
+
Quick start:
|
|
1405
|
+
```bash
|
|
1406
|
+
# Build and push image
|
|
1407
|
+
docker build -t yourregistry/shopify-mcp-admin:v2.0.0 .
|
|
1408
|
+
docker push yourregistry/shopify-mcp-admin:v2.0.0
|
|
1409
|
+
|
|
1410
|
+
# Configure and deploy
|
|
1411
|
+
cd k8s
|
|
1412
|
+
kustomize edit set image shopify-mcp-admin=yourregistry/shopify-mcp-admin:v2.0.0
|
|
1413
|
+
kubectl apply -k .
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
#### Docker (Local/Development)
|
|
1417
|
+
|
|
1418
|
+
```bash
|
|
1419
|
+
# Build image
|
|
1420
|
+
docker build -t shopify-mcp-admin .
|
|
1421
|
+
|
|
1422
|
+
# Run container
|
|
1423
|
+
docker run -p 3000:3000 \
|
|
1424
|
+
-e DATABASE_URL="postgresql://..." \
|
|
1425
|
+
-e ENCRYPTION_KEY="..." \
|
|
1426
|
+
shopify-mcp-admin
|
|
1427
|
+
```
|
|
1428
|
+
|
|
1429
|
+
**Image Size:** The production Docker image is optimized for minimal size (<150MB) with multi-stage Alpine Linux build.
|
|
1430
|
+
|
|
1431
|
+
### Environment Variables
|
|
1432
|
+
|
|
1433
|
+
For production environment variables, see:
|
|
1434
|
+
|
|
1435
|
+
📄 **[`.env.production.example`](./.env.production.example)**
|
|
1436
|
+
|
|
1437
|
+
This template includes all required and optional environment variables with descriptions, example values, and generation instructions.
|
|
1438
|
+
|
|
1439
|
+
### Quick Start: Local vs Production
|
|
1440
|
+
|
|
1441
|
+
| Mode | Use Case | Transport | Database | Credentials |
|
|
1442
|
+
|------|----------|-----------|----------|-------------|
|
|
1443
|
+
| **Local** | Development, Claude Desktop | STDIO or HTTP | None | Environment variables |
|
|
1444
|
+
| **Remote** | Production, SaaS platform | HTTP only | PostgreSQL | Database (encrypted) |
|
|
1445
|
+
|
|
1446
|
+
**Local Mode** (default):
|
|
1447
|
+
```bash
|
|
1448
|
+
export SHOPIFY_STORE_URL=your-store.myshopify.com
|
|
1449
|
+
export SHOPIFY_ACCESS_TOKEN=shpat_xxxxx
|
|
1450
|
+
npx @anton.andrusenko/shopify-mcp-admin
|
|
1451
|
+
```
|
|
1452
|
+
|
|
1453
|
+
**Remote Mode** (production):
|
|
1454
|
+
```bash
|
|
1455
|
+
export SERVER_MODE=remote
|
|
1456
|
+
export DATABASE_URL=postgresql://...
|
|
1457
|
+
export ENCRYPTION_KEY=<64-char-hex>
|
|
1458
|
+
export TRANSPORT=http
|
|
1459
|
+
# See .env.production.example for all variables
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
---
|
|
1463
|
+
|
|
1464
|
+
</p>
|
|
1465
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anton.andrusenko/shopify-mcp-admin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "MCP server for Shopify Admin API - enables AI agents to manage Shopify stores with 79 tools for products, inventory, collections, content, SEO, metafields, markets & translations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"scripts": {
|
|
13
13
|
"dev": "tsx src/index.ts",
|
|
14
|
+
"dev:dashboard": "vite --config src/dashboard/vite.config.ts",
|
|
14
15
|
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
16
|
+
"build:dashboard": "vite build --config src/dashboard/vite.config.ts",
|
|
17
|
+
"build:all": "npm run build && npm run build:dashboard",
|
|
15
18
|
"start": "node dist/index.js",
|
|
16
19
|
"lint": "biome check src/",
|
|
17
20
|
"lint:fix": "biome check --fix src/",
|
|
@@ -21,6 +24,7 @@
|
|
|
21
24
|
"test:watch": "vitest",
|
|
22
25
|
"test:coverage": "vitest run --coverage",
|
|
23
26
|
"test:integration": "vitest run tests/integration/*.test.ts --testTimeout=60000",
|
|
27
|
+
"test:e2e": "playwright test",
|
|
24
28
|
"inspect": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
25
29
|
"inspect:dev": "npx @modelcontextprotocol/inspector npx tsx src/index.ts",
|
|
26
30
|
"inspect:config": "npx @modelcontextprotocol/inspector --config mcp-inspector.json",
|
|
@@ -64,22 +68,78 @@
|
|
|
64
68
|
"LICENSE"
|
|
65
69
|
],
|
|
66
70
|
"dependencies": {
|
|
71
|
+
"@fontsource/geist-mono": "^5.2.7",
|
|
72
|
+
"@fontsource/geist-sans": "^5.2.5",
|
|
73
|
+
"@hookform/resolvers": "^5.2.2",
|
|
67
74
|
"@inquirer/prompts": "^7.5.1",
|
|
68
75
|
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
76
|
+
"@prisma/client": "^6.0.0",
|
|
77
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
78
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
79
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
80
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
81
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
82
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
83
|
+
"@radix-ui/react-hover-card": "^1.1.15",
|
|
84
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
85
|
+
"@radix-ui/react-progress": "^1.1.8",
|
|
86
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
87
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
88
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
89
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
90
|
+
"@radix-ui/react-tabs": "^1.1.0",
|
|
91
|
+
"@radix-ui/react-toast": "^1.2.15",
|
|
92
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
93
|
+
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
94
|
+
"@sentry/node": "^10.29.0",
|
|
69
95
|
"@shopify/shopify-api": "^11.14.1",
|
|
96
|
+
"@tanstack/react-query": "^5.90.11",
|
|
97
|
+
"bcrypt": "^5.1.1",
|
|
98
|
+
"class-variance-authority": "^0.7.1",
|
|
99
|
+
"clsx": "^2.1.1",
|
|
100
|
+
"cmdk": "^1.1.1",
|
|
101
|
+
"cookie-parser": "^1.4.7",
|
|
102
|
+
"cors": "^2.8.5",
|
|
70
103
|
"express": "^5.1.0",
|
|
104
|
+
"express-rate-limit": "^8.2.1",
|
|
105
|
+
"lucide-react": "^0.555.0",
|
|
106
|
+
"pino": "^9.14.0",
|
|
107
|
+
"prom-client": "^15.1.3",
|
|
108
|
+
"react": "^19.2.1",
|
|
109
|
+
"react-dom": "^19.2.1",
|
|
110
|
+
"react-hook-form": "^7.67.0",
|
|
111
|
+
"react-router-dom": "^7.10.0",
|
|
112
|
+
"recharts": "^3.5.1",
|
|
113
|
+
"sonner": "^2.0.7",
|
|
114
|
+
"tailwind-merge": "^3.4.0",
|
|
115
|
+
"tailwindcss-animate": "^1.0.7",
|
|
116
|
+
"vaul": "^1.1.2",
|
|
71
117
|
"zod": "^3.25.76"
|
|
72
118
|
},
|
|
73
119
|
"devDependencies": {
|
|
74
120
|
"@biomejs/biome": "^1.9.4",
|
|
121
|
+
"@playwright/test": "^1.57.0",
|
|
122
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
123
|
+
"@types/bcrypt": "^5.0.2",
|
|
124
|
+
"@types/cookie-parser": "^1.4.10",
|
|
125
|
+
"@types/cors": "^2.8.19",
|
|
75
126
|
"@types/express": "^5.0.5",
|
|
76
127
|
"@types/node": "^22.19.1",
|
|
128
|
+
"@types/react": "^19.2.7",
|
|
129
|
+
"@types/react-dom": "^19.2.3",
|
|
77
130
|
"@types/supertest": "^6.0.3",
|
|
131
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
78
132
|
"@vitest/coverage-v8": "^3.2.4",
|
|
133
|
+
"autoprefixer": "^10.4.22",
|
|
134
|
+
"pino-pretty": "^11.3.0",
|
|
135
|
+
"postcss": "^8.5.6",
|
|
136
|
+
"prisma": "^6.0.0",
|
|
79
137
|
"supertest": "^7.1.4",
|
|
138
|
+
"tailwindcss": "^4.1.17",
|
|
80
139
|
"tsup": "^8.5.1",
|
|
81
140
|
"tsx": "^4.20.6",
|
|
82
141
|
"typescript": "^5.9.3",
|
|
142
|
+
"vite": "^7.2.6",
|
|
83
143
|
"vitest": "^3.2.4"
|
|
84
144
|
}
|
|
85
145
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|