Skip to content

Commit f3846fc

Browse files
committed
Update readme for npx
1 parent c3b1a91 commit f3846fc

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Use GitHub Issues page to submit issues, enhancement requests and discuss ideas.
4242
If you're new to our project and looking for some way to make your first contribution, look for
4343
Issues labelled `good first contribution`.
4444

45+
# Running the MCP server from source
46+
47+
When developing the B2C DX MCP package (`packages/b2c-dx-mcp`), use `node` with the path to `bin/dev.js` in args. Build to latest (`pnpm run build` from the repo root) so auto-discovery works.
48+
4549
# Contribution Checklist
4650

4751
- [x] Clean, simple, well styled code

packages/b2c-dx-mcp/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ The most important flag is **`--working-directory`** (or env var `SFCC_WORKING_D
2222

2323
> **Important:** MCP clients like Cursor and Claude Desktop spawn servers from the home directory (`~`), not your project. Always set `--working-directory`.
2424
25-
When using `"command": "node"`, the shebang in `bin/dev.js` is not run, so the server loads from built `dist/`. **Build the project to latest** (`pnpm run build` from the repo root) so auto-discovery works. Without a fresh build, auto-discovery can fail—notably **Storefront Next** in monorepos like [storefront-next](https://github.com/SalesforceCommerceCloud/storefront-next), because that detector is the only one that walks workspace packages. Optional: add `"env": { "NODE_OPTIONS": "--conditions development" }` to run from source instead (no build needed).
26-
27-
<!-- TODO: Update command to use npx once published to npm -->
28-
2925
**Cursor** (supports `${workspaceFolder}`):
3026

3127
```json
3228
{
3329
"mcpServers": {
3430
"b2c-dx": {
35-
"command": "node",
36-
"args": ["/path/to/packages/b2c-dx-mcp/bin/dev.js", "--working-directory", "${workspaceFolder}", "--allow-non-ga-tools"]
31+
"command": "npx",
32+
"args": ["-y", "@salesforce/b2c-dx-mcp", "--working-directory", "${workspaceFolder}", "--allow-non-ga-tools"]
3733
}
3834
}
3935
}
@@ -45,8 +41,8 @@ When using `"command": "node"`, the shebang in `bin/dev.js` is not run, so the s
4541
{
4642
"mcpServers": {
4743
"b2c-dx": {
48-
"command": "node",
49-
"args": ["/path/to/packages/b2c-dx-mcp/bin/dev.js", "--working-directory", "/path/to/your/project", "--allow-non-ga-tools"]
44+
"command": "npx",
45+
"args": ["-y", "@salesforce/b2c-dx-mcp", "--working-directory", "/path/to/your/project", "--allow-non-ga-tools"]
5046
}
5147
}
5248
}

0 commit comments

Comments
 (0)