@salesforce/b2c-dx-mcp 0.4.5 → 0.4.6

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 CHANGED
@@ -53,7 +53,7 @@ Always set `--project-directory` (or `SFCC_PROJECT_DIRECTORY`). MCP clients spaw
53
53
  | `SFCC_PASSWORD` | Password/access key for WebDAV |
54
54
  | `SFCC_CLIENT_ID` | OAuth client ID |
55
55
  | `SFCC_CLIENT_SECRET` | OAuth client secret |
56
- | `SFCC_MRT_API_KEY` | MRT API key |
56
+ | `MRT_API_KEY` | MRT API key (`SFCC_MRT_API_KEY` also supported) |
57
57
 
58
58
  See the [Configuration Guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/configuration) for credentials, flags, and toolset selection.
59
59
 
@@ -50,10 +50,10 @@ export default class McpServerCommand extends BaseCommand<typeof McpServerComman
50
50
  'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
51
51
  'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
52
52
  'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
53
- 'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
53
+ 'api-key': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
54
54
  project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
55
55
  environment: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
56
- 'cloud-origin': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
56
+ 'cloud-origin': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
57
57
  'credentials-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
58
58
  };
59
59
  /** Signal that triggered shutdown (if any) - used to exit process after finally() */
@@ -77,7 +77,7 @@ export default class McpServerCommand extends BaseCommand<typeof McpServerComman
77
77
  *
78
78
  * Priority (highest to lowest):
79
79
  * 1. CLI flags (--server, --username, --api-key, etc.)
80
- * 2. Environment variables (SFCC_SERVER, SFCC_USERNAME, SFCC_MRT_API_KEY, etc.)
80
+ * 2. Environment variables (SFCC_SERVER, SFCC_USERNAME, MRT_API_KEY, etc.)
81
81
  * 3. dw.json file (via --config flag or auto-discovered from --project-directory)
82
82
  * 4. ~/.mobify file (for MRT API key)
83
83
  */
@@ -29,10 +29,10 @@
29
29
  * ### MRT Flags (from MrtCommand.baseFlags)
30
30
  * | Flag | Env Variable | Description |
31
31
  * |------|--------------|-------------|
32
- * | `--api-key` | `SFCC_MRT_API_KEY` | MRT API key for Managed Runtime operations |
33
- * | `--project` | `SFCC_MRT_PROJECT` | MRT project slug (required for MRT tools) |
34
- * | `--environment` | `SFCC_MRT_ENVIRONMENT` | MRT environment (e.g., staging, production) |
35
- * | `--cloud-origin` | `SFCC_MRT_CLOUD_ORIGIN` | MRT cloud origin URL for environment-specific ~/.mobify config |
32
+ * | `--api-key` | `MRT_API_KEY` | MRT API key for Managed Runtime operations |
33
+ * | `--project` | `MRT_PROJECT` | MRT project slug (required for MRT tools) |
34
+ * | `--environment` | `MRT_ENVIRONMENT` | MRT environment (e.g., staging, production) |
35
+ * | `--cloud-origin` | `MRT_CLOUD_ORIGIN` | MRT cloud origin URL for environment-specific ~/.mobify config |
36
36
  *
37
37
  * ### B2C Instance Flags (from InstanceCommand.baseFlags)
38
38
  * | Flag | Env Variable | Description |
@@ -79,7 +79,7 @@
79
79
  * ### MRT API Key
80
80
  * Priority (highest to lowest):
81
81
  * 1. `--api-key` flag
82
- * 2. `SFCC_MRT_API_KEY` environment variable
82
+ * 2. `MRT_API_KEY` environment variable (SFCC_MRT_API_KEY also supported)
83
83
  * 3. `~/.mobify` config file (or `~/.mobify--[hostname]` if `--cloud-origin` is set)
84
84
  *
85
85
  * ## Toolset Validation
@@ -101,7 +101,7 @@
101
101
  * ```json
102
102
  * {
103
103
  * "args": ["--toolsets", "MRT", "--project", "my-project", "--environment", "staging", "--allow-non-ga-tools"],
104
- * "env": { "SFCC_MRT_API_KEY": "your-api-key" }
104
+ * "env": { "MRT_API_KEY": "your-api-key" }
105
105
  * }
106
106
  * ```
107
107
  *
@@ -232,7 +232,7 @@ export default class McpServerCommand extends BaseCommand {
232
232
  *
233
233
  * Priority (highest to lowest):
234
234
  * 1. CLI flags (--server, --username, --api-key, etc.)
235
- * 2. Environment variables (SFCC_SERVER, SFCC_USERNAME, SFCC_MRT_API_KEY, etc.)
235
+ * 2. Environment variables (SFCC_SERVER, SFCC_USERNAME, MRT_API_KEY, etc.)
236
236
  * 3. dw.json file (via --config flag or auto-discovered from --project-directory)
237
237
  * 4. ~/.mobify file (for MRT API key)
238
238
  */
@@ -26,11 +26,11 @@
26
26
  * - Flags (highest priority) merged with dw.json (auto-discovered or via --config)
27
27
  *
28
28
  * **MRT Auth** (for Managed Runtime tools):
29
- * 1. `--api-key` flag (oclif also checks `SFCC_MRT_API_KEY` env var)
29
+ * 1. `--api-key` flag (oclif also checks `MRT_API_KEY` env var; `SFCC_MRT_API_KEY` also supported)
30
30
  * 2. `~/.mobify` config file (or `~/.mobify--[hostname]` if `--cloud-origin` is set)
31
31
  *
32
32
  * **MRT Origin** (for Managed Runtime API URL):
33
- * 1. `--cloud-origin` flag (oclif also checks `SFCC_MRT_CLOUD_ORIGIN` env var)
33
+ * 1. `--cloud-origin` flag (oclif also checks `MRT_CLOUD_ORIGIN` env var; `SFCC_MRT_CLOUD_ORIGIN` also supported)
34
34
  * 2. `mrtOrigin` field in dw.json
35
35
  * 3. Default: `https://cloud.mobify.com`
36
36
  *
@@ -48,11 +48,11 @@ import { WebDavClient, type CustomApisClient, type ScapiSchemasClient } from '@s
48
48
  export interface MrtConfig {
49
49
  /** Pre-resolved auth strategy for MRT API operations */
50
50
  auth?: AuthStrategy;
51
- /** MRT project slug from --project flag or SFCC_MRT_PROJECT env var */
51
+ /** MRT project slug from --project flag or MRT_PROJECT env var */
52
52
  project?: string;
53
- /** MRT environment from --environment flag or SFCC_MRT_ENVIRONMENT env var */
53
+ /** MRT environment from --environment flag or MRT_ENVIRONMENT env var */
54
54
  environment?: string;
55
- /** MRT API origin URL from --cloud-origin flag, SFCC_MRT_CLOUD_ORIGIN env var, or mrtOrigin in dw.json */
55
+ /** MRT API origin URL from --cloud-origin flag, MRT_CLOUD_ORIGIN env var, or mrtOrigin in dw.json */
56
56
  origin?: string;
57
57
  }
58
58
  /**
package/dist/services.js CHANGED
@@ -31,11 +31,11 @@
31
31
  * - Flags (highest priority) merged with dw.json (auto-discovered or via --config)
32
32
  *
33
33
  * **MRT Auth** (for Managed Runtime tools):
34
- * 1. `--api-key` flag (oclif also checks `SFCC_MRT_API_KEY` env var)
34
+ * 1. `--api-key` flag (oclif also checks `MRT_API_KEY` env var; `SFCC_MRT_API_KEY` also supported)
35
35
  * 2. `~/.mobify` config file (or `~/.mobify--[hostname]` if `--cloud-origin` is set)
36
36
  *
37
37
  * **MRT Origin** (for Managed Runtime API URL):
38
- * 1. `--cloud-origin` flag (oclif also checks `SFCC_MRT_CLOUD_ORIGIN` env var)
38
+ * 1. `--cloud-origin` flag (oclif also checks `MRT_CLOUD_ORIGIN` env var; `SFCC_MRT_CLOUD_ORIGIN` also supported)
39
39
  * 2. `mrtOrigin` field in dw.json
40
40
  * 3. Default: `https://cloud.mobify.com`
41
41
  *
@@ -13,7 +13,7 @@
13
13
  * a loader function that calls {@link Services.fromResolvedConfig}:
14
14
  *
15
15
  * - **B2CInstance**: Loaded from flags + dw.json on each call. Available when `requiresInstance: true`.
16
- * - **MRT Auth**: Loaded from --api-key → SFCC_MRT_API_KEY → ~/.mobify on each call. Available when `requiresMrtAuth: true`.
16
+ * - **MRT Auth**: Loaded from --api-key → MRT_API_KEY → ~/.mobify on each call. Available when `requiresMrtAuth: true`.
17
17
  *
18
18
  * This "load on each call" pattern provides:
19
19
  * - Fresh configuration on each tool invocation (picks up changes to config files)
@@ -115,7 +115,7 @@ export interface ToolAdapterOptions<TInput, TOutput> {
115
115
  requiresInstance?: boolean;
116
116
  /**
117
117
  * Whether this tool requires MRT API authentication.
118
- * When true, creates an ApiKeyStrategy from SFCC_MRT_API_KEY environment variable.
118
+ * When true, creates an ApiKeyStrategy from MRT_API_KEY environment variable.
119
119
  * Defaults to false.
120
120
  */
121
121
  requiresMrtAuth?: boolean;
@@ -18,7 +18,7 @@
18
18
  * a loader function that calls {@link Services.fromResolvedConfig}:
19
19
  *
20
20
  * - **B2CInstance**: Loaded from flags + dw.json on each call. Available when `requiresInstance: true`.
21
- * - **MRT Auth**: Loaded from --api-key → SFCC_MRT_API_KEY → ~/.mobify on each call. Available when `requiresMrtAuth: true`.
21
+ * - **MRT Auth**: Loaded from --api-key → MRT_API_KEY → ~/.mobify on each call. Available when `requiresMrtAuth: true`.
22
22
  *
23
23
  * This "load on each call" pattern provides:
24
24
  * - Fresh configuration on each tool invocation (picks up changes to config files)
@@ -200,7 +200,7 @@ export function createToolAdapter(options, loadServices) {
200
200
  let mrtConfig;
201
201
  if (requiresMrtAuth) {
202
202
  if (!services.mrtConfig.auth) {
203
- return errorResult('MRT auth error: MRT API key required. Provide --api-key, set SFCC_MRT_API_KEY environment variable, or configure ~/.mobify');
203
+ return errorResult('MRT auth error: MRT API key required. Provide --api-key, set MRT_API_KEY environment variable, or configure ~/.mobify');
204
204
  }
205
205
  mrtConfig = {
206
206
  auth: services.mrtConfig.auth,
@@ -33,7 +33,7 @@ function createMrtBundlePushTool(loadServices, injections) {
33
33
  description: 'Bundle a pre-built PWA Kit or Storefront Next project and push to Managed Runtime. Optionally deploy to a target environment.',
34
34
  toolsets: ['MRT', 'PWAV3', 'STOREFRONTNEXT'],
35
35
  isGA: false,
36
- // MRT operations use ApiKeyStrategy from SFCC_MRT_API_KEY or ~/.mobify
36
+ // MRT operations use ApiKeyStrategy from MRT_API_KEY or ~/.mobify
37
37
  requiresMrtAuth: true,
38
38
  inputSchema: {
39
39
  buildDirectory: z.string().optional().describe('Path to build directory (default: ./build)'),
@@ -56,7 +56,7 @@ function createMrtBundlePushTool(loadServices, injections) {
56
56
  // Get project from --project flag (required)
57
57
  const project = context.mrtConfig?.project;
58
58
  if (!project) {
59
- throw new Error('MRT project error: Project is required. Provide --project flag or set SFCC_MRT_PROJECT environment variable.');
59
+ throw new Error('MRT project error: Project is required. Provide --project flag or set MRT_PROJECT environment variable.');
60
60
  }
61
61
  // Get environment from --environment flag (optional)
62
62
  // When deploy is false, environment is undefined (bundle push only, no deployment)
@@ -66,7 +66,7 @@ function createMrtBundlePushTool(loadServices, injections) {
66
66
  environment = context.mrtConfig?.environment;
67
67
  if (!environment) {
68
68
  throw new Error('MRT deployment error: Environment is required when deploy=true. ' +
69
- 'Provide --environment flag, set SFCC_MRT_ENVIRONMENT environment variable, or set mrtEnvironment in dw.json.');
69
+ 'Provide --environment flag, set MRT_ENVIRONMENT environment variable, or set mrtEnvironment in dw.json.');
70
70
  }
71
71
  }
72
72
  // Get origin from --cloud-origin flag or mrtOrigin config (optional)
@@ -143,7 +143,7 @@
143
143
  },
144
144
  "api-key": {
145
145
  "description": "MRT API key",
146
- "env": "SFCC_MRT_API_KEY",
146
+ "env": "MRT_API_KEY",
147
147
  "helpGroup": "AUTH",
148
148
  "name": "api-key",
149
149
  "hasDynamicHelp": false,
@@ -153,16 +153,19 @@
153
153
  "project": {
154
154
  "char": "p",
155
155
  "description": "MRT project slug (or set mrtProject in dw.json)",
156
- "env": "SFCC_MRT_PROJECT",
156
+ "env": "MRT_PROJECT",
157
157
  "name": "project",
158
158
  "hasDynamicHelp": false,
159
159
  "multiple": false,
160
160
  "type": "option"
161
161
  },
162
162
  "environment": {
163
+ "aliases": [
164
+ "target"
165
+ ],
163
166
  "char": "e",
164
167
  "description": "MRT environment (e.g., staging, production; or set mrtEnvironment in dw.json)",
165
- "env": "SFCC_MRT_ENVIRONMENT",
168
+ "env": "MRT_ENVIRONMENT",
166
169
  "name": "environment",
167
170
  "hasDynamicHelp": false,
168
171
  "multiple": false,
@@ -170,7 +173,7 @@
170
173
  },
171
174
  "cloud-origin": {
172
175
  "description": "MRT cloud origin URL (or set mrtOrigin in dw.json; default: https://cloud.mobify.com)",
173
- "env": "SFCC_MRT_CLOUD_ORIGIN",
176
+ "env": "MRT_CLOUD_ORIGIN",
174
177
  "name": "cloud-origin",
175
178
  "hasDynamicHelp": false,
176
179
  "multiple": false,
@@ -387,5 +390,5 @@
387
390
  "enableJsonFlag": false
388
391
  }
389
392
  },
390
- "version": "0.4.5"
393
+ "version": "0.4.6"
391
394
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/b2c-dx-mcp",
3
3
  "description": "MCP server for B2C Commerce developer experience tools",
4
- "version": "0.4.5",
4
+ "version": "0.4.6",
5
5
  "author": "Salesforce",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "SalesforceCommerceCloud/b2c-developer-tooling",
@@ -80,7 +80,7 @@
80
80
  "yaml": "2.8.1",
81
81
  "postcss": "8.5.6",
82
82
  "zod": "3.25.76",
83
- "@salesforce/b2c-tooling-sdk": "0.5.4"
83
+ "@salesforce/b2c-tooling-sdk": "0.5.5"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@eslint/compat": "^1",