@anton.andrusenko/shopify-mcp-admin 1.0.1 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +53 -45
  2. package/dist/index.js +148 -51
  3. package/package.json +6 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @anton.andrusenko/shopify-mcp-admin
2
2
 
3
- > 🛍️ **MCP Server for Shopify Admin API** — Enable AI agents to manage Shopify stores with 81 powerful tools
3
+ > 🛍️ **MCP Server for Shopify Admin API** — Enable AI agents to manage Shopify stores with 79 powerful tools
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/@anton.andrusenko%2Fshopify-mcp-admin.svg)](https://www.npmjs.com/package/@anton.andrusenko/shopify-mcp-admin)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -11,8 +11,8 @@
11
11
 
12
12
  ## ✨ Features
13
13
 
14
- - 🛠️ **81 MCP Tools** — Complete store management: products, inventory, collections, pages, blogs, redirects, metafields, markets, locales & translations
15
- - 📦 **Modular Architecture** — 7 modules with lazy loading for optimal AI performance (see [Tool Modules](#-tool-modules))
14
+ - 🛠️ **79 MCP Tools** — Complete store management: products, inventory, collections, pages, blogs, redirects, metafields, markets, locales & translations
15
+ - 📦 **Modular Architecture** — 7 modules with optional lazy loading for optimal AI performance (see [Tool Modules](#-tool-modules))
16
16
  - 🤖 **AI-Optimized** — Tool descriptions and error messages designed for LLM comprehension
17
17
  - 🔌 **Dual Transport** — STDIO for Claude Desktop, HTTP for ChatGPT/OpenAI
18
18
  - ⚡ **Rate Limiting** — Automatic retry with exponential backoff for Shopify API limits
@@ -108,7 +108,7 @@ Tokens are automatically refreshed every 24 hours.
108
108
  | `PORT` | No | `3000` | HTTP server port (when `TRANSPORT=http`) |
109
109
  | `DEBUG` | No | — | Enable debug logging (`1` or `true`) |
110
110
  | `LOG_LEVEL` | No | `info` | Log level: `debug`, `info`, `warn`, `error` |
111
- | `SHOPIFY_MCP_LAZY_LOADING` | No | `true` | Enable modular lazy loading (set to `false` for all tools at startup) |
111
+ | `SHOPIFY_MCP_LAZY_LOADING` | No | `false` | Enable modular lazy loading (set to `true` for on-demand module loading) |
112
112
  | `SHOPIFY_MCP_ROLE` | No | — | Role preset for automatic module loading (see [Role Presets](#-role-presets)) |
113
113
 
114
114
  **⚡ Authentication:** Provide EITHER `SHOPIFY_ACCESS_TOKEN` (legacy) OR both `SHOPIFY_CLIENT_ID` and `SHOPIFY_CLIENT_SECRET` (Dev Dashboard).
@@ -264,7 +264,7 @@ Role presets automatically load appropriate tool modules at startup, optimizing
264
264
  | `content-manager` | core, content | 37 | Pages, blogs, and content marketing |
265
265
  | `seo-specialist` | core, collections, product-extensions, advanced-redirects | 38 | SEO optimization and URL management |
266
266
  | `international-manager` | core, store-context, international, collections | 46 | Multi-market and translation management |
267
- | `full-access` | All 7 modules | 81 | Full store administration |
267
+ | `full-access` | All 7 modules | 81 | Full store administration (includes meta-tools) |
268
268
 
269
269
  ### Using Role Presets
270
270
 
@@ -293,19 +293,21 @@ Or in Claude Desktop config:
293
293
  }
294
294
  ```
295
295
 
296
- ### Module Discovery
296
+ ### Module Discovery (Lazy Loading Mode)
297
297
 
298
- If no role is set, the server starts with core tools only (15 tools). AI agents can discover and load additional modules dynamically:
298
+ When lazy loading is enabled (`SHOPIFY_MCP_LAZY_LOADING=true`) and no role is set, the server starts with core tools only (15 tools). AI agents can discover and load additional modules dynamically:
299
299
 
300
300
  1. **Discover modules**: Use `list-modules` to see available modules
301
301
  2. **Load modules**: Use `load-module` with the module name to enable tools
302
302
  3. **Suggestions**: Tool responses include suggestions for relevant modules to load
303
303
 
304
+ > **Note:** When lazy loading is disabled (default), all 79 tools are available immediately and module discovery is not needed.
305
+
304
306
  ---
305
307
 
306
308
  ## 🛠️ Available Tools
307
309
 
308
- @anton.andrusenko/shopify-mcp-admin provides **81 tools** (79 domain tools + 2 meta-tools) organized into 16 categories:
310
+ @anton.andrusenko/shopify-mcp-admin provides **79 domain tools** organized into 16 categories (plus 2 meta-tools when lazy loading is enabled):
309
311
 
310
312
  <details>
311
313
  <summary><strong>🏪 Store Info (9 tools)</strong></summary>
@@ -556,13 +558,15 @@ If no role is set, the server starts with core tools only (15 tools). AI agents
556
558
 
557
559
  ## 📦 Tool Modules
558
560
 
559
- shopify-mcp-admin uses a modular architecture to optimize AI agent performance. Instead of loading all 81 tools at startup (which can degrade AI performance by up to 85%), tools are organized into 7 modules that can be loaded on demand.
561
+ shopify-mcp-admin uses a modular architecture to optimize AI agent performance. Instead of loading all 79 tools at startup (which can degrade AI performance by up to 85%), tools can be organized into 7 modules that load on demand when lazy loading is enabled.
560
562
 
561
- ### How Module Loading Works
563
+ ### How Module Loading Works (when `SHOPIFY_MCP_LAZY_LOADING=true`)
562
564
 
563
- 1. **At startup:** Only the **Core Module** (15 tools) is loaded by default
565
+ 1. **At startup:** Only the **Core Module** (15 tools including meta-tools) is loaded
564
566
  2. **Discovery:** AI agents use `list-modules` to see available modules
565
567
  3. **Loading:** AI agents use `load-module` to enable additional tools
568
+
569
+ > **Default behavior:** When lazy loading is disabled (default), all 79 domain tools are available immediately without module loading.
566
570
  4. **Suggestions:** Tool responses include hints about which modules to load next
567
571
 
568
572
  ### Module Dependency Diagram
@@ -570,9 +574,10 @@ shopify-mcp-admin uses a modular architecture to optimize AI agent performance.
570
574
  ```
571
575
  ┌─────────────────────────────────────────────────────────────────┐
572
576
  │ CORE MODULE │
573
- (Always Loaded - 15 tools)
574
- │ Products (7) • Inventory (4) • Store Info (2) • Meta (2)
577
+ (Always Loaded - 13 domain + 2 meta* tools)
578
+ │ Products (7) • Inventory (4) • Store Info (2) • Meta* (2)
575
579
  └─────────────────────────────────────────────────────────────────┘
580
+ *Meta tools only available when lazy loading is enabled
576
581
 
577
582
  ├──────────────────────────────────────────────────────────┐
578
583
  │ │
@@ -593,7 +598,7 @@ shopify-mcp-admin uses a modular architecture to optimize AI agent performance.
593
598
  └───────────────────┘ └───────────────────┘ └───────────────────┘
594
599
  ```
595
600
 
596
- ### Module: Core (15 tools) — Always Loaded
601
+ ### Module: Core (13-15 tools) — Always Loaded
597
602
 
598
603
  **Description:** Essential product and inventory management tools that form the foundation for most Shopify operations. Always loaded at startup.
599
604
 
@@ -606,7 +611,9 @@ shopify-mcp-admin uses a modular architecture to optimize AI agent performance.
606
611
  | Products (7) | `create-product`, `get-product`, `update-product`, `delete-product`, `list-products`, `update-product-variant`, `add-product-image` |
607
612
  | Inventory (4) | `get-inventory`, `update-inventory`, `list-low-inventory`, `get-bulk-inventory` |
608
613
  | Store Info (2) | `get-store-info`, `get-store-limits` |
609
- | Meta Tools (2) | `list-modules`, `load-module` |
614
+ | Meta Tools (2)* | `list-modules`, `load-module` |
615
+
616
+ > *Meta tools are only included when lazy loading is enabled (`SHOPIFY_MCP_LAZY_LOADING=true`). When disabled (default), core has 13 domain tools.
610
617
 
611
618
  **Use Case:** Basic product catalog management, inventory tracking, and store information queries.
612
619
 
@@ -750,31 +757,32 @@ shopify-mcp-admin uses a modular architecture to optimize AI agent performance.
750
757
 
751
758
  ### What's New in v0.8.0+: Modular Tool Loading
752
759
 
753
- Starting with v0.8.0, shopify-mcp-admin uses **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%.
760
+ Starting with v0.8.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%.
761
+
762
+ **Default Behavior (All Tools Loaded):**
763
+ - All 79 domain tools are loaded at startup for maximum compatibility
764
+ - Works with Claude Desktop and all MCP clients
765
+ - Server instructions describe all tools as immediately available
766
+ - Module meta-tools (`list-modules`, `load-module`) are NOT registered (not needed)
754
767
 
755
- **Default Behavior (Lazy Loading Enabled):**
756
- - Only 15 core tools are loaded at startup
768
+ **Optional: Enable Lazy Loading:**
769
+ - Only 15 core tools are loaded at startup (13 domain + 2 meta-tools)
757
770
  - Additional tools are loaded on-demand via `load-module`
758
771
  - AI agents discover available modules using `list-modules`
759
772
  - Token usage reduced by up to 81% compared to loading all tools
773
+ - Server instructions explain module discovery and loading
760
774
 
761
- ### Breaking Changes
775
+ > **Note:** Claude Desktop doesn't support dynamic tool list refresh, so lazy loading is disabled by default. Enable it for MCP clients that support `notifications/tools/list_changed`.
762
776
 
763
- | Previous Behavior | New Behavior (v0.8.0+) |
764
- |-------------------|------------------------|
765
- | All 79+ tools loaded at startup | 15 core tools loaded at startup |
766
- | No module concept | 7 modules with lazy loading |
767
- | N/A | `list-modules` and `load-module` meta-tools added |
777
+ ### Enabling Lazy Loading
768
778
 
769
- ### Legacy Mode: Restore Previous Behavior
770
-
771
- If you prefer all tools loaded at startup (not recommended for optimal AI performance):
779
+ For MCP clients that support dynamic tool refresh:
772
780
 
773
781
  ```bash
774
782
  # Option 1: Environment variable
775
- export SHOPIFY_MCP_LAZY_LOADING=false
783
+ export SHOPIFY_MCP_LAZY_LOADING=true
776
784
 
777
- # Option 2: In Claude Desktop config
785
+ # Option 2: In MCP client config
778
786
  {
779
787
  "mcpServers": {
780
788
  "shopify": {
@@ -783,56 +791,56 @@ export SHOPIFY_MCP_LAZY_LOADING=false
783
791
  "env": {
784
792
  "SHOPIFY_STORE_URL": "your-store.myshopify.com",
785
793
  "SHOPIFY_ACCESS_TOKEN": "shpat_xxxxx",
786
- "SHOPIFY_MCP_LAZY_LOADING": "false"
794
+ "SHOPIFY_MCP_LAZY_LOADING": "true"
787
795
  }
788
796
  }
789
797
  }
790
798
  }
791
799
  ```
792
800
 
793
- ### Migration Steps
801
+ ### Configuration Options
794
802
 
795
- 1. **Review your use case** — Do you need all 81 tools? Most workflows only need a subset.
803
+ 1. **Default (all tools)** — All 79 domain tools available immediately. Best for Claude Desktop and MCP clients without dynamic tool refresh.
796
804
 
797
- 2. **Choose a role preset** (recommended) Set `SHOPIFY_MCP_ROLE` for pre-configured modules:
805
+ 2. **Role Preset** — Pre-configured module sets for specific workflows:
798
806
  ```bash
799
807
  export SHOPIFY_MCP_ROLE=product-manager
800
808
  ```
801
809
 
802
- 3. **Or use on-demand loading** — Let AI agents discover and load modules as needed:
810
+ 3. **Lazy Loading** — Enable for MCP clients that support `notifications/tools/list_changed`:
811
+ ```bash
812
+ export SHOPIFY_MCP_LAZY_LOADING=true
813
+ ```
803
814
  - AI uses `list-modules` to see available modules
804
815
  - AI uses `load-module` with module name to enable tools
805
816
  - Tool responses suggest relevant modules automatically
806
817
 
807
- 4. **Or disable lazy loading** — Set `SHOPIFY_MCP_LAZY_LOADING=false` for legacy behavior
808
-
809
818
  ### When to Use Each Mode
810
819
 
811
820
  | Mode | Tools | Best For |
812
821
  |------|-------|----------|
813
- | **Lazy Loading (default)** | 15 at startup | New projects, optimal AI performance |
822
+ | **Default (all tools)** | 79 | Claude Desktop, maximum compatibility |
814
823
  | **Role Preset** | 15-81 based on role | Specific workflows (e.g., content manager) |
815
- | **Legacy Mode** | All 81 | Backward compatibility, full store admin |
824
+ | **Lazy Loading** | 15 at startup | MCP clients with dynamic tool refresh |
816
825
 
817
826
  ### Performance Comparison
818
827
 
819
828
  | Mode | Tools at Startup | Est. Token Usage | AI Performance |
820
829
  |------|------------------|------------------|----------------|
821
- | Lazy Loading (default) | 15 | ~4,500 | ⭐⭐⭐ Optimal |
830
+ | Lazy Loading | 15 | ~4,500 | ⭐⭐⭐ Optimal |
822
831
  | inventory-manager | 15 | ~4,500 | ⭐⭐⭐ Optimal |
823
832
  | content-manager | 37 | ~11,100 | ⭐⭐ Good |
824
833
  | product-manager | 41 | ~12,300 | ⭐⭐ Good |
825
834
  | international-manager | 46 | ~13,800 | ⭐⭐ Good |
826
- | full-access | 81 | ~24,000 | ⭐ May degrade |
827
- | Legacy Mode | 81 | ~24,000 | ⭐ May degrade |
835
+ | full-access / Default | 79-81 | ~24,000 | ⭐ May degrade |
828
836
 
829
837
  ### Troubleshooting Module Loading
830
838
 
831
839
  | Issue | Solution |
832
840
  |-------|----------|
833
- | Tool not found after upgrade | Load the appropriate module: `load-module(module: "collections")` |
841
+ | Tool not found with lazy loading | Load the appropriate module: `load-module(module: "collections")` |
834
842
  | "Module not found" error | Use `list-modules` to see valid module names |
835
- | Want all tools at startup | Set `SHOPIFY_MCP_LAZY_LOADING=false` |
843
+ | Want modular lazy loading | Set `SHOPIFY_MCP_LAZY_LOADING=true` (requires MCP client that supports tool list refresh) |
836
844
  | AI agent loading too many modules | Use a role preset instead of on-demand loading |
837
845
 
838
846
  ---
@@ -881,8 +889,8 @@ npm run inspect:config
881
889
 
882
890
  MCP Inspector opens a web UI at `http://localhost:6274` where you can:
883
891
 
884
- - 📋 Browse registered tools with schemas (15 core tools by default, up to 81 with modules)
885
- - 📦 Test module loading via `list-modules` and `load-module`
892
+ - 📋 Browse registered tools with schemas (79 tools by default, or 15 core tools with lazy loading)
893
+ - 📦 Test module loading via `list-modules` and `load-module` (when lazy loading is enabled)
886
894
  - 📊 Access 9 MCP resources for store context
887
895
  - ▶️ Execute tools interactively and view results
888
896
  - 🔍 Inspect JSON-RPC protocol messages
package/dist/index.js CHANGED
@@ -27,9 +27,11 @@ var configSchema = z.object({
27
27
  // Default: 5 minutes (300000ms) - configurable for performance tuning
28
28
  STORE_INFO_CACHE_TTL_MS: z.string().optional().default("300000").transform(Number).describe("Cache TTL for store info in milliseconds (default: 5 minutes)"),
29
29
  // Lazy loading configuration (Epic 12)
30
- // Default: true - enables module-based lazy loading for optimal AI performance
31
- // Set to 'false' or '0' to load all tools at startup (legacy mode)
32
- SHOPIFY_MCP_LAZY_LOADING: z.string().optional().default("true").transform((val) => val === "true" || val === "1").describe("Enable lazy loading of tools via modules (default: true)"),
30
+ // Default: false - loads all tools at startup for maximum compatibility
31
+ // Note: Claude Desktop doesn't support dynamic tool refresh via notifications,
32
+ // so lazy loading is disabled by default. Set to 'true' for clients that
33
+ // properly handle notifications/tools/list_changed.
34
+ SHOPIFY_MCP_LAZY_LOADING: z.string().optional().default("false").transform((val) => val === "true" || val === "1").describe("Enable lazy loading of tools via modules (default: false)"),
33
35
  // Role preset configuration (Story 12.3: Progressive Loading)
34
36
  // Automatically loads appropriate modules at startup based on role
35
37
  // Valid roles: inventory-manager, product-manager, content-manager,
@@ -1324,38 +1326,7 @@ async function getStoreInfo() {
1324
1326
  var require2 = createRequire(import.meta.url);
1325
1327
  var packageJson = require2("../package.json");
1326
1328
  var SERVER_NAME = "shopify-mcp-admin";
1327
- var SERVER_INSTRUCTIONS = `This MCP server provides access to a Shopify store's Admin API.
1328
-
1329
- ## TOOL MODULES (Modular Architecture)
1330
-
1331
- Tools are organized into modules for optimal AI performance. Start with core tools and load additional modules as needed.
1332
-
1333
- **Discovery & Loading:**
1334
- - Use "list-modules" to see all available modules and their loading status
1335
- - Use "load-module" with module name to enable additional tools
1336
- - Tool responses may include suggestions for relevant modules to load
1337
-
1338
- **Available Modules:**
1339
- | Module | Description | Tools |
1340
- |--------|-------------|-------|
1341
- | core | Products, inventory, store info (always loaded) | 15 |
1342
- | store-context | Extended store configuration (features, currencies, shipping) | 7 |
1343
- | collections | Collection management and metafields | 10 |
1344
- | product-extensions | Product metafields, images, and URL redirects | 9 |
1345
- | content | Pages, blogs, and articles management | 22 |
1346
- | international | Markets, web presence, and translations | 14 |
1347
- | advanced-redirects | Bulk redirect operations | 4 |
1348
-
1349
- **Role Presets (SHOPIFY_MCP_ROLE):**
1350
- Pre-configured module sets for common workflows:
1351
- - inventory-manager: Core only (15 tools) - stock management
1352
- - product-manager: Core + store-context + collections + product-extensions (41 tools)
1353
- - content-manager: Core + content (37 tools) - pages and blogs
1354
- - seo-specialist: Core + collections + product-extensions + advanced-redirects (38 tools)
1355
- - international-manager: Core + store-context + international + collections (46 tools)
1356
- - full-access: All modules (81 tools) - full store administration
1357
-
1358
- ## KEY CONCEPTS
1329
+ var COMMON_INSTRUCTIONS = `## KEY CONCEPTS
1359
1330
 
1360
1331
  - **Products & Variants**: Products contain variants; each variant has its own price, SKU, and inventory
1361
1332
  - **Multi-location Inventory**: Inventory is tracked per variant AND per location
@@ -1393,12 +1364,82 @@ Pre-configured module sets for common workflows:
1393
1364
  ## WORKFLOW HINTS
1394
1365
 
1395
1366
  - Tool descriptions include **Prerequisites:** and **Follow-ups:** for multi-step operations
1396
- - Check tool category and relationships for semantic grouping
1367
+ - Check tool category and relationships for semantic grouping`;
1368
+ var LAZY_LOADING_INSTRUCTIONS = `This MCP server provides access to a Shopify store's Admin API.
1369
+
1370
+ ## TOOL MODULES (Modular Architecture)
1371
+
1372
+ Tools are organized into modules for optimal AI performance. Start with core tools and load additional modules as needed.
1373
+
1374
+ **Discovery & Loading:**
1375
+ - Use "list-modules" to see all available modules and their loading status
1376
+ - Use "load-module" with module name to enable additional tools
1377
+ - Tool responses may include suggestions for relevant modules to load
1378
+
1379
+ **Available Modules:**
1380
+ | Module | Description | Tools |
1381
+ |--------|-------------|-------|
1382
+ | core | Products, inventory, store info (always loaded) | 15 |
1383
+ | store-context | Extended store configuration (features, currencies, shipping) | 7 |
1384
+ | collections | Collection management and metafields | 10 |
1385
+ | product-extensions | Product metafields, images, and URL redirects | 9 |
1386
+ | content | Pages, blogs, and articles management | 22 |
1387
+ | international | Markets, web presence, and translations | 14 |
1388
+ | advanced-redirects | Bulk redirect operations | 4 |
1389
+
1390
+ **Role Presets (SHOPIFY_MCP_ROLE):**
1391
+ Pre-configured module sets for common workflows:
1392
+ - inventory-manager: Core only (15 tools) - stock management
1393
+ - product-manager: Core + store-context + collections + product-extensions (41 tools)
1394
+ - content-manager: Core + content (37 tools) - pages and blogs
1395
+ - seo-specialist: Core + collections + product-extensions + advanced-redirects (38 tools)
1396
+ - international-manager: Core + store-context + international + collections (46 tools)
1397
+ - full-access: All modules (81 tools) - full store administration
1398
+
1399
+ ${COMMON_INSTRUCTIONS}
1397
1400
  - After successful operations, note any module suggestions in the response`;
1401
+ var FULL_ACCESS_INSTRUCTIONS = `This MCP server provides access to a Shopify store's Admin API.
1402
+
1403
+ ## AVAILABLE TOOLS
1404
+
1405
+ All tools are available immediately. This server provides comprehensive Shopify Admin API coverage:
1406
+
1407
+ **Core Operations:**
1408
+ - Products: list, get, create, update, delete products and variants
1409
+ - Inventory: multi-location stock management, bulk queries, low inventory alerts
1410
+ - Store Info: basic info, limits, features, currencies, shipping, taxes, policies
1411
+
1412
+ **Content Management:**
1413
+ - Pages: create, update, delete store pages
1414
+ - Blogs & Articles: manage blog content with SEO optimization
1415
+
1416
+ **Collections:**
1417
+ - Create, update, delete collections
1418
+ - Manage product-collection relationships
1419
+ - Collection metafields for custom data
1420
+
1421
+ **SEO & Redirects:**
1422
+ - URL redirects for SEO preservation
1423
+ - Bulk redirect operations for migrations
1424
+ - Product metafields for SEO data
1425
+
1426
+ **International:**
1427
+ - Markets: manage selling regions
1428
+ - Translations: localize product content
1429
+ - Web presence configuration
1430
+
1431
+ ${COMMON_INSTRUCTIONS}`;
1432
+ function getServerInstructions(config) {
1433
+ if (config && isLazyLoadingEnabled(config)) {
1434
+ return LAZY_LOADING_INSTRUCTIONS;
1435
+ }
1436
+ return FULL_ACCESS_INSTRUCTIONS;
1437
+ }
1398
1438
  function getServerVersion() {
1399
1439
  return packageJson.version;
1400
1440
  }
1401
- function createServer() {
1441
+ function createServer(config) {
1442
+ const instructions = getServerInstructions(config);
1402
1443
  const server = new McpServer(
1403
1444
  // Server info (sent to clients in initialize response)
1404
1445
  {
@@ -1415,8 +1456,8 @@ function createServer() {
1415
1456
  logging: {}
1416
1457
  // Enable logging capability (AC-9.5.1.2)
1417
1458
  },
1418
- instructions: SERVER_INSTRUCTIONS,
1419
- // Provide Shopify context to AI agents (AC-9.5.1.1)
1459
+ instructions,
1460
+ // Provide mode-aware Shopify context to AI agents (AC-9.5.1.1)
1420
1461
  // Epic 12: Notification debouncing for module loading (AC-12.1.6)
1421
1462
  // When multiple tools are enabled in rapid succession (e.g., loading a module),
1422
1463
  // coalesce into a single notifications/tools/list_changed notification
@@ -3199,20 +3240,42 @@ function getRegisteredTools() {
3199
3240
  annotations: tool.annotations
3200
3241
  }));
3201
3242
  }
3243
+ function getAllRegisteredToolNames() {
3244
+ return Array.from(registeredTools.keys());
3245
+ }
3202
3246
  function getToolByName(name) {
3203
3247
  return registeredTools.get(name);
3204
3248
  }
3205
3249
  function getToolNames() {
3206
3250
  return Array.from(registeredTools.keys());
3207
3251
  }
3252
+ var toolListChangedCallback = null;
3253
+ function setToolListChangedCallback(callback) {
3254
+ toolListChangedCallback = callback;
3255
+ log.debug("Tool list changed callback registered");
3256
+ }
3257
+ function notifyToolListChanged() {
3258
+ if (toolListChangedCallback) {
3259
+ log.info("\u{1F514} SENDING tools/list_changed notification to client");
3260
+ toolListChangedCallback();
3261
+ } else {
3262
+ log.warn("\u26A0\uFE0F notifyToolListChanged called but no callback registered!");
3263
+ }
3264
+ }
3208
3265
  function enableTool(name) {
3209
3266
  const tool = registeredTools.get(name);
3210
3267
  if (!tool) {
3211
3268
  log.debug(`Cannot enable tool: ${name} not found`);
3212
3269
  return false;
3213
3270
  }
3271
+ const previousState = toolEnabledState.get(name);
3272
+ const wasEnabled = previousState ?? true;
3214
3273
  toolEnabledState.set(name, true);
3215
- log.debug(`Tool enabled: ${name}`);
3274
+ log.debug(`Tool enabled: ${name} (was: ${previousState}, wasEnabled: ${wasEnabled})`);
3275
+ if (!wasEnabled) {
3276
+ log.info(`\u{1F4E2} Tool ${name} state changed from disabled to enabled, triggering notification`);
3277
+ notifyToolListChanged();
3278
+ }
3216
3279
  return true;
3217
3280
  }
3218
3281
  function disableTool(name) {
@@ -3221,8 +3284,12 @@ function disableTool(name) {
3221
3284
  log.debug(`Cannot disable tool: ${name} not found`);
3222
3285
  return false;
3223
3286
  }
3287
+ const wasEnabled = toolEnabledState.get(name) ?? true;
3224
3288
  toolEnabledState.set(name, false);
3225
3289
  log.debug(`Tool disabled: ${name}`);
3290
+ if (wasEnabled) {
3291
+ notifyToolListChanged();
3292
+ }
3226
3293
  return true;
3227
3294
  }
3228
3295
  function isToolEnabled(name) {
@@ -14185,6 +14252,10 @@ function getSuggestionsForTool(toolName) {
14185
14252
 
14186
14253
  // src/tools/index.ts
14187
14254
  function setupToolHandlers(server) {
14255
+ setToolListChangedCallback(() => {
14256
+ server.sendToolListChanged();
14257
+ log.debug("Sent tools/list_changed notification to clients");
14258
+ });
14188
14259
  server.server.setRequestHandler(ListToolsRequestSchema, async () => {
14189
14260
  const tools = getRegisteredTools();
14190
14261
  log.debug(`tools/list returning ${tools.length} tools`);
@@ -14208,16 +14279,35 @@ function setupToolHandlers(server) {
14208
14279
  }
14209
14280
  const tool = getToolByName(name);
14210
14281
  if (!tool) {
14211
- const availableTools = getRegisteredTools();
14212
- const toolList = availableTools.length > 0 ? `Available tools: ${availableTools.map((t) => t.name).join(", ")}` : "No tools are currently registered.";
14213
- log.warn(`Tool not found: ${name}${name !== rawName ? ` (received as "${rawName}")` : ""}`);
14282
+ const allTools = getAllRegisteredToolNames();
14283
+ const enabledTools = getRegisteredTools();
14284
+ const totalRegistered = allTools.length;
14285
+ const totalEnabled = enabledTools.length;
14286
+ const similarTools = allTools.filter(
14287
+ (t) => t.toLowerCase().includes(name.toLowerCase()) || name.toLowerCase().includes(t.toLowerCase())
14288
+ );
14289
+ let diagnosticInfo = `
14290
+
14291
+ Diagnostics:
14292
+ - Total tools registered: ${totalRegistered}
14293
+ - Tools currently enabled: ${totalEnabled}`;
14294
+ if (similarTools.length > 0) {
14295
+ diagnosticInfo += `
14296
+ - Similar tool names found: ${similarTools.join(", ")}`;
14297
+ }
14298
+ const toolList = enabledTools.length > 0 ? `
14299
+
14300
+ Enabled tools: ${enabledTools.map((t) => t.name).join(", ")}` : "\n\nNo tools are currently enabled. Try restarting your MCP client.";
14301
+ log.warn(
14302
+ `Tool not found: ${name}${name !== rawName ? ` (received as "${rawName}")` : ""}. Registered: ${totalRegistered}, Enabled: ${totalEnabled}`
14303
+ );
14214
14304
  return {
14215
14305
  content: [
14216
14306
  {
14217
14307
  type: "text",
14218
- text: `Error: Tool "${name}" not found${name !== rawName ? ` (received as "${rawName}")` : ""}.
14308
+ text: `Error: Tool "${name}" not found${name !== rawName ? ` (received as "${rawName}")` : ""}.${diagnosticInfo}
14219
14309
 
14220
- Suggestion: Use tools/list to see available tools. ${toolList}`
14310
+ Suggestion: Use tools/list to refresh available tools. If this tool should exist, try restarting your MCP client (Claude Desktop).${toolList}`
14221
14311
  }
14222
14312
  ],
14223
14313
  isError: true
@@ -14358,11 +14448,14 @@ function registerAllTools(server) {
14358
14448
  registerGetStoreTaxesTool();
14359
14449
  registerGetStorePoliciesTool();
14360
14450
  registerGetStoreAlertsTool();
14361
- registerListModulesTool();
14362
- registerLoadModuleTool();
14363
- const totalToolCount = getToolNames().length;
14364
14451
  const config = getConfig();
14365
- if (isLazyLoadingEnabled(config)) {
14452
+ const lazyLoadingEnabled = isLazyLoadingEnabled(config);
14453
+ if (lazyLoadingEnabled) {
14454
+ registerListModulesTool();
14455
+ registerLoadModuleTool();
14456
+ }
14457
+ const totalToolCount = getToolNames().length;
14458
+ if (lazyLoadingEnabled) {
14366
14459
  applyLazyLoading();
14367
14460
  const roleResult = applyRolePreset(config);
14368
14461
  const enabledCount = getRegisteredTools().length;
@@ -14375,8 +14468,12 @@ function registerAllTools(server) {
14375
14468
  `Lazy loading enabled: ${enabledCount} core tools active, ${totalToolCount - enabledCount} tools available via modules`
14376
14469
  );
14377
14470
  }
14471
+ log.debug(
14472
+ `Enabled tools: ${getRegisteredTools().map((t) => t.name).join(", ")}`
14473
+ );
14378
14474
  } else {
14379
- log.info(`Lazy loading disabled (legacy mode): ${totalToolCount} tools registered`);
14475
+ log.info(`Lazy loading disabled: ${totalToolCount} tools registered (all tools available)`);
14476
+ log.debug(`All tools: ${getToolNames().join(", ")}`);
14380
14477
  }
14381
14478
  }
14382
14479
  function applyLazyLoading() {
@@ -14625,7 +14722,7 @@ if (args.includes("--version") || args.includes("-v")) {
14625
14722
  async function main() {
14626
14723
  try {
14627
14724
  const config = getConfig();
14628
- const server = createServer();
14725
+ const server = createServer(config);
14629
14726
  registerResources(server);
14630
14727
  registerAllTools(server);
14631
14728
  const transportType = config.TRANSPORT;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anton.andrusenko/shopify-mcp-admin",
3
- "version": "1.0.1",
4
- "description": "MCP server for Shopify Admin API - enables AI agents to manage Shopify stores with 71 tools for products, inventory, collections, content, SEO, metafields, markets & translations",
3
+ "version": "1.1.1",
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",
7
7
  "types": "./dist/index.d.ts",
@@ -24,6 +24,10 @@
24
24
  "inspect": "npx @modelcontextprotocol/inspector node dist/index.js",
25
25
  "inspect:dev": "npx @modelcontextprotocol/inspector npx tsx src/index.ts",
26
26
  "inspect:config": "npx @modelcontextprotocol/inspector --config mcp-inspector.json",
27
+ "fast-agent": "fast-agent",
28
+ "fast-agent:check": "fast-agent check",
29
+ "fast-agent:chat": "fast-agent go --servers shopify-mcp-admin",
30
+ "fast-agent:dev": "fast-agent go --servers shopify-mcp-admin-dev",
27
31
  "ci": "npm run lint && npm run typecheck && npm run test && npm run build",
28
32
  "version:patch": "npm version patch --no-git-tag-version",
29
33
  "version:minor": "npm version minor --no-git-tag-version",