Skip to content

Commit 838d654

Browse files
committed
update readme and format
1 parent 6ec60bc commit 838d654

11 files changed

Lines changed: 58 additions & 34 deletions

File tree

packages/b2c-dx-mcp/README.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,44 @@ Add to `claude_desktop_config.json`:
108108

109109
### Available Toolsets
110110

111-
- **CARTRIDGES** - Code deployment and version management
112-
- **MRT** - Managed Runtime operations
113-
- **PWAV3** - PWA Kit v3 development tools
114-
- **STOREFRONTNEXT** - Storefront Next development tools
111+
| Toolset | Description |
112+
|---------|-------------|
113+
| `CARTRIDGES` | Code deployment and version management |
114+
| `MRT` | Managed Runtime operations |
115+
| `PWAV3` | PWA Kit v3 development tools |
116+
| `SCAPI` | Salesforce Commerce API discovery and exploration |
117+
| `STOREFRONTNEXT` | Storefront Next development tools |
115118

116119
Use `--toolsets all` to enable all available toolsets.
117120

121+
### Available Tools
122+
123+
| Tool | Description | Toolsets |
124+
|------|-------------|----------|
125+
| `code_upload` | Upload cartridges to a B2C Commerce instance | CARTRIDGES |
126+
| `code_list` | List all code versions on a B2C Commerce instance | CARTRIDGES |
127+
| `code_activate` | Activate a code version on a B2C Commerce instance | CARTRIDGES |
128+
| `mrt_bundle_push` | Deploy a bundle to Managed Runtime | MRT, PWAV3, STOREFRONTNEXT |
129+
| `pwakit_create_storefront` | Create a new PWA Kit storefront project | PWAV3 |
130+
| `pwakit_create_page` | Create a new page component in PWA Kit project | PWAV3 |
131+
| `pwakit_create_component` | Create a new React component in PWA Kit project | PWAV3 |
132+
| `pwakit_get_dev_guidelines` | Get PWA Kit development guidelines and best practices | PWAV3 |
133+
| `pwakit_recommend_hooks` | Recommend appropriate React hooks for PWA Kit use cases | PWAV3 |
134+
| `pwakit_run_site_test` | Run site tests for PWA Kit project | PWAV3 |
135+
| `pwakit_install_agent_rules` | Install AI agent rules for PWA Kit development | PWAV3 |
136+
| `pwakit_explore_scapi_shop_api` | Explore SCAPI Shop API endpoints and capabilities | PWAV3 |
137+
| `scapi_discovery` | Discover available SCAPI endpoints and capabilities | PWAV3, SCAPI, STOREFRONTNEXT |
138+
| `scapi_customapi_scaffold` | Scaffold a new custom SCAPI API | SCAPI |
139+
| `scapi_custom_api_discovery` | Discover custom SCAPI API endpoints | PWAV3, SCAPI, STOREFRONTNEXT |
140+
| `sfnext_development_guidelines` | Get Storefront Next development guidelines and best practices | STOREFRONTNEXT |
141+
| `sfnext_site_theming` | Configure and manage site theming for Storefront Next | STOREFRONTNEXT |
142+
| `sfnext_figma_to_component_workflow` | Convert Figma designs to Storefront Next components | STOREFRONTNEXT |
143+
| `sfnext_generate_component` | Generate a new Storefront Next component | STOREFRONTNEXT |
144+
| `sfnext_map_tokens_to_theme` | Map design tokens to Storefront Next theme configuration | STOREFRONTNEXT |
145+
| `sfnext_design_decorator` | Apply design decorators to Storefront Next components | STOREFRONTNEXT |
146+
| `sfnext_generate_page_designer_metadata` | Generate Page Designer metadata for Storefront Next components | STOREFRONTNEXT |
147+
148+
118149
## Development
119150

120151
### Quick Start
@@ -123,19 +154,22 @@ Use `--toolsets all` to enable all available toolsets.
123154
# Install dependencies (from monorepo root)
124155
pnpm install
125156

126-
# Build
157+
# Navigate to the package directory
158+
cd packages/b2c-dx-mcp
159+
160+
# Build the package
127161
pnpm run build
128162

129163
# Run tests (includes linting)
130164
pnpm run test
131165

166+
# Launch MCP Inspector (builds first, then opens web UI)
167+
pnpm run inspect
168+
132169
# Format code
133170
pnpm run format
134171

135-
# Check formatting (CI)
136-
pnpm run format:check
137-
138-
# Run linter
172+
# Run linter only
139173
pnpm run lint
140174

141175
# Clean build artifacts
@@ -158,7 +192,7 @@ pnpm --filter @salesforce/b2c-dx-mcp run <script>
158192

159193
### Testing the MCP Server
160194

161-
#### 1. MCP Inspector (Recommended)
195+
#### 1. MCP Inspector
162196

163197
Use MCP Inspector to browse tools and test them in a web UI:
164198

@@ -177,7 +211,7 @@ npx mcp-inspector --cli node bin/run.js -s all --allow-non-ga-tools --method too
177211
# Call a specific tool
178212
npx mcp-inspector --cli node bin/run.js -s all --allow-non-ga-tools \
179213
--method tools/call \
180-
--tool-name code_list
214+
--tool-name sfnext_design_decorator
181215
```
182216

183217
#### 2. IDE Integration
@@ -226,16 +260,6 @@ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node bin/run.js -s all
226260
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"code_list","arguments":{}}}' | node bin/run.js -s all
227261
```
228262

229-
### Useful Commands
230-
231-
| Command | Description |
232-
|---------|-------------|
233-
| `pnpm run build` | Compile TypeScript to JavaScript |
234-
| `pnpm run inspect` | Start MCP Inspector web UI |
235-
| `pnpm run lint` | Run ESLint |
236-
| `pnpm run format` | Format code with Prettier |
237-
| `pnpm run clean` | Remove compiled files |
238-
239263
## License
240264

241265
Apache-2.0

packages/b2c-dx-mcp/src/commands/mcp.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,4 @@ export default class McpServerCommand extends Command {
209209
` Enabled: ${(startupFlags.toolsets ?? []).join(", ") || "(none specified)"}`,
210210
);
211211
}
212-
213212
}

packages/b2c-dx-mcp/src/registry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ export async function registerToolsets(
115115

116116
// Validate --toolsets names
117117
const invalidToolsets = toolsets.filter(
118-
(t) => !VALID_TOOLSET_NAMES.includes(t as (typeof VALID_TOOLSET_NAMES)[number]),
118+
(t) =>
119+
!VALID_TOOLSET_NAMES.includes(t as (typeof VALID_TOOLSET_NAMES)[number]),
119120
);
120121
if (invalidToolsets.length > 0) {
121122
console.error(

packages/b2c-dx-mcp/src/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export class B2CDxMcpServer extends McpServer {
6464
* Connect to a transport.
6565
*/
6666
public override async connect(transport: Transport): Promise<void> {
67-
await super.connect(transport);
68-
if (!this.isConnected()) {
69-
// TODO: Telemetry - Send SERVER_START_ERROR event with "Server not connected"
70-
}
67+
await super.connect(transport);
68+
if (!this.isConnected()) {
69+
// TODO: Telemetry - Send SERVER_START_ERROR event with "Server not connected"
70+
}
7171
// TODO: Telemetry - wrap with try/catch to send SERVER_START_ERROR event with error details
7272
}
7373

packages/b2c-dx-mcp/src/tools/cartridges/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,3 @@ export function createCartridgesTools(services: Services): McpTool[] {
9696
),
9797
];
9898
}
99-

packages/b2c-dx-mcp/src/tools/mrt/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,3 @@ function createMrtBundlePushTool(_services: Services): McpTool {
8282
export function createMrtTools(services: Services): McpTool[] {
8383
return [createMrtBundlePushTool(services)];
8484
}
85-

packages/b2c-dx-mcp/src/tools/pwav3/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,3 @@ export function createPwav3Tools(services: Services): McpTool[] {
132132
),
133133
];
134134
}
135-

packages/b2c-dx-mcp/src/tools/scapi/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@ export function createScapiTools(services: Services): McpTool[] {
9797
),
9898
];
9999
}
100-

packages/b2c-dx-mcp/src/tools/storefrontnext/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,3 @@ export function createStorefrontNextTools(services: Services): McpTool[] {
120120
),
121121
];
122122
}
123-

packages/b2c-dx-mcp/src/utils/constants.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ export const ALL_TOOLSETS = "ALL";
2222
/**
2323
* Available toolsets that can be enabled.
2424
*/
25-
export const TOOLSETS = ["CARTRIDGES", "MRT", "PWAV3", "SCAPI", "STOREFRONTNEXT"] as const;
25+
export const TOOLSETS = [
26+
"CARTRIDGES",
27+
"MRT",
28+
"PWAV3",
29+
"SCAPI",
30+
"STOREFRONTNEXT",
31+
] as const;
2632

2733
/**
2834
* Valid toolset names including the special "ALL" value.

0 commit comments

Comments
 (0)