Install AI Tools

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

Claude

Install the plugin Recommended

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

Start a new Claude Code session in your project. Use --scope user instead for all projects.

Manual MCP setup

From your project directory:

bash
claude mcp add --transport stdio --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. Use --scope user instead for all projects. See Claude Code MCP setup.

Claude Desktop setup

Codex

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. This setup also works with the Codex IDE extension and the ChatGPT Work desktop app.

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.

ChatGPT online setup

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

From your project directory, run:

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

Start a new Gemini CLI session. Use --scope user instead for all projects. See Gemini CLI MCP setup.

No separate skills plugins needed.

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

Storefront Next

Develop and operate your Storefront Next storefront with the B2C CLI and your AI assistant. Manage environment variables together, investigate runtime errors, and get help with routing, data fetching, and Page Designer components.

Start with Storefront Setup

Use storefront setup in Business Manager to create your storefront and its API clients, Managed Runtime project, default environment, and initial configuration. Follow the Salesforce guide for your source-code workflow:

Use the generated configuration for local development and the existing MRT resources for the operations below. For additional environments and production launch, follow Launch Your Storefront Next.

Prerequisites

Use an existing Storefront Next project and an MRT API key with access to its project and target environment. See CLI installation and MRT configuration for credentials and defaults. You can also replace b2c in these examples with npx @salesforce/b2c-cli.

Replace my-storefront and staging with your MRT project and environment IDs.

Manage Environment Variables

Storefront setup configures the initial MRT variables. Use the CLI to inspect or change selected values as your storefront evolves. Salesforce's Environment Variables guide covers naming, visibility, and supported configuration paths.

The toolkit can also use common Storefront Next project variables as local CLI, MCP, and IDE configuration. See Storefront Next configuration compatibility for the supported mappings and precedence.

Update Several Values Together

bash
# Inspect the target environment's variables.
b2c mrt env var list --project my-storefront --environment staging

# Set locale defaults together in one update.
b2c mrt env var set \
  PUBLIC__app__i18n__fallbackLng=en-US \
  'PUBLIC__app__i18n__supportedLngs=["en-US","fr-FR"]' \
  --project my-storefront --environment staging

Use locales supported by your storefront and sites. Variable changes redeploy the environment; wait for that deployment before checking the result. Keep secrets out of PUBLIC__ variables, which are exposed to the browser.

Apply an Environment File

Keep the values intended for each MRT environment in a separate file. Review the proposed changes before applying them:

bash
b2c mrt env var push --file .env.staging \
  --project my-storefront --environment staging

The command compares the file with the target, shows the differences, and asks for confirmation. It leaves remote variables absent from the file unchanged and excludes MRT_ variables by default. Review local-only values and instance-specific credentials before sharing configuration across environments; keep files containing secrets out of source control.

See MRT environment variable commands for individual updates, removal, and file options.

Tail Application Logs

Stream logs while reproducing a server-rendering error or checking a deployment:

bash
b2c mrt tail-logs --project my-storefront --environment staging

# Show errors and warnings.
b2c mrt tail-logs --project my-storefront --environment staging \
  --level ERROR --level WARN

# Match an error or request pattern.
b2c mrt tail-logs --project my-storefront --environment staging \
  --search 'timeout|500'

Press Ctrl+C to stop. See Logging in Storefront Next for application logging conventions. For historical investigation across MRT, SLAS, and eCDN, follow Debug Your Storefront Next Site Using Log Center.

Work with Deployments

For source builds and uploads, follow the Storefront Next deployment workflow using the template's push package script (sfnext push). It uses the MRT resources created during setup.

Use the B2C CLI to inspect uploaded bundles or deploy an existing bundle to a selected environment:

bash
b2c mrt bundle list --project my-storefront

# Deploy a reviewed bundle; replace 12345 with its ID.
b2c mrt bundle deploy 12345 --project my-storefront --environment staging

For release automation, see MRT commands and CI/CD with GitHub Actions. For vanity domains, routing, and access-control headers, use the Storefront Next launch guide alongside the eCDN commands.

Work with Your AI Assistant

The B2C MCP includes Storefront Next skills for routing, data fetching, configuration, Page Designer, testing, and deployment. Your assistant can use that guidance alongside documentation search and the toolkit's operations. No separate skills installation is needed; standalone Agent Skills are also available.

Example prompt

Review my Storefront Next project's configuration and the staging MRT environment. Identify differences relevant to this deployment and explain the proposed changes before applying them.

Example prompt

Add a Page Designer component with an editable heading, image, and link. Follow the patterns in this Storefront Next project and explain how to preview it.

Your assistant can stream live MRT logs through the MCP. MRT environment-variable management uses the B2C CLI, so make it available for those changes.

Next Steps