| description | Install and configure the B2C DX MCP Server for Claude Code, Cursor, GitHub Copilot, and other MCP clients. |
|---|
This guide covers installing and configuring the B2C DX MCP Server for various MCP clients.
- Node.js 22.0.0 or higher
- A B2C Commerce project (for project-specific toolsets)
- MCP client (Claude Code, Cursor, GitHub Copilot, or compatible client)
Note: For Figma-to-component tools, you also need an external Figma MCP server enabled. See Figma-to-Component Tools Setup for details.
The MCP server is installed via npx, which downloads and runs the latest version on demand. For project directory and project type detection details, see MCP Server Overview.
Claude Code supports MCP servers via CLI installation:
::: code-group
cd /path/to/your/project
claude mcp add --transport stdio --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest --allow-non-ga-toolsclaude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp --scope projectclaude mcp add --transport stdio --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest --allow-non-ga-tools:::
See the Claude Code MCP documentation for details on scope options and configuration.
Cursor supports project-level configuration via .cursor/mcp.json in your project root.
Project-level configuration automatically detects your project location and can be shared with your team via version control.
- Create or edit
.cursor/mcp.jsonin your project root - Add the following configuration:
{
"mcpServers": {
"b2c-dx-mcp": {
"command": "npx",
"args": ["-y", "@salesforce/b2c-dx-mcp@latest", "--allow-non-ga-tools"]
}
}
}- Restart Cursor or reload the MCP server
With project-level configuration, the server automatically detects your project location without requiring the --project-directory flag. See the Cursor MCP documentation for details.
Alternatively, use the "Add to Cursor" link to add to user-level configuration:
Add to Cursor
Manual Configuration (Windows or if link doesn't work):
- Open or create
~/.cursor/mcp.json(on Windows:C:\Users\<your-username>\.cursor\mcp.json) - Add the following configuration:
{
"mcpServers": {
"b2c-dx-mcp": {
"command": "npx",
"args": ["-y", "@salesforce/b2c-dx-mcp@latest", "--project-directory", "${workspaceFolder}", "--allow-non-ga-tools"]
}
}
}Note: Cursor uses
"mcpServers"as the top-level key. For GitHub Copilot/VS Code, use"servers"instead (see GitHub Copilot section). The${workspaceFolder}variable automatically expands to your current workspace, so no manual updates are needed when switching projects.
GitHub Copilot supports MCP servers via configuration in your workspace. See the GitHub Copilot MCP documentation for setup instructions.
Copilot supports project-level configuration. Create the MCP config file in your workspace (.vscode/mcp.json):
{
"servers": {
"b2c-dx-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@salesforce/b2c-dx-mcp@latest", "--allow-non-ga-tools"]
}
},
"inputs": []
}Note: GitHub Copilot/VS Code uses
"servers"(not"mcpServers") and requires"type": "stdio"for stdio-based servers. The"inputs"array is optional but included for consistency with VS Code's format.
With project-level configuration, the server automatically detects your project location.
- Verify Node.js version:
node --version(must be 22.0.0+) - Check that
npxis available and working
This error occurs when npx uses a cached broken version (0.0.1) instead of the latest version. npx's cache-first behavior can reuse an older cached version even when newer versions are available.
Solution:
-
Update your MCP configuration to use
@latest:{ "mcpServers": { "b2c-dx-mcp": { "command": "npx", "args": ["-y", "@salesforce/b2c-dx-mcp@latest", "--allow-non-ga-tools"] } } } -
Clear the npx cache if the issue persists:
npm cache clean --force
Prevention: Always use @latest in your MCP configuration to ensure npx fetches the latest version from the registry instead of using cached versions.
- Ensure
--allow-non-ga-toolsflag is included (required for preview tools) - Verify project type detection by checking your
package.jsonor project structure - If using user-level Cursor configuration, ensure
--project-directory "${workspaceFolder}"is included
- Ensure
dw.jsonexists in your project root - Verify you're using project-level configuration (recommended)
- Check file permissions on
dw.json
- Configuration - Configure credentials, flags, and toolset selection
- Toolsets & Tools - Explore available toolsets and tools
- MCP Server Overview - Learn more about the MCP server