Skip to content

Commit b6f0e3f

Browse files
committed
update readme.md
1 parent c80c3c3 commit b6f0e3f

1 file changed

Lines changed: 77 additions & 56 deletions

File tree

packages/b2c-dx-mcp/README.md

Lines changed: 77 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,7 @@ Configure your IDE to use the local MCP server. Add this to your IDE's MCP confi
225225
}
226226
```
227227

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.
228+
> **Note:** Restart the MCP server in your IDE to pick up code changes.
242229
243230
#### 3. JSON-RPC via stdin
244231

@@ -256,43 +243,13 @@ echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"cartridge_
256243

257244
> **Note:** Configuration is not currently required as all tools are placeholder implementations. This section will be relevant once tools are fully implemented.
258245
259-
Tools that interact with B2C Commerce instances (e.g., MRT, SCAPI, cartridge deployment) require credentials, which can be provided via **environment variables**, a **`.env` file**, a **`dw.json` file**, or the **`--config`** flag. Local tools (e.g., scaffolding, development guidelines) work without configuration.
260-
261-
**Priority order** (highest to lowest):
262-
263-
1. Environment variables (`SFCC_*`) — includes `.env` file if present (shell env vars override `.env`)
264-
2. `dw.json` file (auto-discovered or via `--config`)
265-
266-
#### Option 1: Environment Variables
267-
268-
Set environment variables directly or create a `.env` file in your project root:
269-
270-
```bash
271-
# .env file or shell exports
272-
SFCC_HOSTNAME="your-sandbox.demandware.net"
273-
SFCC_USERNAME="your.username"
274-
SFCC_PASSWORD="your-access-key"
275-
SFCC_CLIENT_ID="your-client-id"
276-
SFCC_CLIENT_SECRET="your-client-secret"
277-
SFCC_CODE_VERSION="version1"
278-
```
279-
280-
#### Option 2: dw.json File
281-
282-
Create a `dw.json` file in your project root (auto-discovered by searching upward from current working directory):
246+
Different tools require different types of configuration:
283247

284-
```json
285-
{
286-
"hostname": "your-sandbox.demandware.net",
287-
"username": "your.username",
288-
"password": "your-access-key",
289-
"client-id": "your-client-id",
290-
"client-secret": "your-client-secret",
291-
"code-version": "version1"
292-
}
293-
```
294-
295-
> **Note:** Environment variables take precedence over `dw.json` values.
248+
| Tool Type | Configuration Required |
249+
|-----------|----------------------|
250+
| **MRT tools** (e.g., `mrt_bundle_push`) | MRT API key |
251+
| **B2C instance tools** (e.g., `cartridge_deploy`, SCAPI) | dw.json config |
252+
| **Local tools** (e.g., scaffolding) | None |
296253

297254
#### MRT API Key
298255

@@ -348,12 +305,16 @@ The MCP server will automatically use this file as a fallback if no flag or envi
348305

349306
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:
350307

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
308+
```json
309+
// mcp.json - uses ~/.mobify--cloud-staging.mobify.com for API key
310+
{
311+
"mcpServers": {
312+
"b2c-dx-staging": {
313+
"command": "b2c-dx-mcp",
314+
"args": ["--toolsets", "MRT", "--mrt-cloud-origin", "https://cloud-staging.mobify.com"]
315+
}
316+
}
317+
}
357318
```
358319

359320
| Cloud Origin | Config File |
@@ -364,6 +325,66 @@ SFCC_MRT_CLOUD_ORIGIN=https://cloud-staging.mobify.com b2c-dx-mcp --toolsets MRT
364325

365326
> **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.
366327
328+
#### B2C Instance Config (dw.json)
329+
330+
Tools that interact with B2C Commerce instances (e.g., `cartridge_deploy`, SCAPI tools) require instance credentials.
331+
332+
**Priority order** (highest to lowest):
333+
334+
1. Environment variables (`SFCC_*`)
335+
2. `dw.json` file (via `--config` flag or auto-discovery)
336+
337+
**Option A: Environment variables**
338+
339+
```json
340+
{
341+
"mcpServers": {
342+
"b2c-dx": {
343+
"command": "b2c-dx-mcp",
344+
"args": ["--toolsets", "CARTRIDGES"],
345+
"env": {
346+
"SFCC_HOSTNAME": "your-sandbox.demandware.net",
347+
"SFCC_USERNAME": "your.username",
348+
"SFCC_PASSWORD": "your-access-key",
349+
"SFCC_CLIENT_ID": "your-client-id",
350+
"SFCC_CLIENT_SECRET": "your-client-secret",
351+
"SFCC_CODE_VERSION": "version1"
352+
}
353+
}
354+
}
355+
}
356+
```
357+
358+
**Option B: dw.json with explicit path**
359+
360+
```json
361+
{
362+
"mcpServers": {
363+
"b2c-dx": {
364+
"command": "b2c-dx-mcp",
365+
"args": ["--toolsets", "CARTRIDGES", "--config", "/path/to/dw.json"]
366+
}
367+
}
368+
}
369+
```
370+
371+
**Option C: dw.json with auto-discovery**
372+
373+
Create a `dw.json` file in your project root. The MCP server will auto-discover it by searching upward from the current working directory:
374+
375+
```json
376+
{
377+
"hostname": "your-sandbox.demandware.net",
378+
"username": "your.username",
379+
"password": "your-access-key",
380+
"client-id": "your-client-id",
381+
"client-secret": "your-client-secret",
382+
"code-version": "version1"
383+
}
384+
```
385+
386+
> **Note:** Environment variables override values from `dw.json`. You can use env vars to override specific fields (e.g., secrets) while using dw.json for other settings.
387+
367388
## License
368389

369390
Apache-2.0

0 commit comments

Comments
 (0)