Install AI Tools

B2C Commerce tools, documentation, and skills for your assistant.

Claude

Using Claude Desktop? See Claude Desktop (Cowork) setup.

Install the plugin Recommended

bash
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp@b2c-developer-tooling

Start a new Claude Code session. To install for the current project only, run it from your project directory with --scope project.

Turn on auto-update

Claude Code does not auto-update third-party marketplaces by default, so installed plugins stay on the version you installed. To get new releases automatically, run /plugin, open Marketplaces, select b2c-developer-tooling, and choose Enable auto-update. Claude Code then checks for updates when a session starts; run /reload-plugins or start a new session to load them.

Manual MCP setup
bash
claude mcp add --transport stdio --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. To configure the current project only, run it from your project directory with --scope project. See Claude Code MCP setup.

Codex/ChatGPT

Using the ChatGPT desktop app (ChatGPT Work)? See ChatGPT Work setup.

Install the plugin Recommended

bash
codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
codex plugin add b2c-dx-mcp@b2c-developer-tooling

Start a new Codex session in your project. Codex plugins also work in ChatGPT Work.

Manual MCP setup
bash
codex mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Or add this to ~/.codex/config.toml (or $CODEX_HOME/config.toml if customized):

toml
[mcp_servers.b2c-dx-mcp]
command = "npx"
args = ["-y", "@salesforce/b2c-dx-mcp@latest"]

Start a new session. See Codex MCP configuration.

VS Code

Install the plugin Recommended

  1. Open the Command Palette (Cmd/Ctrl+Shift+P) and run Chat: Install Plugin from Source.
  2. Enter SalesforceCommerceCloud/b2c-developer-tooling.
  3. Select b2c-dx-mcp and follow the installation prompts.
  4. Start a new chat in GitHub Copilot.
Manual MCP setup

Add this to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "b2c-dx-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

See VS Code MCP setup.

Copilot CLI setup

Cursor

Reload the MCP server in Cursor after installation.

Manual MCP setup

Add this to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "b2c-dx-mcp": {
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

For all projects, use ~/.cursor/mcp.json instead.

See Cursor's MCP documentation.

OpenCode

Add this to opencode.json in your project:

json
{
  "mcp": {
    "b2c-dx-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@salesforce/b2c-dx-mcp@latest"],
      "enabled": true
    }
  }
}

Restart OpenCode. For all projects, use ~/.config/opencode/opencode.json. See OpenCode MCP setup.

Gemini

Run:

bash
gemini mcp add --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new Gemini CLI session. To configure the current project only, run it from your project directory with --scope project. See Gemini CLI MCP setup.

No separate skills plugins needed.

Other clients and manual setup →
Skip to content
View as Markdown
View as Markdown

Project Commands ​

Preview

The project commands are a preview. Output fields, including --json output, and flags may change before they are stable.

Inspect the server-side entry points of a project from its source: which controller endpoints exist, what runs for each request and which cartridge it comes from, which hooks are registered and in what order, how Custom APIs are wired, and which custom job steps exist. The commands read the cartridges under the project directory (--project-directory, or the current directory; folders with a .project file), need no instance or credentials, and support --json for scripts and AI assistants.

Cartridge order ​

Results follow your cartridge path, the same order the platform uses for */cartridge/... requires and module.superModule. The order comes from the first of these that's available:

  1. The cartridges value in dw.json or SFCC_CARTRIDGES.
  2. A site's cartridge path from a site import in the project (sites/<site-id>/site.xml, for example in a site template or a migration). When there are several, the newest one is used. With several sites, set siteId (or SFCC_SITE_ID) to choose one.
  3. The order the cartridges are found on disk, with app_storefront_base and modules last.

b2c project index shows which one it used. For accurate results, set cartridges to your site's cartridge path. The CLI doesn't read the cartridge path from the instance; the MCP project tools can.

Only cartridges on the path are used: the site doesn't run the others, so their controllers, overlays, hooks, Custom APIs, and job steps are left out, and b2c project index lists them as not on the path. Pass --all-cartridges to any b2c project command to include them after the path cartridges, as if the site ran them all. With a guessed order, every cartridge is used.

List commands are for finding things quickly; b2c project endpoints get drills into one endpoint.

b2c project endpoints list ​

List storefront controller endpoints (SFRA routes and SiteGenesis guard actions) with the methods they accept, the cartridge that serves each one, and the cartridges that change it. SFRA routes are composed across cartridges (server.extend(module.superModule) with append, prepend, and replace), so each row shows the endpoint as it is served.

Usage ​

bash
b2c project endpoints list [filter]

Arguments ​

ArgumentDescriptionRequired
filterOnly endpoints whose ID contains this text (case-insensitive)No

Flags ​

FlagDescriptionDefault
--cartridgeOnly endpoints this cartridge defines or changes
--usesOnly endpoints whose middleware includes this text, such as userLoggedIn or csrf
--extended, -xAlso show the middleware, as written in the controller, and the file that defines the routefalse

With --json, each endpoint has id, kind, methods, cartridge, cartridges (every cartridge that builds the route), middleware, relPath, line, and file.

Examples ​

bash
b2c project endpoints list
b2c project endpoints list Cart-
b2c project endpoints list --cartridge int_paypal
b2c project endpoints list --uses csrfProtection.validateAjaxRequest
b2c project endpoints list --json

b2c project endpoints get ​

Show what runs for one endpoint:

  • Runs: the middleware and handlers in order, the cartridge each comes from, whether server.prepend or server.append added it, and where each middleware is implemented.
  • Route event listeners: code registered with this.on('route:BeforeComplete', ...) (or route:Complete, route:Redirect), in the order it runs, marked conditional when it's registered only in some cases. route:BeforeComplete listeners run after the last step, just before the response is rendered, so they're easy to miss when reading the route.
  • Defined by: the statements across cartridges that built the route, including what a server.replace() removed.

Usage ​

bash
b2c project endpoints get <id>

Example ​

text
$ b2c project endpoints get Cart-AddCoupon
Cart-AddCoupon (SFRA)
  Served by:  cartridges/app_storefront_base/cartridge/controllers/Cart.js:535
  Accepts:    GET · HTTPS required · login not required · CSRF middleware

Runs (in order):
   1. server.middleware.get — GET only                          app_storefront_base   .../Cart.js:535
   2. server.middleware.https — HTTPS required                  app_storefront_base   .../Cart.js:537
   3. csrfProtection.validateAjaxRequest — CSRF check (AJAX)    app_storefront_base   .../Cart.js:538  → .../scripts/middleware/csrf.js:36
   4. Handler                                                   app_storefront_base   .../Cart.js:539

Defined by:
  server.get      app_storefront_base   .../Cart.js:535

IDs are matched case-insensitively. With --json, the result has the full endpoint (with chain, events, and steps) and its issues.

b2c project hooks list ​

List hook registrations by extension point, in cartridge path order.

  • System extension points (dw.*, including OCAPI/SCAPI hooks such as dw.ocapi.shop.basket.afterPOST): registrations run in cartridge path order, and the first one that returns a value (such as a Status) skips the later registrations and the system implementation. The command flags OCAPI/SCAPI hooks that can return a value, and any system hook that would skip later registrations. When the last registration of another system hook (such as dw.order.calculate) returns a value, it is noted as replacing the system implementation.
  • Custom extension points: every registration runs, whatever it returns. The caller chooses the function (HookMgr.callHook(name, functionName, ...)), so the command lists the script's exported functions, then each function the project calls with its line and number of callers.

With --json, each registration includes registeredIn (the hooks.json file and line) and, for custom hooks, calledFunctions (each function the project calls, with its line and call sites).

Usage ​

bash
b2c project hooks list [filter]
FlagDescriptionDefault
--issuesOnly extension points or registrations with issuesfalse

Examples ​

bash
b2c project hooks list
b2c project hooks list dw.ocapi.shop.basket
b2c project hooks list --issues --json

b2c project apis list ​

List Custom API endpoints from each cartridge's rest-apis/<api>/api.json, joined with the operation in schema.yaml (method, path, security scheme, and scopes) and the implementing function. Problems are reported: no operation with the endpoint's operationId, a missing implementation script or export, a missing .public = true, and APIs defined in more than one cartridge.

Usage ​

bash
b2c project apis list [filter]
FlagDescriptionDefault
--issuesOnly APIs or endpoints with problemsfalse
--extended, -xShow the implementation file and linefalse

b2c project job-steps list ​

List custom job steps registered in each cartridge's steptypes.json, with their kind (task or chunk), parameters, and the module and function that implement them. Steps whose module can't be found or doesn't export the function are flagged.

Usage ​

bash
b2c project job-steps list [filter]
FlagDescriptionDefault
--cartridgeOnly step types registered by this cartridge
--extended, -xShow the implementing file, function, and linefalse

With --json, each step has typeId, kind, cartridge, module, function, description, registeredIn, implementationFile, parameters, and problems.

b2c project index ​

Build the whole project index and print a summary, or write it as JSON. The index lists controller endpoints with their composed middleware chains and the statements that built them, hooks, Custom APIs, and custom job step types. The same index drives the route rules in b2c security scan and the VS Code Endpoints view, and is available to Node.js programs as @salesforce/b2c-tooling-sdk/project-index.

Usage ​

bash
b2c project index [paths...]
ArgumentDescription
pathsAdditional directories to search for cartridges (the project directory always is)
FlagDescription
--outputWrite the index JSON to this file

Examples ​

bash
b2c project index
b2c project index --json
b2c project index --output project-index.json