@@ -22,6 +22,13 @@ Since the package is not yet published to npm, see the [Development](#developmen
2222| ` --tools ` | Comma-separated individual tools to enable (case-insensitive) |
2323| ` --allow-non-ga-tools ` | Enable experimental (non-GA) tools |
2424
25+ #### Auth Flags
26+
27+ | Flag | Env Variable | Description |
28+ | ------| --------------| -------------|
29+ | ` --mrt-api-key ` | ` SFCC_MRT_API_KEY ` | MRT API key for Managed Runtime operations |
30+ | ` --mrt-cloud-origin ` | ` SFCC_MRT_CLOUD_ORIGIN ` | MRT cloud origin URL (default: https://cloud.mobify.com ). See [ Environment-Specific Config Files] ( #environment-specific-config-files ) |
31+
2532#### Global Flags (inherited from SDK)
2633
2734| Flag | Description |
@@ -48,6 +55,13 @@ Since the package is not yet published to npm, see the [Development](#developmen
4855// Explicit config file path
4956"args" : [" --toolsets" , " all" , " --config" , " /path/to/dw.json" ]
5057
58+ // MRT tools with API key
59+ "args" : [" --toolsets" , " MRT" , " --mrt-api-key" , " your-api-key" ]
60+
61+ // Or use environment variable in mcp.json
62+ "args" : [" --toolsets" , " MRT" ],
63+ "env" : { "SFCC_MRT_API_KEY" : " your-api-key" }
64+
5165// Enable experimental tools (required for placeholder tools)
5266"args" : [" --toolsets" , " all" , " --allow-non-ga-tools" ]
5367
@@ -211,7 +225,20 @@ Configure your IDE to use the local MCP server. Add this to your IDE's MCP confi
211225}
212226```
213227
214- > ** Note:** Restart the MCP server in your IDE to pick up code changes.
228+ ** Production Mode** (uses compiled JavaScript - run ` pnpm run build ` first):
229+
230+ ``` json
231+ {
232+ "mcpServers" : {
233+ "b2c-dx-local" : {
234+ "command" : " node" ,
235+ "args" : [" /full/path/to/packages/b2c-dx-mcp/bin/run.js" , " --toolsets" , " all" , " --allow-non-ga-tools" ]
236+ }
237+ }
238+ }
239+ ```
240+
241+ > ** Note:** For production mode, run ` pnpm run build ` after code changes and restart your IDE. Development mode picks up changes automatically.
215242
216243#### 3. JSON-RPC via stdin
217244
@@ -267,6 +294,76 @@ Create a `dw.json` file in your project root (auto-discovered by searching upwar
267294
268295> ** Note:** Environment variables take precedence over ` dw.json ` values.
269296
297+ #### MRT API Key
298+
299+ MRT (Managed Runtime) operations require an API key from the [ Runtime Admin] ( https://runtime.commercecloud.com/ ) dashboard.
300+
301+ ** Priority order** (highest to lowest):
302+
303+ 1 . ` --mrt-api-key ` flag
304+ 2 . ` SFCC_MRT_API_KEY ` environment variable
305+ 3 . ` ~/.mobify ` config file (or ` ~/.mobify--[hostname] ` if ` --mrt-cloud-origin ` is set)
306+
307+ ** Option A: Flag or environment variable**
308+
309+ ``` json
310+ // mcp.json - using flag
311+ {
312+ "mcpServers" : {
313+ "b2c-dx" : {
314+ "command" : " b2c-dx-mcp" ,
315+ "args" : [" --toolsets" , " MRT" , " --mrt-api-key" , " your-api-key" ]
316+ }
317+ }
318+ }
319+
320+ // mcp.json - using env var
321+ {
322+ "mcpServers" : {
323+ "b2c-dx" : {
324+ "command" : " b2c-dx-mcp" ,
325+ "args" : [" --toolsets" , " MRT" ],
326+ "env" : {
327+ "SFCC_MRT_API_KEY" : " your-api-key"
328+ }
329+ }
330+ }
331+ }
332+ ```
333+
334+ ** Option B: ~ /.mobify file (legacy)**
335+
336+ If you already use the ` b2c ` CLI for MRT operations, you may have a ` ~/.mobify ` file configured:
337+
338+ ``` json
339+ {
340+ "username" : " your.email@example.com" ,
341+ "api_key" : " your-api-key"
342+ }
343+ ```
344+
345+ The MCP server will automatically use this file as a fallback if no flag or environment variable is set.
346+
347+ ##### Environment-Specific Config Files
348+
349+ When using ` ~/.mobify ` config files (i.e., no ` --mrt-api-key ` flag or ` SFCC_MRT_API_KEY ` env var), you can use ` --mrt-cloud-origin ` to select an environment-specific config file:
350+
351+ ``` bash
352+ # Uses ~/.mobify--cloud-staging.mobify.com for API key
353+ b2c-dx-mcp --toolsets MRT --mrt-cloud-origin https://cloud-staging.mobify.com
354+
355+ # Or via environment variable
356+ SFCC_MRT_CLOUD_ORIGIN=https://cloud-staging.mobify.com b2c-dx-mcp --toolsets MRT
357+ ```
358+
359+ | Cloud Origin | Config File |
360+ | --------------| -------------|
361+ | (default) | ` ~/.mobify ` |
362+ | ` https://cloud-staging.mobify.com ` | ` ~/.mobify--cloud-staging.mobify.com ` |
363+ | ` https://cloud-dev.mobify.com ` | ` ~/.mobify--cloud-dev.mobify.com ` |
364+
365+ > ** Note:** ` --mrt-cloud-origin ` is only relevant when the API key is resolved from a config file. If ` --mrt-api-key ` or ` SFCC_MRT_API_KEY ` is provided, this flag is ignored.
366+
270367## License
271368
272369Apache-2.0
0 commit comments