Skip to content

Commit e98b38b

Browse files
committed
ReadMe changes, remove file from gitignore, modify dev cmd
1 parent 79a8874 commit e98b38b

3 files changed

Lines changed: 23 additions & 210 deletions

File tree

packages/b2c-dx-mcp/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ yarn.lock
1515
package-lock.json
1616

1717
dw.json
18-
config.json
1918

2019
export/

packages/b2c-dx-mcp/README.md

Lines changed: 20 additions & 209 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,26 @@ Storefront Next development tools for building modern storefronts.
223223

224224
> **Note:** Some tools appear in multiple toolsets (e.g., `mrt_bundle_push`, `scapi_discovery`). When using multiple toolsets, tools are automatically deduplicated.
225225
226+
## Telemetry
227+
228+
The MCP server collects anonymous usage telemetry to help improve the developer experience.
229+
230+
**Development mode**: Telemetry is automatically disabled when `NODE_ENV=development` (set by `bin/dev.js`), so local development and testing won't pollute production data.
231+
232+
**Production**: Telemetry is enabled by default for published releases. To disable, set `SFCC_TELEMETRY=false`.
233+
234+
### What We Collect
235+
236+
- **Server lifecycle events**: When the server starts, stops, or encounters errors
237+
- **Tool usage**: Which tools are called and their execution time (not the arguments or results)
238+
- **Environment info**: Platform, architecture, Node.js version, and package version
239+
240+
### What We Don't Collect
241+
242+
- **No credentials**: No API keys, passwords, or secrets
243+
- **No business data**: No product data, customer information, or site content
244+
- **No tool arguments**: No input parameters or output results from tool calls
245+
- **No file contents**: No source code, configuration files, or project data
226246

227247
## Development
228248

@@ -332,215 +352,6 @@ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node bin/dev.js --toolse
332352
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"cartridge_deploy","arguments":{}}}' | node bin/dev.js --toolsets all --allow-non-ga-tools
333353
```
334354

335-
### Configuration
336-
337-
> **Note:** Configuration is not currently required as all tools are placeholder implementations. This section will be relevant once tools are fully implemented.
338-
339-
Different tools require different types of configuration:
340-
341-
| Tool Type | Configuration Required |
342-
|-----------|----------------------|
343-
| **MRT tools** (e.g., `mrt_bundle_push`) | API key + project |
344-
| **B2C instance tools** (e.g., `cartridge_deploy`) | dw.json or instance flags |
345-
| **Local tools** (e.g., scaffolding) | None |
346-
347-
#### MRT Configuration
348-
349-
MRT tools require an **API key** and **project**. The **environment** is optional (for deployments).
350-
351-
| Setting | Flag | Env Variable | Fallback |
352-
|---------|------|--------------|----------|
353-
| API key | `--api-key` | `SFCC_MRT_API_KEY` | `~/.mobify` |
354-
| Project | `--project` | `SFCC_MRT_PROJECT` ||
355-
| Environment | `--environment` | `SFCC_MRT_ENVIRONMENT` ||
356-
357-
> Priority: Flag > Env variable > `~/.mobify` file
358-
359-
**Example:**
360-
361-
```json
362-
{
363-
"mcpServers": {
364-
"b2c-dx": {
365-
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
366-
"args": [
367-
"--toolsets", "MRT",
368-
"--project", "my-project",
369-
"--environment", "staging",
370-
"--api-key", "your-api-key"
371-
]
372-
}
373-
}
374-
}
375-
```
376-
377-
Or use environment variables instead of flags:
378-
379-
```json
380-
{
381-
"mcpServers": {
382-
"b2c-dx": {
383-
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
384-
"args": ["--toolsets", "MRT"],
385-
"env": {
386-
"SFCC_MRT_API_KEY": "your-api-key",
387-
"SFCC_MRT_PROJECT": "my-project",
388-
"SFCC_MRT_ENVIRONMENT": "staging"
389-
}
390-
}
391-
}
392-
}
393-
```
394-
395-
> **Note:** Make sure the script is executable: `chmod +x /path/to/packages/b2c-dx-mcp/bin/dev.js`
396-
397-
#### Environment-Specific Config
398-
399-
If you have a `~/.mobify` file from the `b2c` CLI, the MCP server will use it as a fallback for API key:
400-
401-
```json
402-
{
403-
"api_key": "your-api-key"
404-
}
405-
```
406-
407-
For non-production environments, use `--cloud-origin` to select an environment-specific config file:
408-
409-
| `--cloud-origin` | Config File |
410-
|------------------|-------------|
411-
| (not set) | `~/.mobify` |
412-
| `https://cloud-staging.mobify.com` | `~/.mobify--cloud-staging.mobify.com` |
413-
| `https://cloud-dev.mobify.com` | `~/.mobify--cloud-dev.mobify.com` |
414-
415-
#### B2C Instance Config (dw.json)
416-
417-
Tools that interact with B2C Commerce instances (e.g., `cartridge_deploy`, SCAPI tools) require instance credentials.
418-
419-
**Authentication Methods:**
420-
421-
| Method | Credentials | Used By |
422-
|--------|-------------|---------|
423-
| **Basic auth** | `--username` + `--password` | WebDAV tools (`cartridge_deploy`) |
424-
| **OAuth** | `--client-id` + `--client-secret` | OCAPI tools, SCAPI tools |
425-
426-
> **Recommendation:** Use Basic auth (username/password) for WebDAV tools like `cartridge_deploy`. OAuth credentials (client-id/client-secret) are required for OCAPI/SCAPI tools. If you need both WebDAV and OCAPI tools, configure all four credentials.
427-
428-
**Priority order** (highest to lowest):
429-
430-
1. Flags (`--server`, `--username`, `--password`, `--client-id`, `--client-secret`)
431-
2. Environment variables (`SFCC_*`)
432-
3. `dw.json` file (via `--config` flag or auto-discovery)
433-
434-
**Option A: Flags with Basic auth (for WebDAV tools like cartridge_deploy)**
435-
436-
```json
437-
{
438-
"mcpServers": {
439-
"b2c-dx": {
440-
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
441-
"args": [
442-
"--toolsets", "CARTRIDGES",
443-
"--server", "your-sandbox.demandware.net",
444-
"--username", "your.username",
445-
"--password", "your-access-key"
446-
]
447-
}
448-
}
449-
}
450-
```
451-
452-
**Option B: Flags with OAuth (for OCAPI/SCAPI tools, or WebDAV fallback)**
453-
454-
```json
455-
{
456-
"mcpServers": {
457-
"b2c-dx": {
458-
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
459-
"args": [
460-
"--toolsets", "SCAPI",
461-
"--server", "your-sandbox.demandware.net",
462-
"--client-id", "your-client-id",
463-
"--client-secret", "your-client-secret"
464-
]
465-
}
466-
}
467-
}
468-
```
469-
470-
**Option C: Environment variables (all credentials)**
471-
472-
```json
473-
{
474-
"mcpServers": {
475-
"b2c-dx": {
476-
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
477-
"args": ["--toolsets", "CARTRIDGES"],
478-
"env": {
479-
"SFCC_SERVER": "your-sandbox.demandware.net",
480-
"SFCC_USERNAME": "your.username",
481-
"SFCC_PASSWORD": "your-access-key",
482-
"SFCC_CLIENT_ID": "your-client-id",
483-
"SFCC_CLIENT_SECRET": "your-client-secret",
484-
"SFCC_CODE_VERSION": "version1"
485-
}
486-
}
487-
}
488-
}
489-
```
490-
491-
**Option D: dw.json with explicit path**
492-
493-
```json
494-
{
495-
"mcpServers": {
496-
"b2c-dx": {
497-
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
498-
"args": ["--toolsets", "CARTRIDGES", "--config", "/path/to/dw.json"]
499-
}
500-
}
501-
}
502-
```
503-
504-
**Option E: dw.json with auto-discovery**
505-
506-
When `--config` is not provided, the MCP server searches upward from `~/` for a `dw.json` file.
507-
508-
> **Note:** Auto-discovery starts from the home directory, so it won't find project-level `dw.json` files. Use `--config` with an explicit path instead.
509-
510-
```json
511-
{
512-
"hostname": "your-sandbox.demandware.net",
513-
"username": "your.username",
514-
"password": "your-access-key",
515-
"client-id": "your-client-id",
516-
"client-secret": "your-client-secret",
517-
"code-version": "version1"
518-
}
519-
```
520-
521-
> **Note:** Flags override environment variables, and environment variables override `dw.json`. You can mix sources (e.g., secrets via env vars, other settings via dw.json).
522-
523-
## Telemetry
524-
525-
The MCP server collects anonymous usage telemetry to help improve the developer experience.
526-
527-
**Development mode**: Telemetry is automatically disabled when `NODE_ENV=development` (set by `bin/dev.js`), so local development and testing won't pollute production data.
528-
529-
**Production**: Telemetry is enabled by default for published releases. To disable, set `SFCC_TELEMETRY=false`.
530-
531-
### What We Collect
532-
533-
- **Server lifecycle events**: When the server starts, stops, or encounters errors
534-
- **Tool usage**: Which tools are called and their execution time (not the arguments or results)
535-
- **Environment info**: Platform, architecture, Node.js version, and package version
536-
537-
### What We Don't Collect
538-
539-
- **No credentials**: No API keys, passwords, or secrets
540-
- **No business data**: No product data, customer information, or site content
541-
- **No tool arguments**: No input parameters or output results from tool calls
542-
- **No file contents**: No source code, configuration files, or project data
543-
544355
## License
545356

546357
Apache-2.0

packages/b2c-dx-mcp/bin/dev.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
@echo off
22

3+
@REM Set NODE_ENV to development if not already set (disables production telemetry)
4+
if not defined NODE_ENV set NODE_ENV=development
5+
36
node --conditions development --import tsx "%~dp0\dev" %*
47

0 commit comments

Comments
 (0)