Skip to content

Commit fff0f12

Browse files
committed
remove short hand and update readme
1 parent 5154424 commit fff0f12

File tree

9 files changed

+179
-183
lines changed

9 files changed

+179
-183
lines changed

packages/b2c-dx-mcp/README.md

Lines changed: 133 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,9 @@ MCP (Model Context Protocol) server for Salesforce B2C Commerce Cloud developer
66

77
This package provides an MCP server that exposes B2C Commerce developer tools for AI assistants. Built with [oclif](https://oclif.io/) for robust CLI handling with auto-generated help and environment variable support.
88

9-
## Installation
10-
11-
```bash
12-
npm install -g @salesforce/b2c-dx-mcp
13-
```
14-
15-
## Configuration
16-
17-
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.
18-
19-
**Priority order** (highest to lowest):
20-
1. Environment variables (`SFCC_*`) — includes `.env` file if present (shell env vars override `.env`)
21-
2. `dw.json` file (auto-discovered or via `--config`)
22-
23-
### Option 1: Environment Variables
24-
25-
Set environment variables directly or create a `.env` file in your project root:
26-
27-
```bash
28-
# .env file or shell exports
29-
SFCC_HOSTNAME="your-sandbox.demandware.net"
30-
SFCC_USERNAME="your.username"
31-
SFCC_PASSWORD="your-access-key"
32-
SFCC_CLIENT_ID="your-client-id"
33-
SFCC_CLIENT_SECRET="your-client-secret"
34-
SFCC_CODE_VERSION="version1"
35-
```
36-
37-
### Option 2: dw.json File
38-
39-
Create a `dw.json` file in your project root (auto-discovered by searching upward from current working directory):
40-
41-
```json
42-
{
43-
"hostname": "your-sandbox.demandware.net",
44-
"username": "your.username",
45-
"password": "your-access-key",
46-
"client-id": "your-client-id",
47-
"client-secret": "your-client-secret",
48-
"code-version": "version1"
49-
}
50-
```
51-
52-
> **Note:** Environment variables take precedence over `dw.json` values.
53-
549
## Usage
5510

56-
Configure your AI assistant to use this MCP server.
11+
Configure your AI assistant to use this MCP server. Since the package is not yet published to npm, use the local development setup below. See the [Development](#development) section for setup instructions.
5712

5813
### Cursor
5914

@@ -63,8 +18,8 @@ Add to `.cursor/mcp.json`:
6318
{
6419
"mcpServers": {
6520
"b2c-dx": {
66-
"command": "npx",
67-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "all"]
21+
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
22+
"args": ["--toolsets", "all"]
6823
}
6924
}
7025
}
@@ -78,8 +33,8 @@ Add to `claude_desktop_config.json`:
7833
{
7934
"mcpServers": {
8035
"b2c-dx": {
81-
"command": "npx",
82-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "all"]
36+
"command": "/path/to/packages/b2c-dx-mcp/bin/dev.js",
37+
"args": ["--toolsets", "all"]
8338
}
8439
}
8540
}
@@ -89,83 +44,106 @@ Add to `claude_desktop_config.json`:
8944

9045
```json
9146
// Enable specific toolsets
92-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "CARTRIDGES,JOBS"]
47+
"args": ["--toolsets", "CARTRIDGES,JOBS"]
9348

9449
// Enable specific tools
95-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--tools", "code_upload,code_list"]
50+
"args": ["--tools", "cartridge_deploy,mrt_bundle_push"]
9651

9752
// Combine toolsets and tools
98-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "CARTRIDGES", "--tools", "job_run"]
53+
"args": ["--toolsets", "CARTRIDGES", "--tools", "job_run"]
9954

10055
// Explicit config file path
101-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "all", "--config", "/path/to/dw.json"]
56+
"args": ["--toolsets", "all", "--config", "/path/to/dw.json"]
10257

10358
// Enable experimental tools
104-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "all", "--allow-non-ga-tools"]
59+
"args": ["--toolsets", "all", "--allow-non-ga-tools"]
10560

10661
// Enable debug logging
107-
"args": ["-y", "@salesforce/b2c-dx-mcp", "--toolsets", "all", "--debug"]
62+
"args": ["--toolsets", "all", "--debug"]
10863
```
10964

11065
### Supported Flags
11166

11267
#### MCP-Specific Flags
11368

114-
| Flag | Short | Description |
115-
|------|-------|-------------|
116-
| `--toolsets` | `-s` | Comma-separated toolsets to enable (case-insensitive) |
117-
| `--tools` | `-t` | Comma-separated individual tools to enable (case-insensitive) |
118-
| `--allow-non-ga-tools` | | Enable experimental (non-GA) tools |
69+
| Flag | Description |
70+
|------|-------------|
71+
| `--toolsets` | Comma-separated toolsets to enable (case-insensitive) |
72+
| `--tools` | Comma-separated individual tools to enable (case-insensitive) |
73+
| `--allow-non-ga-tools` | Enable experimental (non-GA) tools |
11974

12075
#### Global Flags (inherited from SDK)
12176

122-
| Flag | Short | Description |
123-
|------|-------|-------------|
124-
| `--config` | | Path to dw.json config file (auto-discovered if not provided) |
125-
| `--instance` | `-i` | Instance name from configuration file |
126-
| `--log-level` | | Set logging verbosity (trace, debug, info, warn, error, silent) |
127-
| `--debug` | `-D` | Enable debug logging |
128-
| `--json` | | Output logs as JSON lines |
129-
| `--lang` | `-L` | Language for messages |
130-
131-
### Available Toolsets
132-
133-
| Toolset | Description |
134-
|---------|-------------|
135-
| `CARTRIDGES` | Code deployment and version management |
136-
| `MRT` | Managed Runtime operations |
137-
| `PWAV3` | PWA Kit v3 development tools |
138-
| `SCAPI` | Salesforce Commerce API discovery and exploration |
139-
| `STOREFRONTNEXT` | Storefront Next development tools |
140-
141-
Use `--toolsets all` to enable all available toolsets.
142-
143-
### Available Tools
144-
145-
| Tool | Description | Toolsets |
146-
|------|-------------|----------|
147-
| `code_upload` | Upload cartridges to a B2C Commerce instance | CARTRIDGES |
148-
| `code_list` | List all code versions on a B2C Commerce instance | CARTRIDGES |
149-
| `code_activate` | Activate a code version on a B2C Commerce instance | CARTRIDGES |
150-
| `mrt_bundle_push` | Deploy a bundle to Managed Runtime | MRT, PWAV3, STOREFRONTNEXT |
151-
| `pwakit_create_storefront` | Create a new PWA Kit storefront project | PWAV3 |
152-
| `pwakit_create_page` | Create a new page component in PWA Kit project | PWAV3 |
153-
| `pwakit_create_component` | Create a new React component in PWA Kit project | PWAV3 |
154-
| `pwakit_get_dev_guidelines` | Get PWA Kit development guidelines and best practices | PWAV3 |
155-
| `pwakit_recommend_hooks` | Recommend appropriate React hooks for PWA Kit use cases | PWAV3 |
156-
| `pwakit_run_site_test` | Run site tests for PWA Kit project | PWAV3 |
157-
| `pwakit_install_agent_rules` | Install AI agent rules for PWA Kit development | PWAV3 |
158-
| `pwakit_explore_scapi_shop_api` | Explore SCAPI Shop API endpoints and capabilities | PWAV3 |
159-
| `scapi_discovery` | Discover available SCAPI endpoints and capabilities | PWAV3, SCAPI, STOREFRONTNEXT |
160-
| `scapi_customapi_scaffold` | Scaffold a new custom SCAPI API | SCAPI |
161-
| `scapi_custom_api_discovery` | Discover custom SCAPI API endpoints | PWAV3, SCAPI, STOREFRONTNEXT |
162-
| `sfnext_development_guidelines` | Get Storefront Next development guidelines and best practices | STOREFRONTNEXT |
163-
| `sfnext_site_theming` | Configure and manage site theming for Storefront Next | STOREFRONTNEXT |
164-
| `sfnext_figma_to_component_workflow` | Convert Figma designs to Storefront Next components | STOREFRONTNEXT |
165-
| `sfnext_generate_component` | Generate a new Storefront Next component | STOREFRONTNEXT |
166-
| `sfnext_map_tokens_to_theme` | Map design tokens to Storefront Next theme configuration | STOREFRONTNEXT |
167-
| `sfnext_design_decorator` | Apply design decorators to Storefront Next components | STOREFRONTNEXT |
168-
| `sfnext_generate_page_designer_metadata` | Generate Page Designer metadata for Storefront Next components | STOREFRONTNEXT |
77+
| Flag | Description |
78+
|------|-------------|
79+
| `--config` | Path to dw.json config file (auto-discovered if not provided) |
80+
| `--instance` | Instance name from configuration file |
81+
| `--log-level` | Set logging verbosity (trace, debug, info, warn, error, silent) |
82+
| `--debug` | Enable debug logging |
83+
| `--json` | Output logs as JSON lines |
84+
| `--lang` | Language for messages |
85+
86+
### Available Toolsets and Tools
87+
88+
Use `--toolsets all` to enable all toolsets, or select specific ones with `--toolsets CARTRIDGES,MRT`.
89+
90+
#### CARTRIDGES
91+
Code deployment and version management.
92+
93+
| Tool | Description |
94+
|------|-------------|
95+
| `cartridge_deploy` | Deploy cartridges to a B2C Commerce instance |
96+
97+
#### MRT
98+
Managed Runtime operations.
99+
100+
| Tool | Description |
101+
|------|-------------|
102+
| `mrt_bundle_push` | Build, push bundle (optionally deploy) |
103+
104+
#### PWAV3
105+
PWA Kit v3 development tools.
106+
107+
| Tool | Description |
108+
|------|-------------|
109+
| `pwakit_create_storefront` | Create a new PWA Kit storefront project |
110+
| `pwakit_create_page` | Create a new page component in PWA Kit project |
111+
| `pwakit_create_component` | Create a new React component in PWA Kit project |
112+
| `pwakit_get_dev_guidelines` | Get PWA Kit development guidelines and best practices |
113+
| `pwakit_recommend_hooks` | Recommend appropriate React hooks for PWA Kit use cases |
114+
| `pwakit_run_site_test` | Run site tests for PWA Kit project |
115+
| `pwakit_install_agent_rules` | Install AI agent rules for PWA Kit development |
116+
| `pwakit_explore_scapi_shop_api` | Explore SCAPI Shop API endpoints and capabilities |
117+
| `scapi_discovery` | Discover available SCAPI endpoints and capabilities |
118+
| `scapi_custom_api_discovery` | Discover custom SCAPI API endpoints |
119+
| `mrt_bundle_push` | Build, push bundle (optionally deploy) |
120+
121+
#### SCAPI
122+
Salesforce Commerce API discovery and exploration.
123+
124+
| Tool | Description |
125+
|------|-------------|
126+
| `scapi_discovery` | Discover available SCAPI endpoints and capabilities |
127+
| `scapi_customapi_scaffold` | Scaffold a new custom SCAPI API |
128+
| `scapi_custom_api_discovery` | Discover custom SCAPI API endpoints |
129+
130+
#### STOREFRONTNEXT
131+
Storefront Next development tools.
132+
133+
| Tool | Description |
134+
|------|-------------|
135+
| `sfnext_development_guidelines` | Get Storefront Next development guidelines and best practices |
136+
| `sfnext_site_theming` | Configure and manage site theming for Storefront Next |
137+
| `sfnext_figma_to_component_workflow` | Convert Figma designs to Storefront Next components |
138+
| `sfnext_generate_component` | Generate a new Storefront Next component |
139+
| `sfnext_map_tokens_to_theme` | Map design tokens to Storefront Next theme configuration |
140+
| `sfnext_design_decorator` | Apply design decorators to Storefront Next components |
141+
| `sfnext_generate_page_designer_metadata` | Generate Page Designer metadata for Storefront Next components |
142+
| `scapi_discovery` | Discover available SCAPI endpoints and capabilities |
143+
| `scapi_custom_api_discovery` | Discover custom SCAPI API endpoints |
144+
| `mrt_bundle_push` | Build, push bundle (optionally deploy) |
145+
146+
> **Note:** Some tools appear in multiple toolsets (e.g., `mrt_bundle_push`, `scapi_discovery`). When using multiple toolsets, tools are automatically deduplicated.
169147
170148

171149
## Development
@@ -228,10 +206,10 @@ For CLI-based testing:
228206

229207
```bash
230208
# List all tools
231-
npx mcp-inspector --cli node bin/run.js -s all --allow-non-ga-tools --method tools/list
209+
npx mcp-inspector --cli node bin/run.js --toolsets all --allow-non-ga-tools --method tools/list
232210

233211
# Call a specific tool
234-
npx mcp-inspector --cli node bin/run.js -s all --allow-non-ga-tools \
212+
npx mcp-inspector --cli node bin/run.js --toolsets all --allow-non-ga-tools \
235213
--method tools/call \
236214
--tool-name sfnext_design_decorator
237215
```
@@ -247,7 +225,7 @@ Configure your IDE to use the local server. Choose development mode (no build re
247225
"mcpServers": {
248226
"b2c-dx-local": {
249227
"command": "/full/path/to/packages/b2c-dx-mcp/bin/dev.js",
250-
"args": ["-s", "all"]
228+
"args": ["--toolsets", "all"]
251229
}
252230
}
253231
}
@@ -260,7 +238,7 @@ Configure your IDE to use the local server. Choose development mode (no build re
260238
"mcpServers": {
261239
"b2c-dx-local": {
262240
"command": "/full/path/to/packages/b2c-dx-mcp/bin/run.js",
263-
"args": ["-s", "all"]
241+
"args": ["--toolsets", "all"]
264242
}
265243
}
266244
}
@@ -274,12 +252,53 @@ Send raw MCP protocol messages:
274252

275253
```bash
276254
# List all tools
277-
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node bin/run.js -s all
255+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node bin/run.js --toolsets all
278256

279257
# Call a specific tool
280-
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"code_list","arguments":{}}}' | node bin/run.js -s all
258+
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"cartridge_deploy","arguments":{}}}' | node bin/run.js --toolsets all
259+
```
260+
261+
### Configuration
262+
263+
> **Note:** Configuration is not currently required as all tools are placeholder implementations. This section will be relevant once tools are fully implemented.
264+
265+
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.
266+
267+
**Priority order** (highest to lowest):
268+
1. Environment variables (`SFCC_*`) — includes `.env` file if present (shell env vars override `.env`)
269+
2. `dw.json` file (auto-discovered or via `--config`)
270+
271+
#### Option 1: Environment Variables
272+
273+
Set environment variables directly or create a `.env` file in your project root:
274+
275+
```bash
276+
# .env file or shell exports
277+
SFCC_HOSTNAME="your-sandbox.demandware.net"
278+
SFCC_USERNAME="your.username"
279+
SFCC_PASSWORD="your-access-key"
280+
SFCC_CLIENT_ID="your-client-id"
281+
SFCC_CLIENT_SECRET="your-client-secret"
282+
SFCC_CODE_VERSION="version1"
281283
```
282284

285+
#### Option 2: dw.json File
286+
287+
Create a `dw.json` file in your project root (auto-discovered by searching upward from current working directory):
288+
289+
```json
290+
{
291+
"hostname": "your-sandbox.demandware.net",
292+
"username": "your.username",
293+
"password": "your-access-key",
294+
"client-id": "your-client-id",
295+
"client-secret": "your-client-secret",
296+
"code-version": "version1"
297+
}
298+
```
299+
300+
> **Note:** Environment variables take precedence over `dw.json` values.
301+
283302
## License
284303

285304
Apache-2.0

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* - Loads .env file if present for local configuration
1616
* - Provides better error messages and stack traces
1717
*
18-
* Run directly: ./bin/dev.js mcp -s all
19-
* Or with node: node --conditions development --import tsx bin/dev.js mcp -s all
18+
* Run directly: ./bin/dev.js mcp --toolsets all
19+
* Or with node: node --conditions development --import tsx bin/dev.js mcp --toolsets all
2020
*/
2121

2222
// Load .env file if present (Node.js native support)

packages/b2c-dx-mcp/bin/run.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* - Uses compiled JavaScript from dist/
1414
* - Loads .env file if present for local configuration
1515
*
16-
* Run directly: ./bin/run.js mcp -s all
17-
* Or with node: node bin/run.js mcp -s all
16+
* Run directly: ./bin/run.js mcp --toolsets all
17+
* Or with node: node bin/run.js mcp --toolsets all
1818
*/
1919

2020
// Load .env file if present (Node.js native support)

packages/b2c-dx-mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"format": "prettier --write src",
6666
"format:check": "prettier --check src",
6767
"preinspect": "pnpm run build",
68-
"inspect": "mcp-inspector node bin/run.js -s all --allow-non-ga-tools",
68+
"inspect": "mcp-inspector node bin/run.js --toolsets all --allow-non-ga-tools",
6969
"pretest": "tsc --noEmit -p test",
7070
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
7171
"posttest": "pnpm run lint",

0 commit comments

Comments
 (0)