@salesforce/b2c-dx-mcp 0.4.4 → 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.
Files changed (84) hide show
  1. package/README.md +82 -370
  2. package/content/pwav3/components.md +400 -0
  3. package/content/pwav3/config.md +124 -0
  4. package/content/pwav3/data-fetching.md +213 -0
  5. package/content/pwav3/extensibility.md +167 -0
  6. package/content/pwav3/i18n.md +214 -0
  7. package/content/pwav3/quick-reference.md +169 -0
  8. package/content/pwav3/routing.md +107 -0
  9. package/content/pwav3/state-management.md +193 -0
  10. package/content/pwav3/styling.md +248 -0
  11. package/content/pwav3/testing.md +124 -0
  12. package/content/site-theming/theming-accessibility.md +126 -0
  13. package/content/site-theming/theming-questions.md +208 -0
  14. package/content/site-theming/theming-validation.md +174 -0
  15. package/dist/commands/mcp.d.ts +3 -3
  16. package/dist/commands/mcp.js +7 -7
  17. package/dist/registry.js +1 -1
  18. package/dist/services.d.ts +15 -15
  19. package/dist/services.js +21 -14
  20. package/dist/tools/adapter.d.ts +2 -2
  21. package/dist/tools/adapter.js +2 -2
  22. package/dist/tools/cartridges/index.js +1 -6
  23. package/dist/tools/index.d.ts +1 -4
  24. package/dist/tools/index.js +1 -4
  25. package/dist/tools/mrt/index.js +4 -9
  26. package/dist/tools/pwav3/index.d.ts +12 -3
  27. package/dist/tools/pwav3/index.js +5 -63
  28. package/dist/tools/pwav3/pwa-kit-development-guidelines.d.ts +9 -0
  29. package/dist/tools/pwav3/pwa-kit-development-guidelines.js +151 -0
  30. package/dist/tools/scapi/index.d.ts +1 -1
  31. package/dist/tools/scapi/index.js +6 -1
  32. package/dist/tools/scapi/scapi-custom-api-scaffold.d.ts +60 -0
  33. package/dist/tools/scapi/scapi-custom-api-scaffold.js +175 -0
  34. package/dist/tools/storefrontnext/figma/figma-to-component/figma-url-parser.d.ts +24 -0
  35. package/dist/tools/storefrontnext/figma/figma-to-component/figma-url-parser.js +53 -0
  36. package/dist/tools/storefrontnext/figma/figma-to-component/index.d.ts +42 -0
  37. package/dist/tools/storefrontnext/figma/figma-to-component/index.js +325 -0
  38. package/dist/tools/storefrontnext/figma/generate-component/decision.d.ts +40 -0
  39. package/dist/tools/storefrontnext/figma/generate-component/decision.js +312 -0
  40. package/dist/tools/storefrontnext/figma/generate-component/formatter.d.ts +9 -0
  41. package/dist/tools/storefrontnext/figma/generate-component/formatter.js +92 -0
  42. package/dist/tools/storefrontnext/figma/generate-component/index.d.ts +114 -0
  43. package/dist/tools/storefrontnext/figma/generate-component/index.js +98 -0
  44. package/dist/tools/storefrontnext/figma/map-tokens/css-parser.d.ts +71 -0
  45. package/dist/tools/storefrontnext/figma/map-tokens/css-parser.js +260 -0
  46. package/dist/tools/storefrontnext/figma/map-tokens/index.d.ts +61 -0
  47. package/dist/tools/storefrontnext/figma/map-tokens/index.js +234 -0
  48. package/dist/tools/storefrontnext/figma/map-tokens/token-matcher.d.ts +65 -0
  49. package/dist/tools/storefrontnext/figma/map-tokens/token-matcher.js +268 -0
  50. package/dist/tools/storefrontnext/index.d.ts +17 -0
  51. package/dist/tools/storefrontnext/index.js +10 -60
  52. package/dist/tools/storefrontnext/page-designer-decorator/analyzer.js +15 -0
  53. package/dist/tools/storefrontnext/page-designer-decorator/index.js +3 -3
  54. package/dist/tools/storefrontnext/{developer-guidelines.js → sfnext-development-guidelines.js} +3 -3
  55. package/dist/tools/storefrontnext/site-theming/color-contrast.d.ts +92 -0
  56. package/dist/tools/storefrontnext/site-theming/color-contrast.js +186 -0
  57. package/dist/tools/storefrontnext/site-theming/color-mapping.d.ts +16 -0
  58. package/dist/tools/storefrontnext/site-theming/color-mapping.js +131 -0
  59. package/dist/tools/storefrontnext/site-theming/guidance-merger.d.ts +11 -0
  60. package/dist/tools/storefrontnext/site-theming/guidance-merger.js +78 -0
  61. package/dist/tools/storefrontnext/site-theming/index.d.ts +14 -0
  62. package/dist/tools/storefrontnext/site-theming/index.js +122 -0
  63. package/dist/tools/storefrontnext/site-theming/response-builder.d.ts +16 -0
  64. package/dist/tools/storefrontnext/site-theming/response-builder.js +316 -0
  65. package/dist/tools/storefrontnext/site-theming/theming-store.d.ts +62 -0
  66. package/dist/tools/storefrontnext/site-theming/theming-store.js +410 -0
  67. package/dist/tools/storefrontnext/site-theming/types.d.ts +35 -0
  68. package/dist/tools/storefrontnext/site-theming/types.js +7 -0
  69. package/oclif.manifest.json +8 -5
  70. package/package.json +9 -6
  71. /package/content/{auth.md → sfnext/auth.md} +0 -0
  72. /package/content/{components.md → sfnext/components.md} +0 -0
  73. /package/content/{config.md → sfnext/config.md} +0 -0
  74. /package/content/{data-fetching.md → sfnext/data-fetching.md} +0 -0
  75. /package/content/{extensions.md → sfnext/extensions.md} +0 -0
  76. /package/content/{i18n.md → sfnext/i18n.md} +0 -0
  77. /package/content/{page-designer.md → sfnext/page-designer.md} +0 -0
  78. /package/content/{performance.md → sfnext/performance.md} +0 -0
  79. /package/content/{pitfalls.md → sfnext/pitfalls.md} +0 -0
  80. /package/content/{quick-reference.md → sfnext/quick-reference.md} +0 -0
  81. /package/content/{state-management.md → sfnext/state-management.md} +0 -0
  82. /package/content/{styling.md → sfnext/styling.md} +0 -0
  83. /package/content/{testing.md → sfnext/testing.md} +0 -0
  84. /package/dist/tools/storefrontnext/{developer-guidelines.d.ts → sfnext-development-guidelines.d.ts} +0 -0
package/README.md CHANGED
@@ -2,25 +2,16 @@
2
2
 
3
3
  MCP (Model Context Protocol) server for Salesforce B2C Commerce developer experience tools.
4
4
 
5
- > ⚠️ **Active Development**: This package is under active development. Some tools are currently **placeholder implementations** that return mock responses. Tool implementations will be added incrementally.
5
+ > [!NOTE]
6
+ > This project is currently in **Developer Preview**. Tools are functional but require `--allow-non-ga-tools` to enable. Additional tools will be added in future releases.
6
7
 
7
- ## Overview
8
+ This MCP server enables AI assistants (Cursor, Claude Desktop, and others) to help with B2C Commerce development tasks. It provides toolsets for **SCAPI**, **CARTRIDGES**, **MRT**, **PWAV3**, and **STOREFRONTNEXT** development.
8
9
 
9
- This MCP server enables AI assistants to help with B2C Commerce development tasks. It provides toolsets for **SCAPI**, **CARTRIDGES**, **MRT**, **PWAV3**, and **STOREFRONTNEXT** development.
10
+ Full documentation: [https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/)
10
11
 
11
- The server automatically detects your project type and enables relevant tools. See [Available Toolsets and Tools](#available-toolsets-and-tools) for details.
12
+ ## Installation
12
13
 
13
- ## Usage
14
-
15
- ### Project Directory and Auto-Discovery
16
-
17
- The most important flag is **`--project-directory`** (or env var `SFCC_PROJECT_DIRECTORY`). It tells the server where your project is located, enabling:
18
-
19
- 1. **Auto-discovery** - Detects your project type and enables appropriate toolsets
20
- 2. **Configuration loading** - Reads [`dw.json`](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/configuration.html#configuration-file) from your project for credentials
21
- 3. **Scaffolding** - Creates new files in the correct location
22
-
23
- > **Important:** MCP clients like Cursor and Claude Desktop spawn servers from the home directory (`~`), not your project. Always set `--project-directory`.
14
+ **Prerequisites:** Node.js 22.0.0 or higher, MCP client (Cursor, Claude Desktop, or compatible)
24
15
 
25
16
  **Cursor** (supports `${workspaceFolder}`):
26
17
 
@@ -48,411 +39,132 @@ The most important flag is **`--project-directory`** (or env var `SFCC_PROJECT_D
48
39
  }
49
40
  ```
50
41
 
51
- ### Project Type Detection
52
-
53
- The server analyzes your project directory and enables toolsets based on what it finds:
54
-
55
- | Project Type | Detection | Toolsets Enabled |
56
- |--------------|-----------|------------------|
57
- | **PWA Kit v3** | `@salesforce/pwa-kit-*`, `@salesforce/retail-react-app`, or `ccExtensibility` in package.json | PWAV3, MRT, SCAPI |
58
- | **Storefront Next** | Root or a workspace package has `@salesforce/storefront-next*` dependency, or package name starting with `storefront-next`. | STOREFRONTNEXT, MRT, CARTRIDGES, SCAPI |
59
- | **Cartridges** | `.project` file in cartridge directory | CARTRIDGES, SCAPI |
60
- | **No project detected** | No B2C markers found | SCAPI (base toolset only) |
61
-
62
- The **SCAPI** toolset is always enabled. Hybrid projects (e.g., cartridges + PWA Kit) get combined toolsets.
63
-
64
- ### Manual Toolset Selection
65
-
66
- Override auto-discovery by specifying toolsets explicitly:
67
-
68
- ```json
69
- "args": ["--project-directory", "${workspaceFolder}", "--toolsets", "CARTRIDGES,MRT", "--allow-non-ga-tools"]
70
- ```
71
-
72
- ### Prompting Tips and Examples
73
-
74
- AI assistants (like Cursor, Claude Desktop) automatically decide which MCP tools to use based on your prompts. To get the best results, use clear, specific prompts that describe what you want to accomplish.
75
-
76
- > ⚠️ **IMPORTANT**: **Explicitly mention "Use the MCP tool"** in your prompts for reliable tool usage. While AI assistants (like Cursor's Composer) can automatically select MCP tools based on context, explicit instructions ensure that the assistant prioritizes MCP tools over general knowledge, especially when multiple approaches are possible. This is particularly important for getting project-specific, up-to-date information rather than generic responses.
77
-
78
- #### Best Practices
79
-
80
- 1. **Always explicitly request MCP tool usage** (see warning above): Start prompts with "Use the MCP tool to..." or include "Use the MCP tool" in your request.
81
- 2. **Be specific about your goal**: Instead of "help me with Storefront Next", say "Use the MCP tool to show me how to build a product detail page with authentication"
82
- 3. **Mention the tool or domain explicitly**: Reference the framework (Storefront Next, PWA Kit), operation (deploy, discover), or domain (SCAPI, cartridges)
83
- 4. **Use natural language**: Describe what you want to achieve, not the tool name
84
- 5. **Provide context**: Mention your project type, what you're building, or what you need to learn
85
- 6. **Ask for guidelines first**: When starting a new project or learning a framework, ask for development guidelines before writing code
42
+ See the [Installation Guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/installation) for detailed setup.
86
43
 
87
- #### Examples by Tool Category
44
+ ## Configuration
88
45
 
89
- ##### Storefront Next Development Guidelines
46
+ Always set `--project-directory` (or `SFCC_PROJECT_DIRECTORY`). MCP clients spawn from the home directory (`~`), not your project.
90
47
 
91
- The `storefront_next_development_guidelines` tool provides critical architecture rules and best practices. **Use this tool first** when starting new Storefront Next development or when you need architecture guidance.
48
+ | Environment Variable | Description |
49
+ |---------------------|-------------|
50
+ | `SFCC_PROJECT_DIRECTORY` | Project directory (enables auto-discovery and config loading) |
51
+ | `SFCC_SERVER` | B2C instance hostname |
52
+ | `SFCC_USERNAME` | Username for WebDAV |
53
+ | `SFCC_PASSWORD` | Password/access key for WebDAV |
54
+ | `SFCC_CLIENT_ID` | OAuth client ID |
55
+ | `SFCC_CLIENT_SECRET` | OAuth client secret |
56
+ | `MRT_API_KEY` | MRT API key (`SFCC_MRT_API_KEY` also supported) |
92
57
 
93
- **Prompt examples:**
94
- - ✅ "I'm new to Storefront Next. Use the MCP tool to show me the critical rules I need to know."
95
- - ✅ "I need to build a product detail page. Use the MCP tool to show me best practices for data fetching and component patterns."
96
- - ✅ "I need to build a checkout form with authentication and validation. Use the MCP tool to show me how to handle form submissions, authentication, and internationalized error messages."
97
- - ✅ "Use the MCP tool to show me the data fetching patterns for Storefront Next."
98
- - ✅ "Show me all available Storefront Next development guidelines."
58
+ See the [Configuration Guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/configuration) for credentials, flags, and toolset selection.
99
59
 
100
- **Available sections:**
101
- - `quick-reference` - Critical rules and architecture principles (default)
102
- - `data-fetching` - Data loading patterns with loaders
103
- - `state-management` - Client-side state management
104
- - `auth` - Authentication and session management
105
- - `components` - Component patterns and best practices
106
- - `styling` - Tailwind CSS 4, Shadcn/ui, styling guidelines
107
- - `page-designer` - Page Designer integration
108
- - `performance` - Performance optimization
109
- - `testing` - Testing strategies
110
- - `i18n` - Internationalization patterns
111
- - `config` - Configuration management
112
- - `extensions` - Extension development
113
- - `pitfalls` - Common pitfalls
60
+ ## Tools
114
61
 
115
- ##### PWA Kit Development
62
+ | Toolset | Tools | Docs |
63
+ |---------|-------|------|
64
+ | CARTRIDGES | `cartridge_deploy` | [toolsets#cartridges](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/toolsets#cartridges) |
65
+ | MRT | `mrt_bundle_push` | [toolsets#mrt](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/toolsets#mrt) |
66
+ | SCAPI | `scapi_schemas_list`, `scapi_custom_apis_status`, `scapi_customapi_scaffold` | [toolsets#scapi](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/toolsets#scapi) |
67
+ | STOREFRONTNEXT | `storefront_next_development_guidelines`, `storefront_next_page_designer_decorator`, `storefront_next_site_theming`, `storefront_next_figma_to_component_workflow`, `storefront_next_generate_component`, `storefront_next_map_tokens_to_theme` | [toolsets#storefrontnext](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/toolsets#storefrontnext) |
68
+ | PWAV3 | `pwakit_development_guidelines` + SCAPI tools | [toolsets#pwav3](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/toolsets#pwav3) |
116
69
 
117
- **Prompt examples:**
118
- - ✅ "I'm starting a new PWA Kit project. Use the MCP tool to get the development guidelines."
119
- - ✅ "Use the MCP tool to create a new product listing page component in my PWA Kit project."
120
- - ✅ "Use the MCP tool to recommend React hooks for fetching product data in PWA Kit."
70
+ ### cartridge_deploy
121
71
 
122
- ##### SCAPI Discovery
72
+ Deploy cartridges to a B2C Commerce instance. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/cartridge-deploy)
123
73
 
124
- Use **scapi_schemas_list** for both standard SCAPI (Shop, Admin, Shopper APIs) and custom APIs. Use **scapi_custom_apis_status** for endpoint-level registration status (active/not_registered).
74
+ - "Use the MCP tool to deploy my cartridges to the sandbox."
75
+ - "Use the MCP tool to deploy only app_storefront_base."
125
76
 
126
- **SCAPI Schemas (tool: `scapi_schemas_list`):**
77
+ ### mrt_bundle_push
127
78
 
128
- Discover schema metadata and fetch OpenAPI specs for both standard and custom SCAPI:
79
+ Build and push bundle to Managed Runtime. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/mrt-bundle-push)
129
80
 
130
- **Standard SCAPI:**
131
- - "Use the MCP tool to list all available SCAPI schemas." list mode (no includeSchemas).
132
- - ✅ "Use the MCP tool to show me what checkout APIs exist." → list with apiFamily: checkout.
133
- - ✅ "Use the MCP tool to discover SCAPI product endpoints." → list with apiFamily: product.
134
- - ✅ "Use the MCP tool to get the OpenAPI schema for shopper-baskets v1." → fetch with apiFamily, apiName, apiVersion, includeSchemas: true.
135
- - ✅ "Use the MCP tool to show me the full OpenAPI spec for shopper-products v1." → fetch with includeSchemas: true, expandAll: true.
81
+ - "Use the MCP tool to push my Storefront Next bundle to staging."
82
+ - "Use the MCP tool to deploy my PWA Kit bundle to production."
136
83
 
137
- **Custom APIs (use apiFamily: "custom"):**
138
- - ✅ "Use the MCP tool to list custom API definitions." → list with apiFamily: custom.
139
- - ✅ "Use the MCP tool to show me the loyalty-points custom API schema." → apiFamily: custom, apiName: loyalty-points, apiVersion: v1, includeSchemas: true.
84
+ ### scapi_schemas_list
140
85
 
141
- **Custom API Endpoint Status (tool: `scapi_custom_apis_status`):**
86
+ List or fetch SCAPI schemas (standard and custom). [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/scapi-schemas-list)
142
87
 
143
- Get registration status of custom API endpoints deployed on the instance (remote only). Returns individual HTTP endpoints (e.g., GET /hello, POST /items/{id}) with registration status (active/not_registered), one row per endpoint per site. Requires OAuth with `sfcc.custom-apis` scope.
88
+ - "Use the MCP tool to list all SCAPI schemas."
89
+ - "Use the MCP tool to get the OpenAPI schema for shopper-baskets v1."
144
90
 
145
- - ✅ "Use the MCP tool to list custom SCAPI endpoints on my instance."
146
- - ✅ "Use the MCP tool to show which custom APIs are active vs not registered."
147
- - ✅ "Use the MCP tool to list custom API endpoints grouped by site." → groupBy: site
148
- - ✅ "Use the MCP tool to list custom API endpoints grouped by type." → groupBy: type
149
- - ✅ "Use the MCP tool to list only active custom API endpoints." → status: active
150
- - ✅ "Use the MCP tool to find custom API endpoints that failed to register." → status: not_registered
151
- - ✅ "Use the MCP tool to show endpoint details with all fields." → extended: true
152
- - ✅ "Use the MCP tool to show only apiName and status for active endpoints." → status: active, columns: "apiName,status"
91
+ ### scapi_custom_apis_status
153
92
 
154
- ##### Cartridge Deployment
93
+ Get custom API endpoint registration status. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/scapi-custom-apis-status)
155
94
 
156
- **Prompt examples:**
157
- - "Use the MCP tool to deploy my cartridges to the sandbox instance."
158
- - ✅ "Use the MCP tool to deploy only the app_storefront_base cartridge to production."
159
- - ✅ "Use the MCP tool to deploy cartridges from the ./cartridges directory and reload the code version."
95
+ - "Use the MCP tool to list custom API endpoints on my instance."
96
+ - "Use the MCP tool to show which custom APIs are active vs not registered."
160
97
 
161
- ##### MRT Bundle Operations
98
+ ### scapi_customapi_scaffold
162
99
 
163
- **Prompt examples:**
164
- - ✅ "Use the MCP tool to build and push my Storefront Next bundle to staging."
165
- - ✅ "Use the MCP tool to push the bundle from ./build directory to Managed Runtime."
166
- - ✅ "Use the MCP tool to deploy my PWA Kit or Storefront Next bundle to production with a deployment message."
100
+ Generate new custom SCAPI endpoint in a cartridge. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/scapi-custom-api-scaffold)
167
101
 
168
- #### Tips for Better Results
102
+ - "Use the MCP tool to scaffold a new custom API named my-products."
103
+ - "Use the MCP tool to create a custom admin API called customer-trips."
169
104
 
170
- - **Start with guidelines**: When learning a new framework, ask for development guidelines first using "Use the MCP tool to get..."
171
- - **Combine related topics**: Ask for multiple related sections (e.g., "data fetching and components") in one request
172
- - **Provide project context**: Mention your project type (Storefront Next, PWA Kit, cartridges) for better tool selection
173
- - **Specify operations clearly**: For deployment operations, mention the target (sandbox, staging, production) and what to deploy
105
+ ### storefront_next_development_guidelines
174
106
 
175
- ### Configuration
107
+ Get Storefront Next guidelines and best practices. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/storefront-next-development-guidelines)
176
108
 
177
- Credentials can be provided via **config files** (recommended), **environment variables**, or **flags**. Priority: Flags > Env vars > Config files.
109
+ - "Use the MCP tool to show me critical Storefront Next rules."
110
+ - "Use the MCP tool to get data-fetching and component patterns."
178
111
 
179
- | Toolset | Required Credentials |
180
- |---------|---------------------|
181
- | **SCAPI** | `hostname` + `client-id` + `client-secret` (for `scapi_custom_apis_status`: requires `sfcc.custom-apis` scope) |
182
- | **CARTRIDGES** | `hostname` + `username` + `password` (or OAuth) |
183
- | **MRT** | `api-key` + `project` (optionally `environment`) |
184
- | **PWAV3** | `--project-directory` only (+ MRT config for deployments) |
185
- | **STOREFRONTNEXT** | `--project-directory` only (+ MRT/CARTRIDGES config for those tools) |
186
-
187
- **Option 1: Config files (recommended)**
188
-
189
- B2C credentials — [`dw.json`](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/configuration.html#configuration-file) in your project root:
190
- ```json
191
- { "hostname": "xxx.demandware.net", "username": "...", "password": "...", "client-id": "...", "client-secret": "..." }
192
- ```
193
-
194
- MRT credentials — [`~/.mobify`](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/configuration.html#mobify-config-file) (create manually or via [B2C CLI](https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/mrt.html)):
195
- ```json
196
- { "api_key": "..." }
197
- ```
198
-
199
- **Option 2: Environment variables**
200
- ```json
201
- "env": { "SFCC_SERVER": "xxx.demandware.net", "SFCC_USERNAME": "...", "SFCC_PASSWORD": "...", "SFCC_MRT_API_KEY": "..." }
202
- ```
203
-
204
- **Option 3: Flags**
205
- ```json
206
- "args": ["--server", "xxx.demandware.net", "--username", "...", "--password", "...", "--api-key", "..."]
207
- ```
208
-
209
- See [Flag Reference](#flag-reference) for all available flags and env vars.
210
-
211
- - `username`/`password` = B2C username + [WebDAV access key](https://help.salesforce.com/s/articleView?id=cc.b2c_account_manager_sso_use_webdav_file_access.htm&type=5)
212
- - `client-id`/`client-secret` = API client credentials from Account Manager
213
-
214
- ### Flag Reference
215
-
216
- <details>
217
- <summary>Click to expand flag reference</summary>
218
-
219
- #### Core Flags
220
-
221
- | Flag | Env Variable | Description |
222
- |------|--------------|-------------|
223
- | `--project-directory` | `SFCC_PROJECT_DIRECTORY` | Project directory (enables auto-discovery and config loading) |
224
- | `--toolsets` | — | Comma-separated toolsets to enable |
225
- | `--tools` | — | Comma-separated individual tools to enable |
226
- | `--allow-non-ga-tools` | — | Enable experimental (non-GA) tools |
227
- | `--config` | — | Explicit path to [`dw.json`](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/configuration.html#configuration-file) (advanced) |
228
- | `--log-level` | — | Logging verbosity (trace, debug, info, warn, error, silent) |
229
- | `--debug` | — | Enable debug logging |
230
-
231
- #### B2C Instance Flags
232
-
233
- | Flag | Env Variable | Description |
234
- |------|--------------|-------------|
235
- | `--server` | `SFCC_SERVER` | B2C instance hostname |
236
- | `--username` | `SFCC_USERNAME` | Username for Basic auth (WebDAV) |
237
- | `--password` | `SFCC_PASSWORD` | Password/access key for Basic auth |
238
- | `--client-id` | `SFCC_CLIENT_ID` | OAuth client ID |
239
- | `--client-secret` | `SFCC_CLIENT_SECRET` | OAuth client secret |
240
- | `--code-version` | `SFCC_CODE_VERSION` | Code version for deployments |
241
-
242
- #### MRT Flags
243
-
244
- | Flag | Env Variable | Description |
245
- |------|--------------|-------------|
246
- | `--api-key` | `SFCC_MRT_API_KEY` | MRT API key |
247
- | `--project` | `SFCC_MRT_PROJECT` | MRT project slug |
248
- | `--environment` | `SFCC_MRT_ENVIRONMENT` | MRT environment (staging, production) |
249
- | `--cloud-origin` | `SFCC_MRT_CLOUD_ORIGIN` | MRT cloud origin URL |
250
-
251
- </details>
252
-
253
- ### Available Toolsets and Tools
254
-
255
- Use `--toolsets all` to enable all toolsets, or select specific ones with `--toolsets CARTRIDGES,MRT`.
256
-
257
- > **Note:** All tools are currently placeholder implementations. Use `--allow-non-ga-tools` flag to enable them.
258
-
259
- #### CARTRIDGES
260
- Cartridge development, deployment, and code version management.
261
- - **Status:** 🚧 Early Access
262
-
263
- | Tool | Description |
264
- |------|-------------|
265
- | `cartridge_deploy` | Deploy cartridges to a B2C Commerce instance |
266
-
267
- #### MRT
268
- Managed Runtime operations for PWA Kit and Storefront Next deployments.
269
- - **Status:** 🚧 Early Access
270
-
271
- | Tool | Description |
272
- |------|-------------|
273
- | `mrt_bundle_push` | Build, push bundle (optionally deploy) |
274
-
275
- #### PWAV3
276
- PWA Kit v3 development tools for building headless storefronts.
277
- - **Status:** 🚧 Placeholder
278
-
279
- | Tool | Description |
280
- |------|-------------|
281
- | `pwakit_create_storefront` | Create a new PWA Kit storefront project |
282
- | `pwakit_create_page` | Create a new page component in PWA Kit project |
283
- | `pwakit_create_component` | Create a new React component in PWA Kit project |
284
- | `pwakit_get_dev_guidelines` | Get PWA Kit development guidelines and best practices |
285
- | `pwakit_recommend_hooks` | Recommend appropriate React hooks for PWA Kit use cases |
286
- | `pwakit_run_site_test` | Run site tests for PWA Kit project |
287
- | `pwakit_install_agent_rules` | Install AI agent rules for PWA Kit development |
288
- | `scapi_schemas_list` | List or fetch SCAPI schemas (standard and custom). Use apiFamily: "custom" for custom APIs. |
289
- | `scapi_custom_apis_status` | Get registration status of custom API endpoints (active/not_registered). Remote only, requires OAuth. |
290
- | `mrt_bundle_push` | Build, push bundle (optionally deploy) |
291
-
292
- #### SCAPI
293
- Salesforce Commerce API discovery and exploration.
294
- - **Status:** 🚧 Early Access
295
-
296
- | Tool | Description |
297
- |------|-------------|
298
- | `scapi_schemas_list` | List or fetch SCAPI schemas (standard and custom). Use apiFamily: "custom" for custom APIs. |
299
- | `scapi_custom_apis_status` | Get registration status of custom API endpoints (active/not_registered). Remote only, requires OAuth. |
300
- | `scapi_customapi_scaffold` | Scaffold a new custom SCAPI API (not yet implemented) |
301
-
302
- #### STOREFRONTNEXT
303
- Storefront Next development tools for building modern storefronts.
304
- - **Status:** 🚧 Placeholder
305
-
306
- | Tool | Description |
307
- |------|-------------|
308
- | `storefront_next_development_guidelines` | Get Storefront Next development guidelines and best practices |
309
- | `storefront_next_site_theming` | Configure and manage site theming for Storefront Next |
310
- | `storefront_next_figma_to_component_workflow` | Convert Figma designs to Storefront Next components |
311
- | `storefront_next_generate_component` | Generate a new Storefront Next component |
312
- | `storefront_next_map_tokens_to_theme` | Map design tokens to Storefront Next theme configuration |
313
- | `storefront_next_page_designer_decorator` | Add Page Designer decorators to Storefront Next components |
314
- | `storefront_next_generate_page_designer_metadata` | Generate Page Designer metadata for Storefront Next components |
315
- | `scapi_schemas_list` | List or fetch SCAPI schemas (standard and custom). Use apiFamily: "custom" for custom APIs. |
316
- | `scapi_custom_apis_status` | Get registration status of custom API endpoints (active/not_registered). Remote only, requires OAuth. |
317
- | `mrt_bundle_push` | Build, push bundle (optionally deploy) |
318
-
319
- > **Note:** Some tools appear in multiple toolsets (e.g., `mrt_bundle_push`, `scapi_schemas_list`, `scapi_custom_apis_status`). When using multiple toolsets, tools are automatically deduplicated.
320
-
321
- ## Telemetry
112
+ ### storefront_next_page_designer_decorator
322
113
 
323
- The MCP server collects anonymous usage telemetry to help improve the developer experience. Telemetry is enabled by default.
114
+ Add Page Designer decorators to components. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/storefront-next-page-designer-decorator)
324
115
 
325
- **Development mode**: Telemetry is automatically disabled when using `bin/dev.js`, so local development and testing won't pollute production data.
116
+ - "Use the MCP tool to add Page Designer decorators to my component."
326
117
 
327
- ### Configuring telemetry
118
+ ### storefront_next_site_theming
328
119
 
329
- Set options in the `env` object of your server entry in `.cursor/mcp.json` or `~/.cursor/mcp.json` (the client injects these when it starts the server):
120
+ Get theming guidelines, questions, and WCAG color validation for Storefront Next. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/storefront-next-site-theming)
330
121
 
331
- - **Disable**: `SF_DISABLE_TELEMETRY=true` or `SFCC_DISABLE_TELEMETRY=true`
332
- - **Custom endpoint**: `SFCC_APP_INSIGHTS_KEY=your-key`
122
+ - "Use the MCP tool to help me apply my brand colors to my Storefront Next site."
123
+ - "Use the MCP tool to validate my color combinations for accessibility."
333
124
 
334
- ### What We Collect
125
+ ### storefront_next_figma_to_component_workflow
335
126
 
336
- - **Server lifecycle events**: When the server starts, stops, or encounters errors
337
- - **Tool usage**: Which tools are called and their execution time (not the arguments or results)
338
- - **Command metrics**: Command duration and success/failure status
339
- - **Environment info**: Platform, architecture, Node.js version, and package version
127
+ Workflow orchestrator for Figma-to-component conversion. Parses Figma URL, returns step-by-step instructions for subsequent tool calls. Requires external Figma MCP server. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/storefront-next-figma-to-component-workflow) [Figma Setup](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/figma-tools-setup)
340
128
 
341
- ### What We Don't Collect
129
+ - "Use the MCP tool to convert this Figma design to a Storefront Next component: [Figma URL with node-id]"
130
+ - "Use the MCP tool to create this homepage from the Figma design: [Figma URL with node-id]"
342
131
 
343
- - **No credentials**: No API keys, passwords, or secrets
344
- - **No business data**: No product data, customer information, or site content
345
- - **No tool arguments**: No input parameters or output results from tool calls
346
- - **No file contents**: No source code, configuration files, or project data
132
+ ### storefront_next_generate_component
347
133
 
348
- ## Development
134
+ Analyze Figma design and discovered components to recommend REUSE, EXTEND, or CREATE strategy. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/storefront-next-generate-component)
349
135
 
350
- ### Quick Start
136
+ - "Use the MCP tool to analyze the Figma design and recommend whether to reuse, extend, or create a component."
351
137
 
352
- ```bash
353
- # Install dependencies (from monorepo root)
354
- pnpm install
138
+ ### storefront_next_map_tokens_to_theme
355
139
 
356
- # Navigate to the package directory
357
- cd packages/b2c-dx-mcp
140
+ Map Figma design tokens to existing theme tokens in app.css with confidence scores and suggestions. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/storefront-next-map-tokens-to-theme)
358
141
 
359
- # Launch MCP Inspector for development (no build needed, uses TypeScript directly)
360
- pnpm run inspect:dev
142
+ - "Use the MCP tool to map these Figma design tokens to my theme."
361
143
 
362
- # Launch MCP Inspector with production build (runs build first)
363
- pnpm run inspect
144
+ ### pwakit_development_guidelines
364
145
 
365
- # Build the package
366
- pnpm run build
146
+ Get PWA Kit v3 guidelines. [Details](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/tools/pwakit-development-guidelines)
367
147
 
368
- # Run tests (includes linting)
369
- pnpm run test
148
+ - "Use the MCP tool to get PWA Kit development guidelines."
370
149
 
371
- # Format code
372
- pnpm run format
150
+ ## Prompting Tips
373
151
 
374
- # Run linter only
375
- pnpm run lint
152
+ Explicitly mention "Use the MCP tool" in your prompts for reliable tool usage. See [Prompting Tips](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/#prompting-tips) for best practices and more examples.
376
153
 
377
- # Clean build artifacts
378
- pnpm run clean
379
- ```
380
-
381
- ### Project Directory
382
-
383
- Commands should be run from the `packages/b2c-dx-mcp` directory:
384
-
385
- ```bash
386
- cd packages/b2c-dx-mcp
387
- ```
388
-
389
- Or use pnpm's filter flag from the monorepo root:
390
-
391
- ```bash
392
- pnpm --filter @salesforce/b2c-dx-mcp run <script>
393
- ```
394
-
395
- ### Testing the MCP Server Locally
396
-
397
- #### 1. MCP Inspector
398
-
399
- Use MCP Inspector to browse tools and test them in a web UI:
400
-
401
- ```bash
402
- pnpm run inspect:dev
403
- ```
404
-
405
- This runs TypeScript directly (no build needed). Open the localhost URL shown in the terminal, click **Connect**, then **List Tools** to see available tools.
406
-
407
- For CLI-based testing:
408
-
409
- ```bash
410
- # List all tools
411
- npx mcp-inspector --cli node bin/dev.js --toolsets all --allow-non-ga-tools --method tools/list
412
-
413
- # Call a specific tool
414
- npx mcp-inspector --cli node bin/dev.js --toolsets all --allow-non-ga-tools \
415
- --method tools/call \
416
- --tool-name storefront_next_page_designer_decorator
417
- ```
418
-
419
- #### 2. IDE Integration
420
-
421
- Configure your IDE to use the local MCP server. Add this to your IDE's MCP configuration:
422
-
423
- ```json
424
- {
425
- "mcpServers": {
426
- "b2c-dx-local": {
427
- "command": "node",
428
- "args": [
429
- "/full/path/to/packages/b2c-dx-mcp/bin/dev.js",
430
- "--toolsets", "all",
431
- "--allow-non-ga-tools"
432
- ]
433
- }
434
- }
435
- }
436
- ```
154
+ ## Telemetry
437
155
 
438
- > **Note:** Make sure that the script is executable: `chmod +x /full/path/to/packages/b2c-dx-mcp/bin/dev.js`
439
- >
440
- > The script's shebang (`#!/usr/bin/env -S node --conditions development`) handles Node.js setup automatically.
156
+ The MCP server collects anonymous usage telemetry by default. Disable with `SF_DISABLE_TELEMETRY=true` or `SFCC_DISABLE_TELEMETRY=true` in your MCP client's `env` config. See the [MCP documentation](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/#telemetry) for details.
441
157
 
442
- > **Note:** Restart the MCP server in your IDE to pick up code changes.
158
+ ## Documentation
443
159
 
444
- #### 3. JSON-RPC via stdin
160
+ Full documentation: [https://salesforcecommercecloud.github.io/b2c-developer-tooling/](https://salesforcecommercecloud.github.io/b2c-developer-tooling/)
445
161
 
446
- Send raw MCP protocol messages:
162
+ For MCP development, testing, and local setup, see [CONTRIBUTING.md](./CONTRIBUTING.md).
447
163
 
448
- ```bash
449
- # List all tools (--allow-non-ga-tools required for placeholder tools)
450
- echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node bin/dev.js --toolsets all --allow-non-ga-tools
164
+ ## License
451
165
 
452
- # Call a specific tool
453
- echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"cartridge_deploy","arguments":{}}}' | node bin/dev.js --toolsets all --allow-non-ga-tools
454
- ```
166
+ This project is licensed under the Apache License 2.0. See [LICENSE.txt](../../LICENSE.txt) for full details.
455
167
 
456
- ## License
168
+ ## Disclaimer
457
169
 
458
- Apache-2.0
170
+ This project is currently in **Developer Preview** and is provided "as-is" without warranty of any kind. It is not yet generally available (GA) and should not be used in production environments. Features, APIs, and functionality may change without notice in future releases.