---
description: Connect your AI assistant to B2C Commerce tools, documentation, skills, and APIs.
---

# MCP (Model Context Protocol)

The B2C MCP server connects your AI assistant to Salesforce B2C Commerce tools,
documentation, and workflow skills. Build and debug storefronts, deploy code,
and manage your sites through requests in your assistant.

Your assistant can find and read guidance from our B2C Commerce, B2C CLI,
operations runbooks, and Storefront Next [skill collections](../guide/agent-skills) through the
[`skills_read` tool](./toolsets#documentation), MCP resources, or the
[MCP Skills extension](./toolsets#documentation) in assistants that support it.
**No separate skills installation is needed.** Documentation and skills work without B2C Commerce credentials;
connected tasks use your existing [B2C configuration](../guide/configuration).

## Set up your assistant {#setup}

Choose your assistant. **Plugin installation is recommended where supported**;
manual setup includes the same tools, documentation, and skills.
Our plugins use the open [Agent Plugins standard](https://agent-plugins.org/).

<AssistantInstall sync-url>

<template #claude>

Using Claude Desktop? See [Claude Desktop (Cowork) setup](/guide/desktop-assistants#claude-cowork).

**Install the plugin** <span class="recommended VPBadge">Recommended</span>

```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`.

<details class="details custom-block" data-setup-anchor="claude-manual">
<summary>Manual MCP setup</summary>

```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](https://code.claude.com/docs/en/mcp).

</details>


</template>
<template #codex>

Using the ChatGPT desktop app (ChatGPT Work)? See [ChatGPT Work setup](/guide/desktop-assistants#chatgpt-work).

**Install the plugin** <span class="recommended VPBadge">Recommended</span>

```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.

<details class="details custom-block" data-setup-anchor="codex-manual">
<summary>Manual MCP setup</summary>

```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](https://developers.openai.com/codex/mcp/).

</details>


</template>
<template #copilot>

<McpInstallButtons client="vscode" />

**Install the plugin** <span class="recommended VPBadge">Recommended</span>

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.

<details class="details custom-block" data-setup-anchor="vscode-manual">
<summary>Manual MCP setup</summary>

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](https://code.visualstudio.com/docs/copilot/customization/mcp-servers).

</details>

[Copilot CLI setup](/mcp/#copilot-cli)


</template>
<template #cursor>

<McpInstallButtons client="cursor" />

Reload the MCP server in Cursor after installation.

<details class="details custom-block" data-setup-anchor="cursor-manual">
<summary>Manual MCP setup</summary>

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.

</details>

See [Cursor's MCP documentation](https://cursor.com/docs/context/mcp).


</template>
<template #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](https://opencode.ai/docs/mcp-servers/).


</template>
<template #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](https://geminicli.com/docs/tools/mcp-server/).


</template>


</AssistantInstall>

For Claude Desktop (Cowork) and the ChatGPT desktop app (ChatGPT Work), see [Desktop Assistants](../guide/desktop-assistants).
For [Copilot CLI](#copilot-cli), [ChatGPT online](#chatgpt), and other clients, see [Other clients](#other-clients).

## B2C Commerce documentation

Ask your assistant to find and explain Salesforce documentation for the task
at hand. Search spans the Script API, storefront and API guides, standard job
steps, XML schemas, and Salesforce Help for administration and merchandising.
Get help understanding code, planning a site change, or checking Business Manager
settings, with links to the relevant references. No B2C Commerce credentials are needed.

<ExamplePrompt>

> How do promotion exclusivity and rank affect which discounts a shopper receives? Explain with an example and link to the Salesforce documentation.

</ExamplePrompt>

[Explore documentation search](./toolsets#documentation). Also available through
the [B2C CLI](../cli/docs).

## Developer Tasks

- **Build:** find platform documentation and apply B2C Commerce development patterns.
- **Debug:** investigate logs and inspect live cartridge execution with breakpoints, variables, and call stacks.
- **Deploy:** upload whole cartridges or selected code files and publish Managed Runtime storefront bundles.

<ExamplePrompt>

> This controller returns the wrong result in my sandbox. Help me find the cause while I reproduce the issue.

</ExamplePrompt>

[Debug with your assistant](../guide/script-debugger#debug-with-your-assistant).
Breakpoints pause requests; use a sandbox for debugging.

[![Claude Code using the B2C MCP debugger to investigate why a loyalty controller returns before calling its service, with breakpoints in loyalty.js.](/terminal/mcp-claude-debugging.png)](/terminal/mcp-claude-debugging.png)

## Administrator and Merchant Tasks

[SCAPI code mode](./toolsets#scapi-code-mode) covers nearly 600 Salesforce Commerce API operations.
Review campaigns and promotions, investigate job failures, or create products and assign catalog categories.

Included [operations runbooks](../guide/operations) help your assistant review
scheduled work, investigate checkout failures, and prepare evidence for your
administrator, developer, integration provider, or Salesforce Support.
Review successful and failed job runs, inspect execution steps and logs, check
active code versions and site cartridge paths, and [transfer instance files](./toolsets#webdav)
without a separate CLI installation.

<ExamplePrompt>

> Were there any problems with last night's jobs on my site? Let me know what needs attention.

</ExamplePrompt>

<ExamplePrompt>

> Summarize the promotions in campaign spring-sale. Flag schedule conflicts and disabled promotions.

</ExamplePrompt>

[![ChatGPT reviewing MarketStreet promotions, summarizing four campaigns, and highlighting disabled promotions and potential schedule conflicts.](/screenshots/mcp-promotions-review.png)](/screenshots/mcp-promotions-review.png)

Standard and custom Admin APIs support live requests, and Shopper APIs run as a guest shopper with your SLAS client.

[CIP analytics](./toolsets#cip) helps explain sales changes, uncover search and
promotion opportunities, and investigate API performance. Ask for a ready-to-use
report or a custom analysis without setting up the CLI or a separate SQL client.

<ExamplePrompt>

> How did daily sales and average order value compare with the previous week?

</ExamplePrompt>

## Configuration and access

Connected tasks use your [B2C Commerce configuration](../guide/configuration) and account permissions.
Deploying code and reading logs need only your instance hostname: your assistant asks you to
sign in with your Account Manager account the first time.
With [Safety Mode](../guide/safety), keep investigations read-only or review
selected data changes before your assistant makes them. The CLI and IDE Extension
use the same settings.
See [authentication](../guide/authentication) for credential setup and [Security and Access](./security)
for approvals, credential handling, and Safety Mode.

The default installation includes all toolsets. [Advanced configuration](./configuration#toolset-selection)
lets you choose specific tools or toolsets for manual installations.

## Tools and skills

Browse [MCP Tools](./toolsets) for capabilities and tool names, or [Agent Skills](../guide/agent-skills)
for the included collections, optional additions, and standalone installation.

Optional [project instructions](../guide/project-setup#give-your-assistant-project-context)
can help your assistant recognize when to use B2C tools and skills.

## Other clients {#other-clients}

### Copilot CLI {#copilot-cli}

Install the plugin:

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


Start a new Copilot session in your project.

::: details Manual MCP setup

```bash
copilot mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest
```

:::

See [Copilot CLI MCP setup](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers).

### ChatGPT online {#chatgpt}

ChatGPT online uses a separate connection from the desktop apps. To connect this local MCP server,
follow OpenAI's [Secure MCP Tunnel setup](https://developers.openai.com/api/docs/guides/secure-mcp-tunnels)
and configure a stdio server with:

| Setting   | Value                              |
| --------- | ---------------------------------- |
| Command   | `npx`                              |
| Arguments | `-y @salesforce/b2c-dx-mcp@latest` |

The tunnel requires OpenAI Platform permissions and access to ChatGPT developer mode.
Follow [OpenAI's ChatGPT connection instructions](https://developers.openai.com/apps-sdk/deploy/connect-chatgpt/)
to select your tunnel. Keep the tunnel client running on the machine with your
[B2C Commerce configuration](./configuration).

### Other MCP clients {#other-mcp-clients}

Add a **local / stdio** server using your client's MCP settings:

| Setting   | Value                              |
| --------- | ---------------------------------- |
| Name      | `b2c-dx-mcp`                       |
| Command   | `npx`                              |
| Arguments | `-y @salesforce/b2c-dx-mcp@latest` |

For clients that accept an `mcpServers` configuration:

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


Clients use different configuration locations and formats. Their setup guides
cover where to register the server:

| Client                 | Setup guide                                                               |
| ---------------------- | ------------------------------------------------------------------------- |
| Windsurf               | [Cascade MCP settings](https://docs.windsurf.com/windsurf/cascade/mcp)    |
| Cline                  | [MCP servers](https://docs.cline.bot/mcp/mcp-overview)                    |
| JetBrains AI Assistant | [MCP configuration](https://www.jetbrains.com/help/ai-assistant/mcp.html) |
| Zed                    | [MCP servers](https://zed.dev/docs/ai/mcp)                                |
| Amp                    | [MCP configuration](https://ampcode.com/manual)                           |
| Warp                   | [MCP servers](https://docs.warp.dev/knowledge-and-collaboration/mcp)      |

Restart the connection after configuration. Clients that accept only a remote
server URL need a compatible bridge or tunnel; this package runs locally.

<details class="details custom-block">
<summary>Windows manual setup</summary>

If your client cannot launch `npx` on Windows, use `cmd` with these arguments
in its manual server configuration:

```json
"command": "cmd",
"args": ["/c", "npx", "-y", "@salesforce/b2c-dx-mcp@latest"]
```

For clients with a command array, such as OpenCode, use
`["cmd", "/c", "npx", "-y", "@salesforce/b2c-dx-mcp@latest"]`.

</details>

## Updates and customization

Use your client's plugin update controls to update a plugin installation, then
start a new session. For direct installations, `@latest` follows the current npm
release; use a specific version when your team needs a fixed version.

The default installation includes all toolsets. If you want a smaller selection
or a fixed configuration, see [advanced manual configuration](./configuration#advanced-manual-configuration).
Choose one installation method per client to avoid duplicate B2C servers.

## Troubleshooting

| Problem                   | What to check                                                                                                                                |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Server does not start     | Run `node --version` and `npx --version` in the environment launching your client.                                                           |
| `spawn npx ENOENT`        | The client cannot find Node.js. Launch the editor from your terminal or configure the absolute path to `npx` in a direct installation.       |
| Plugin is unavailable     | Update the client and check whether your organization permits the marketplace. Direct setup is available if plugins are not supported.       |
| Wrong project or instance | Specify the intended project or named instance in your request. Check [configuration defaults](./configuration#project-directory) if needed. |
| Authentication fails      | Check the access needed for the [capability](./toolsets), then follow [authentication setup](../guide/authentication).                       |
