@anton.andrusenko/shopify-mcp-admin 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 shopify-mcp-admin contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,454 @@
1
+ # shopify-mcp-admin
2
+
3
+ > 🛍️ **MCP Server for Shopify Admin API** — Enable AI agents to manage Shopify stores with 40 powerful tools
4
+
5
+ [![npm version](https://badge.fury.io/js/shopify-mcp-admin.svg)](https://badge.fury.io/js/shopify-mcp-admin)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
8
+
9
+ ---
10
+
11
+ ## ✨ Features
12
+
13
+ - 🛠️ **40 MCP Tools** — Complete store management: products, inventory, collections, pages, blogs, redirects
14
+ - 🤖 **AI-Optimized** — Tool descriptions and error messages designed for LLM comprehension
15
+ - 🔌 **Dual Transport** — STDIO for Claude Desktop, HTTP for ChatGPT/OpenAI
16
+ - ⚡ **Rate Limiting** — Automatic retry with exponential backoff for Shopify API limits
17
+ - 🔒 **Secure** — Tokens never exposed to AI agents; validated environment configuration
18
+
19
+ ---
20
+
21
+ ## 🚀 Quick Start
22
+
23
+ ### Prerequisites
24
+
25
+ 1. **Node.js 20+** — [Download](https://nodejs.org/)
26
+ 2. **Shopify Custom App** — Create one in your Shopify Admin:
27
+ - Go to **Settings → Apps and sales channels → Develop apps**
28
+ - Create a new app and configure Admin API scopes (see [Required Scopes](#required-shopify-scopes))
29
+ - Install the app and copy the Admin API access token
30
+
31
+ ### Installation
32
+
33
+ ```bash
34
+ # Run directly with npx (recommended)
35
+ npx shopify-mcp-admin
36
+
37
+ # Or install globally
38
+ npm install -g shopify-mcp-admin
39
+ ```
40
+
41
+ ### Configuration
42
+
43
+ Set your environment variables:
44
+
45
+ ```bash
46
+ export SHOPIFY_STORE_URL=your-store.myshopify.com
47
+ export SHOPIFY_ACCESS_TOKEN=shpat_xxxxx
48
+ ```
49
+
50
+ ### First Tool Invocation
51
+
52
+ Once connected to an AI agent, try:
53
+
54
+ > "List all products in my Shopify store"
55
+
56
+ The AI will use the `list-products` tool to fetch your catalog.
57
+
58
+ ---
59
+
60
+ ## ⚙️ Configuration Reference
61
+
62
+ | Variable | Required | Default | Description |
63
+ |----------|----------|---------|-------------|
64
+ | `SHOPIFY_STORE_URL` | ✅ Yes | — | Your Shopify store domain (e.g., `your-store.myshopify.com`) |
65
+ | `SHOPIFY_ACCESS_TOKEN` | ✅ Yes | — | Admin API access token from your Custom App |
66
+ | `SHOPIFY_API_VERSION` | No | `2025-10` | Shopify API version |
67
+ | `TRANSPORT` | No | `stdio` | Transport mode: `stdio` or `http` |
68
+ | `PORT` | No | `3000` | HTTP server port (when `TRANSPORT=http`) |
69
+ | `DEBUG` | No | — | Enable debug logging (`1` or `true`) |
70
+ | `LOG_LEVEL` | No | `info` | Log level: `debug`, `info`, `warn`, `error` |
71
+
72
+ ### Required Shopify Scopes
73
+
74
+ Configure these scopes when creating your Custom App:
75
+
76
+ | Scope | Purpose |
77
+ |-------|---------|
78
+ | `read_products`, `write_products` | Product management |
79
+ | `read_inventory`, `write_inventory` | Inventory management |
80
+ | `read_content`, `write_content` | Pages, blogs, articles |
81
+ | `read_online_store_navigation`, `write_online_store_navigation` | URL redirects |
82
+
83
+ 📖 **Setup Guide:** [Shopify Custom App Documentation](https://shopify.dev/docs/apps/tools/development-stores)
84
+
85
+ ---
86
+
87
+ ## 🖥️ Claude Desktop Integration
88
+
89
+ ### Step 1: Configure Claude Desktop
90
+
91
+ Edit your Claude Desktop configuration file:
92
+
93
+ - **macOS:** `~/.config/claude/claude_desktop_config.json`
94
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
95
+
96
+ ### Step 2: Add the MCP Server
97
+
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "shopify": {
102
+ "command": "npx",
103
+ "args": ["shopify-mcp-admin"],
104
+ "env": {
105
+ "SHOPIFY_STORE_URL": "your-store.myshopify.com",
106
+ "SHOPIFY_ACCESS_TOKEN": "shpat_xxxxx"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### Step 3: Restart Claude Desktop
114
+
115
+ Quit and reopen Claude Desktop. You should see "shopify" in the MCP servers list.
116
+
117
+ ### Common Issues
118
+
119
+ | Issue | Solution |
120
+ |-------|----------|
121
+ | Server not appearing | Check JSON syntax; ensure no trailing commas |
122
+ | "Command not found" | Ensure Node.js 20+ is installed and in PATH |
123
+ | Authentication errors | Verify `SHOPIFY_ACCESS_TOKEN` is correct |
124
+
125
+ ---
126
+
127
+ ## 🌐 OpenAI/ChatGPT Integration
128
+
129
+ For OpenAI function calling or ChatGPT plugins, use HTTP transport mode.
130
+
131
+ ### Step 1: Start the Server
132
+
133
+ ```bash
134
+ TRANSPORT=http \
135
+ PORT=3000 \
136
+ SHOPIFY_STORE_URL=your-store.myshopify.com \
137
+ SHOPIFY_ACCESS_TOKEN=shpat_xxxxx \
138
+ npx shopify-mcp-admin
139
+ ```
140
+
141
+ ### Step 2: Test the Connection
142
+
143
+ ```bash
144
+ # List available tools
145
+ curl -X POST http://localhost:3000/mcp \
146
+ -H "Content-Type: application/json" \
147
+ -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
148
+ ```
149
+
150
+ ### Step 3: Call a Tool
151
+
152
+ ```bash
153
+ # Example: List products
154
+ curl -X POST http://localhost:3000/mcp \
155
+ -H "Content-Type: application/json" \
156
+ -d '{
157
+ "jsonrpc": "2.0",
158
+ "method": "tools/call",
159
+ "params": {
160
+ "name": "list-products",
161
+ "arguments": { "first": 10 }
162
+ },
163
+ "id": 2
164
+ }'
165
+ ```
166
+
167
+ ### OpenAI Function Calling Format
168
+
169
+ Each tool can be converted to OpenAI function format:
170
+
171
+ ```json
172
+ {
173
+ "name": "list-products",
174
+ "description": "List products from the Shopify store with optional filtering",
175
+ "parameters": {
176
+ "type": "object",
177
+ "properties": {
178
+ "first": { "type": "number", "description": "Number of products to return" },
179
+ "query": { "type": "string", "description": "Search query" }
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ ---
186
+
187
+ ## 🛠️ Available Tools
188
+
189
+ shopify-mcp-admin provides **40 tools** organized into 7 categories:
190
+
191
+ <details>
192
+ <summary><strong>📦 Product Management (7 tools)</strong></summary>
193
+
194
+ | Tool | Description |
195
+ |------|-------------|
196
+ | `create-product` | Create a new product with title, description, variants, and images |
197
+ | `get-product` | Retrieve a product by ID with full details |
198
+ | `update-product` | Update product title, description, status, SEO fields |
199
+ | `delete-product` | Delete a product by ID |
200
+ | `list-products` | List products with pagination and search |
201
+ | `update-product-variant` | Update variant price, SKU, inventory policy |
202
+ | `add-product-image` | Add an image to a product from URL |
203
+
204
+ </details>
205
+
206
+ <details>
207
+ <summary><strong>🏷️ Metafields (3 tools)</strong></summary>
208
+
209
+ | Tool | Description |
210
+ |------|-------------|
211
+ | `get-product-metafields` | Get all metafields for a product |
212
+ | `set-product-metafields` | Set or update metafields on a product |
213
+ | `delete-product-metafields` | Delete specific metafields from a product |
214
+
215
+ </details>
216
+
217
+ <details>
218
+ <summary><strong>📁 Collection Management (7 tools)</strong></summary>
219
+
220
+ | Tool | Description |
221
+ |------|-------------|
222
+ | `create-collection` | Create a manual or smart collection |
223
+ | `get-collection` | Retrieve collection details and products |
224
+ | `update-collection` | Update collection title, description, SEO |
225
+ | `delete-collection` | Delete a collection by ID |
226
+ | `list-collections` | List all collections with pagination |
227
+ | `add-products-to-collection` | Add products to a manual collection |
228
+ | `remove-products-from-collection` | Remove products from a manual collection |
229
+
230
+ </details>
231
+
232
+ <details>
233
+ <summary><strong>🖼️ Enhanced Image Management (3 tools)</strong></summary>
234
+
235
+ | Tool | Description |
236
+ |------|-------------|
237
+ | `update-product-image` | Update image alt text for SEO |
238
+ | `delete-product-image` | Delete an image from a product |
239
+ | `reorder-product-images` | Reorder product images by position |
240
+
241
+ </details>
242
+
243
+ <details>
244
+ <summary><strong>🔀 URL Redirects (3 tools)</strong></summary>
245
+
246
+ | Tool | Description |
247
+ |------|-------------|
248
+ | `create-redirect` | Create a URL redirect (301/302) |
249
+ | `delete-redirect` | Delete a URL redirect |
250
+ | `list-redirects` | List all URL redirects |
251
+
252
+ </details>
253
+
254
+ <details>
255
+ <summary><strong>📄 Page Management (5 tools)</strong></summary>
256
+
257
+ | Tool | Description |
258
+ |------|-------------|
259
+ | `create-page` | Create a new page (About, Contact, etc.) |
260
+ | `get-page` | Retrieve a page by ID or handle |
261
+ | `update-page` | Update page title, content, SEO |
262
+ | `delete-page` | Delete a page by ID |
263
+ | `list-pages` | List all pages with pagination |
264
+
265
+ </details>
266
+
267
+ <details>
268
+ <summary><strong>📝 Blog & Article Management (8 tools)</strong></summary>
269
+
270
+ | Tool | Description |
271
+ |------|-------------|
272
+ | `create-blog` | Create a new blog |
273
+ | `update-blog` | Update blog title and settings |
274
+ | `delete-blog` | Delete a blog (and all articles) |
275
+ | `list-blogs` | List all blogs |
276
+ | `create-article` | Create a blog article |
277
+ | `update-article` | Update article title, content, SEO |
278
+ | `delete-article` | Delete an article |
279
+ | `list-articles` | List articles in a blog |
280
+
281
+ </details>
282
+
283
+ <details>
284
+ <summary><strong>📊 Inventory Management (4 tools)</strong></summary>
285
+
286
+ | Tool | Description |
287
+ |------|-------------|
288
+ | `get-inventory` | Get inventory levels for a product variant |
289
+ | `update-inventory` | Set or adjust inventory quantity |
290
+ | `list-low-inventory` | Find products with low stock |
291
+ | `get-bulk-inventory` | Get inventory for multiple variants/locations |
292
+
293
+ </details>
294
+
295
+ ---
296
+
297
+ ## 🔧 Troubleshooting
298
+
299
+ ### Common Errors
300
+
301
+ | Error | Cause | Solution |
302
+ |-------|-------|----------|
303
+ | `401 Unauthorized` | Invalid access token | Regenerate token in Shopify Admin |
304
+ | `403 Forbidden` | Missing API scopes | Add required scopes to Custom App |
305
+ | `429 Too Many Requests` | Rate limited | Wait; shopify-mcp-admin auto-retries |
306
+ | `ECONNREFUSED` | Server not running | Start server with `npx shopify-mcp-admin` |
307
+ | `Invalid store URL` | Wrong URL format | Use `store.myshopify.com` format |
308
+
309
+ ### Debug Mode
310
+
311
+ Enable verbose logging to diagnose issues:
312
+
313
+ ```bash
314
+ # Option 1: DEBUG flag
315
+ DEBUG=1 npx shopify-mcp-admin
316
+
317
+ # Option 2: LOG_LEVEL
318
+ LOG_LEVEL=debug npx shopify-mcp-admin
319
+ ```
320
+
321
+ ### FAQ
322
+
323
+ **Q: Can I connect to multiple stores?**
324
+ A: Run separate server instances with different credentials.
325
+
326
+ **Q: Does this work with development stores?**
327
+ A: Yes, development stores work with Custom Apps.
328
+
329
+ **Q: How do I test without affecting production?**
330
+ A: Use a [development store](https://shopify.dev/docs/apps/tools/development-stores) for testing.
331
+
332
+ **Q: Where can I report bugs?**
333
+ A: Open an issue on [GitHub Issues](https://github.com/AntonAndrusenko/shopify-mcp-admin/issues).
334
+
335
+ ---
336
+
337
+ ## 🔄 CI/CD Pipeline
338
+
339
+ This project uses GitHub Actions for continuous integration and automated releases.
340
+
341
+ ### Continuous Integration
342
+
343
+ Every push to `main` and every pull request triggers the CI workflow:
344
+
345
+ ```yaml
346
+ # Runs on Node.js 20.x and 22.x
347
+ npm ci # Install dependencies
348
+ npm run lint # Biome linting
349
+ npm run typecheck # TypeScript type checking
350
+ npm run test # Vitest unit tests
351
+ npm run build # Production build
352
+ ```
353
+
354
+ All checks must pass before merging pull requests.
355
+
356
+ ### Automated Releases
357
+
358
+ To publish a new version to npm:
359
+
360
+ ```bash
361
+ # 1. Update version (creates git tag automatically)
362
+ npm version patch # or minor, or major
363
+
364
+ # 2. Push commit and tag
365
+ git push origin main --follow-tags
366
+ ```
367
+
368
+ The release workflow automatically:
369
+ 1. Runs all CI checks
370
+ 2. Publishes to npm with [provenance](https://docs.npmjs.com/generating-provenance-statements)
371
+ 3. Tags the npm package to match the git tag
372
+
373
+ ### Repository Setup (for Maintainers)
374
+
375
+ #### Required Secrets
376
+
377
+ Configure these in **Settings → Secrets and variables → Actions**:
378
+
379
+ | Secret | Description |
380
+ |--------|-------------|
381
+ | `NPM_TOKEN` | npm automation token for publishing ([create one](https://docs.npmjs.com/creating-and-viewing-access-tokens)) |
382
+
383
+ #### Branch Protection (Recommended)
384
+
385
+ Enable these settings for the `main` branch in **Settings → Branches**:
386
+
387
+ - ✅ Require a pull request before merging
388
+ - ✅ Require status checks to pass before merging
389
+ - Select: `build (20.x)` and `build (22.x)`
390
+ - ✅ Require branches to be up to date before merging
391
+
392
+ ---
393
+
394
+ ## 🤝 Contributing
395
+
396
+ Contributions are welcome! Here's how to get started:
397
+
398
+ ### Development Setup
399
+
400
+ ```bash
401
+ # Clone the repository
402
+ git clone https://github.com/AntonAndrusenko/shopify-mcp-admin.git
403
+ cd shopify-mcp-admin
404
+
405
+ # Install dependencies
406
+ npm install
407
+
408
+ # Run in development mode
409
+ npm run dev
410
+ ```
411
+
412
+ ### Available Scripts
413
+
414
+ | Command | Description |
415
+ |---------|-------------|
416
+ | `npm run dev` | Start development server with hot reload |
417
+ | `npm run build` | Build for production |
418
+ | `npm run test` | Run unit tests |
419
+ | `npm run lint` | Run Biome linter |
420
+ | `npm run lint:fix` | Auto-fix linting issues |
421
+
422
+ ### Pull Request Guidelines
423
+
424
+ 1. Fork the repository
425
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
426
+ 3. Make your changes with tests
427
+ 4. Run `npm run lint && npm run test`
428
+ 5. Commit with conventional commits (`feat:`, `fix:`, `docs:`, etc.)
429
+ 6. Open a Pull Request
430
+
431
+ ### Code Style
432
+
433
+ This project uses [Biome](https://biomejs.dev/) for linting and formatting. Configuration is in `biome.json`.
434
+
435
+ ---
436
+
437
+ ## 📜 License
438
+
439
+ This project is licensed under the **MIT License** — see the [LICENSE](LICENSE) file for details.
440
+
441
+ ---
442
+
443
+ ## 🙏 Acknowledgments
444
+
445
+ - [Model Context Protocol](https://modelcontextprotocol.io/) by Anthropic
446
+ - [Shopify Admin API](https://shopify.dev/docs/api/admin)
447
+ - Built with TypeScript, Express, and Zod
448
+
449
+ ---
450
+
451
+ <p align="center">
452
+ <strong>Made with ❤️ for the AI-powered commerce era</strong>
453
+ </p>
454
+
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node