SFCC Development MCP Server
It is an AI-facing MCP server for Salesforce B2C Commerce Cloud development reference and scaffolding.
Look up detailed SFCC
dw.*class information and raw documentation.Search/list SFCC classes and search methods across classes.
Browse and search SFCC best-practice guides, including hooks, SFRA, ISML, security, and performance.
Retrieve OCAPI/SCAPI hook reference tables.
Explore and search SFRA documentation by document or category.
Generate cartridge/project directory structures with required files and configuration.
Per the README, full credentialed mode also adds live log/job-log analysis, system object inspection, code version management, script debugging, and agent-skill bootstrap.
Provides comprehensive tools for Salesforce B2C Commerce Cloud (SFCC) development including log analysis and monitoring, SFCC API documentation querying, system object definitions access, and best practices guides for OCAPI hooks, SCAPI hooks, SFRA controllers, and custom endpoints
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SFCC Development MCP Server show me the SFRA controller best practices"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SFCC Development MCP Server
This project is no longer actively maintained. Salesforce now offers an official, much more complete toolkit, and you should switch to theAgentic B2C Developer Toolkit.
It is generally available and includes the B2C CLI (@salesforce/b2c-cli), the official MCP server (@salesforce/b2c-dx-mcp, for example npx -y @salesforce/b2c-dx-mcp@latest), agent skills and plugins, and an IDE extension.
Documentation lookup and development guidance are in the official MCP and its agent skills. Log investigation is in the MCP and the B2C CLI. The script debugger is in the MCP and the IDE extension. You can keep using the current version of this project if you already depend on it.
An AI-powered Model Context Protocol (MCP) server that provides comprehensive access to Salesforce B2C Commerce Cloud development tools, documentation, and runtime diagnostics.
โจ Key Features
๐ Complete SFCC Documentation Access - Search and explore all SFCC API classes and methods
๐๏ธ SFRA Documentation - Enhanced access to Storefront Reference Architecture documentation
๐งฑ ISML Template Reference - Complete ISML element documentation with examples and usage guidance
๐ Log Analysis Tools - Real-time error monitoring, debugging, and job log analysis for SFCC instances
โ๏ธ System Object Definitions - Explore custom attributes and site preferences
๐งช Script Debugger - Execute and inspect script-debugger endpoints in credentialed mode, including custom trigger URLs/paths for non-default storefront routes
๐ Cartridge Generation - Automated cartridge structure creation with workspace-bound path safety (writes stay inside workspace roots, or current working directory fallback when roots are unavailable; home-directory fallback is blocked)
๐งฉ Agent Skill Bootstrap - Install or merge AGENTS.md and bundled skills into the current project or a temp directory for AI assistants
โ Tool Argument Validation - Runtime schema validation enforces required fields, type checks, enum constraints, integer/numeric bounds, and strict unknown-key checks for object schemas (top-level and nested) before handler execution
โฑ๏ธ MCP Progress + Cancellation - Tool calls honor request cancellation signals and emit out-of-band
notifications/progressupdates when clients provide aprogressToken
Related MCP server: MCP Salesforce Server
๐ Quick Start
Option 1: Documentation-Only Mode (No SFCC credentials needed)
{
"mcpServers": {
"sfcc-dev": {
"command": "npx",
"args": ["sfcc-dev-mcp"]
}
}
}Option 2: Full Mode (With SFCC credentials for log and job analysis)
{
"mcpServers": {
"sfcc-dev": {
"command": "npx",
"args": ["sfcc-dev-mcp", "--dw-json", "/path/to/your/dw.json"]
}
}
}Create a dw.json file with your SFCC credentials. You can use either auth mode (or both):
Basic auth:
username+passwordOAuth:
client-id+client-secretOptional storefront auth (for script debugger trigger on Basic-Auth storefronts):
storefrontUsername+storefrontPassword
{
"hostname": "your-instance.sandbox.us01.dx.commercecloud.salesforce.com",
"username": "your-username",
"password": "your-password",
"storefrontUsername": "your-storefront-basic-user",
"storefrontPassword": "your-storefront-basic-password",
"client-id": "your-client-id",
"client-secret": "your-client-secret"
}At least one complete credential pair is required when hostname is set.
If credentials are provided, hostname is also required.
Option 3: Auto-Discovery (Recommended for VS Code users)
Simply open a VS Code workspace that contains a dw.json file - the server will automatically discover and use it:
{
"mcpServers": {
"sfcc-dev": {
"command": "npx",
"args": ["sfcc-dev-mcp"]
}
}
}๐ง Configuration Discovery Priority
The server discovers SFCC credentials in this order (highest priority first):
Priority | Source | Description |
1 |
| Explicit path to dw.json file |
2 | Environment variables |
|
3 | MCP workspace roots | Automatically discovers dw.json in your VS Code workspace folder(s), and refreshes when the client sends |
Note: The server no longer searches the current working directory by default, as MCP servers often start with
cwdset to the user's home directory. The MCP workspace roots mechanism provides reliable project context.
๐ฏ Operating Modes
Mode | Tools Available | SFCC Credentials Required |
Documentation-Only | 18 tools | โ No |
Full Mode | 40 tools | โ Yes |
Documentation-Only Mode
Perfect for learning and development, no SFCC instance required:
Complete SFCC API documentation (5 tools)
SFRA documentation (5 tools)
ISML template documentation (5 tools)
Cartridge generation (1 tool, writes constrained to workspace roots/cwd)
Agent instruction bootstrap (2 tools) to copy/merge AGENTS.md and skills, or disable future prompts
Full Mode
Complete development experience with live SFCC instance access:
All documentation-only features (18 tools)
Real-time log analysis and job logs (13 tools)
System object definitions (6 tools)
Code version management (2 tools)
Script debugger operations (1 tool)
๐๏ธ Architecture Overview
This server is built around a capability-gated, modular handler architecture that cleanly separates tool routing from domain logic:
Core Layers
Tool Schemas (
src/core/tool-schemas/): Modular, category-based tool definitions (documentation, SFRA, ISML, logs, job logs, system objects, cartridge, code versions, agent instructions, script debugger). Re-exported viatool-definitions.ts.Server Orchestration Modules (
src/core/server-tool-catalog.ts,src/core/server-tool-call-lifecycle.ts,src/core/server-workspace-discovery.ts): Keepsserver.tsfocused by extracting capability-aware tool catalog logic,tools/calllifecycle (progress/cancellation/preflight), and workspace roots reconfiguration flow.Tool Argument Validator (
src/core/tool-argument-validator.ts): Enforces runtime argument shape at the MCP boundary for all tools (required fields, primitive/object/array types, enum checks, integer/numeric ranges, string patterns/length, and strict unknown-key checks for object schemas at top-level and nested levels) before tool dispatch.OCAPI Query Coverage (
src/core/tool-schemas/shared-schemas.ts): Shared search schemas includetext_query,term_query,bool_query,filtered_query, andmatch_all_queryso MCP boundary validation aligns with supported OCAPI query patterns.Handlers (
src/core/handlers/): Each category has a handler extending a common base for timing, structured logging, and error normalization, with config-driven wiring viaConfiguredClientHandlerto reduce repetitive boilerplate (e.g.log-handler,docs-handler,isml-handler,system-object-handler).Clients (
src/clients/): Encapsulate domain operations (OCAPI, SFRA docs, ISML docs, modular log analysis, script debugger, cartridge generation, agent-instruction sync). Handlers delegate to these so orchestration and computation remain separate.Services (
src/services/): Dependency-injected abstractions for filesystem and path operations โ improves testability and isolates side effects.Modular Log System (
src/clients/logs/): Reader (range/tail optimization), discovery, processor (line โ structured entry), analyzer (patterns & health), formatter (human output) for maintainable evolution.Configuration Factory (
src/config/configuration-factory.ts): Determines capabilities (canAccessLogs,canAccessOCAPI) based on provided credentials and filters exposed tools accordingly (principle of least privilege).Shared Credential Validation (
src/config/credential-validation.ts): Centralizes auth-pair completeness and hostname-format validation for bothdw.jsonloading and runtime configuration creation.Call-time Capability Guarding (
src/core/server.ts): Rejects execution of tools that are unavailable in the current mode, so hidden tools are not callable via directtools/callrequests.Call Lifecycle Signals (
src/core/server.ts):tools/callhandling supports cancellation via request abort signals and emits best-effort progress notifications when the caller provides_meta.progressToken.Tool Error Sanitization (
src/core/tool-error-response.ts): Sanitizes upstream execution errors before returning MCP tool responses, reducing accidental leakage of backend payload details.Runtime WebDAV Verification (
src/core/server.ts): For OAuth-only configurations (client-id/client-secretwithoutusername/password), log/job-log/script-debugger tool exposure is gated by a one-time WebDAV capability probe to avoid false-positive tool availability.CLI Option Helpers (
src/config/cli-options.ts): Centralizes command-line parsing and environment credential detection for predictable startup behavior.Shared Path Security Policy (
src/config/path-security-policy.ts): Reuses allow/block path rules across workspace-root discovery and securedw.jsonloading.Shared Abort Utility (
src/utils/abort-utils.ts): Centralized timeout and abort-signal composition used by HTTP and debugger clients for consistent cancellation semantics and timer cleanup.
Why This Matters
Extensibility: Adding a new tool usually means adding a schema + minimal handler logic (or a new handler if a new domain).
Security: Tools that require credentials are never exposed when capability flags are false.
Testability: Unit tests target clients & modules; integration/MCP tests validate handler routing and response structure.
Performance: Tail log reads + lightweight caching (
cache.ts,log-cache.ts) reduce unnecessary I/O.
Adding a New Tool (High-Level)
Add schema to the appropriate file in
src/core/tool-schemas/(or create new file for new category).Export new schema from
src/core/tool-schemas/index.tsif adding a new file.Implement domain logic in a client/service (avoid bloating handlers).
Extend an existing handler or create a new one if it's a new category.
(Only for a new category) register the new handler inside
registerHandlers()inserver.ts.Discover actual response shape with
npx aegis querybefore writing tests.Add Jest unit tests + YAML MCP tests (docs vs full mode if credentials required).
Update documentation (AGENTS.md + README counts if changed).
For a deeper internal view, see the Development Guide in the docs site.
๐ค AI Interface Setup
Choose your preferred AI assistant:
Interface | Best For | Setup Guide |
Claude Desktop | Multi-turn conversations, debugging | |
GitHub Copilot | VS Code integration, inline suggestions | |
Cursor | Modern AI-powered editor |
๐ฆ Installation
Using npx (Recommended)
Tip: Add
-y(or--yes) to suppress the interactive prompt npx shows before downloading a package. This prevents AI clients (Claude Desktop, Copilot, Cursor) from hanging waiting for confirmation.
# Test the server
npx -y sfcc-dev-mcp
# Use with your configuration
npx -y sfcc-dev-mcp --dw-json /path/to/your/dw.jsonGlobal Installation
npm install -g sfcc-dev-mcp
sfcc-dev-mcp --dw-json /path/to/your/dw.json๐ Debug Mode & Logging
Enable Debug Logging
# Enable debug mode for detailed logging
npx -y sfcc-dev-mcp --debug
# Or with configuration file
npx -y sfcc-dev-mcp --dw-json /path/to/your/dw.json --debug--debug accepts true/false, 1/0, or yes/no. Invalid values fail fast with a clear error message.
Log File Locations
The server writes logs to your system's temporary directory:
macOS:
/var/folders/{user-id}/T/sfcc-mcp-logs/Linux:
/tmp/sfcc-mcp-logs/Windows:
%TEMP%\sfcc-mcp-logs\
Log Files Created:
sfcc-mcp-info.log- General application logs and startup messagessfcc-mcp-debug.log- Detailed debug information (only when--debugis enabled)sfcc-mcp-error.log- Error messages and stack tracessfcc-mcp-warn.log- Warning messages
Finding Your Log Directory
// The exact path varies by system - to find yours:
node -e "console.log(require('os').tmpdir() + '/sfcc-mcp-logs')"๐งช Release Flow (Maintainers)
This repository now uses Changesets for npm releases.
When a change should ship in a new sfcc-dev-mcp version, add a changeset from the repository root:
npm run changesetCheck pending release state against main before merging:
npm run release:statusThe release workflow on main creates or updates a release pull request from pending changesets. Merging that release pull request publishes the npm package through npm trusted publishing (GitHub Actions OIDC), waits for npm propagation, reruns MCP tests against the published NPX artifact, and then publishes the same version to the MCP Registry.
npm run version-packages also syncs server.json with the package version so validate:server-json keeps passing in the release PR.
Package publication now uses GitHub Actions OIDC trusted publishing, so no separate npm publish secret is required.
You can run the same validation locally:
# Ensure docs-site tool catalog stays in sync with runtime tool definitions
npm run validate:tools-sync
# Ensure docs-site skills catalog stays in sync with bundled skills
npm run validate:skills-sync
# Ensure MCP registry metadata stays in sync with package.json
npm run validate:server-json
# In a separate terminal, start the mock server first for full-mode MCP tests
npm run test:mock-server:start
# Uses latest published version by default
npm run test:mcp:published-npx
# Or pin a specific published version
bash ./scripts/test-published-npx.sh 1.0.21In GitHub Actions, the publish workflow manages the mock server lifecycle automatically.
๐ Documentation
๐ Complete Documentation - Comprehensive guides and references
Documentation source lives in docs-site-v2/ (VitePress). The legacy React site remains in docs-site/.
Quick Links:
Getting Started - Installation and first-run setup
AI Interface Setup - Configure Claude Desktop, GitHub Copilot, or Cursor
Configuration Guide - SFCC credentials and Data API setup
Available Tools - Complete tool reference
Examples - Real-world usage patterns
Troubleshooting - Common issues and solutions
๐ ๏ธ Example AI Interactions
๐งโ๐ป "Create a new SFCC controller for product search"
๐ค Generates complete controller with proper imports, route handling, and SFRA patterns
๐งโ๐ป "What's wrong with my checkout flow? Check the logs"
๐ค Analyzes recent error logs, identifies issues, and suggests fixes
๐งโ๐ป "Show me how to implement OCAPI hooks for order validation"
๐ค Retrieves related SFCC classes and methods, then proposes a concrete hook implementation pattern๐ Security Notes
Local Development Focus: Designed for individual developer use on local machines
Credential Protection: dw.json files should never be committed to version control
Network Security: All API calls use HTTPS with proper authentication
No Data Storage: Server doesn't persist any SFCC data locally
๐ฎ Future Plans
We're continuously improving the SFCC Development MCP Server with exciting new features planned:
๐ฏ Upcoming Enhancements
๐ง Smarter Log Fetching - Enhanced log analysis with intelligent filtering, pattern recognition, and contextual error correlation
๐ Deployment Tools - Integration with SFCC deployment processes and code version management
๐ค We Welcome Your Contributions!
Have ideas for new features or improvements? We'd love to hear from you!
๐ก Feature Requests: Open an issue to discuss your ideas
๐ Bug Reports: Help us improve by reporting any issues you encounter
๐ง Pull Requests: Contribute code, documentation, or examples
๐ Documentation: Help expand our guides and best practices
Check out our Contributing Guide to get started, or browse our open issues to see where you can help.
Your expertise and feedback make this tool better for the entire SFCC community!
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Ready to supercharge your SFCC development with AI?
Available Tools
15 toolsgenerate_cartridge_structureA
Generate a complete cartridge directory structure with all necessary files and configurations. Use this when creating new cartridges to ensure proper organization and include all required components. This tool creates all necessary files directly in the specified target directory, ensuring the cartridge is created exactly where needed in your project structure.
Inputs: cartridgeName (required), targetPath, fullProjectSetup.
get_available_best_practice_guidesA
Get a list of all available SFCC best practice and how-to guides. Use this first to discover what guidance is available before implementing any SFCC features. Essential for understanding what best practice resources exist for cartridge creation, hooks, controllers, and custom endpoints
Inputs: no named parameters.
get_available_sfra_documentsA
Get a list of all available SFRA (Storefront Reference Architecture) documentation. Use this to discover what SFRA classes, modules, and models are documented, including Server, Request, Response, QueryString, render module, and comprehensive model documentation for account, cart, products, pricing, billing, shipping, and more. Essential for understanding SFRA architecture and available functionality.
Inputs: no named parameters.
get_best_practice_guideA
Get a complete best practice and how-to guide with all sections and content. Use this when implementing specific SFCC features like cartridges, ISML templates, OCAPI/SCAPI hooks, SFRA controllers, or custom endpoints. Always consult the relevant guide before writing code to ensure you follow SFCC best practices, security guidelines, and proper architecture patterns.
Inputs: guideName (required).
get_hook_referenceA
Get comprehensive hook reference tables showing all available OCAPI or SCAPI hook endpoints and extension points. Use this when implementing hooks to see all available extension points, understand hook signatures, and ensure you're using the correct hook for your use case. Essential reference when extending SFCC APIs.
Inputs: guideName (required).
get_sfcc_class_documentationA
Get the complete raw documentation for an SFCC class. Use this when you need comprehensive details about a class including examples, detailed descriptions, and full context. Best for in-depth understanding when the basic class info isn't sufficient.
Inputs: className (required).
get_sfcc_class_infoA
Get detailed information about an SFCC class including properties, methods, and description. Use this when you need to understand what a specific SFCC class does, what methods/properties are available, or when implementing features that use SFCC APIs. Essential for cartridge development (controllers, scripts, templates, rest-apis) using the dw.* namespace in the SFCC Rhino environment.
Inputs: className (required), expand, includeDescription, includeConstants, +4 more.
get_sfra_categoriesA
Get all available SFRA document categories with counts and descriptions. Use this to understand the organization of SFRA documentation and discover what types of functionality are available. Helpful for exploring the full scope of SFRA capabilities.
Inputs: no named parameters.
get_sfra_documentB
Get complete SFRA class, module, or model documentation with detailed information about properties, methods, and usage examples. Use this when working with SFRA controllers, middleware, models, or when you need to understand how SFRA components work together. Perfect for implementing SFRA-based features. Now supports all 26+ SFRA documents including core classes, product models, order/cart models, customer models, pricing models, and more.
Inputs: documentName (required).
get_sfra_documents_by_categoryA
Get SFRA documents filtered by category. Use this to explore documents in specific functional areas like core SFRA classes, product models, order/cart functionality, customer management, pricing, or store models. Perfect for discovering related documentation and understanding functional groupings.
Inputs: category (required).
list_sfcc_classesA
Get a complete list of all available SFCC classes. Use this for exploration and discovery when you need to understand the full scope of SFCC APIs, or when you're new to SFCC development and want to see what's available. Good starting point for understanding the SFCC class hierarchy.
Inputs: no named parameters.
search_best_practicesA
Search across all best practice guides for specific terms, patterns, or concepts. Use this when you need guidance on specific topics like validation, security, performance optimization, error handling, or any development pattern. Perfect for finding relevant best practices without reading entire guides.
Inputs: query (required).
search_sfcc_classesA
Search for SFCC classes by name or functionality. Use this when you know part of a class name or need to find classes related to specific functionality (e.g., search 'catalog' to find catalog-related classes). Perfect starting point when you're unsure of the exact class name or exploring available APIs for a feature area.
Inputs: query (required).
search_sfcc_methodsA
Search for methods across all SFCC classes by method name. Use this when you know the method name but not which class it belongs to, or when looking for similar methods across different classes. Helpful for discovering all available methods that perform similar operations.
Inputs: methodName (required).
search_sfra_documentationA
Search across all SFRA documentation for specific terms, concepts, or functionality. Use this when you need to find specific SFRA features, understand how to implement controller patterns, locate model information, or find information about routing, middleware, request handling, response management, cart functionality, product models, or customer management. Enhanced with relevance scoring and categorization.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 15 tools
The tools have some overlap that could cause confusion, particularly between get_* and search_* tools (e.g., get_sfcc_class_info vs. search_sfcc_classes) and among documentation retrieval tools (e.g., get_sfra_document vs. get_sfra_documents_by_category). However, descriptions help clarify distinctions, such as get_* for specific retrieval and search_* for broader exploration, preventing complete ambiguity.
Tool names follow a highly consistent verb_noun pattern throughout, with clear and predictable structures like generate_cartridge_structure, get_available_best_practice_guides, and search_sfcc_classes. There are no deviations in naming conventions, making it easy for agents to parse and understand the tool purposes.
With 15 tools, the count is slightly high but reasonable for a development server covering documentation, best practices, and code generation in the SFCC domain. It includes a mix of generation, listing, retrieval, and search tools, which aligns well with the server's purpose, though it might feel a bit heavy compared to more streamlined sets.
The tool surface is largely complete for its domain, covering documentation retrieval, best practices, and code generation for SFCC development. Minor gaps exist, such as the lack of tools for directly modifying or deploying cartridges, but agents can work around these by using the available tools for guidance and structure generation.
Maintenance
Related MCP Connectors
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Provides access to Avalara developer documentation, integration guides, and code examples
Access and maintain design system docs, tokens, components, skills, and contexts across any project.
Enable AI assistants to interact seamlessly with Feeef e-commerce stores, products, and orders usiโฆ
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure interaction with Salesforce orgs through LLMs, providing tools for managing orgs, querying data, deploying metadata, running tests, and performing code analysis with granular access control and encrypted authentication.Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Salesforce through a secure interface for performing CRUD operations, executing SOQL queries, and managing schema discovery. It features a smart learning system that analyzes custom objects and fields to provide intelligent assistance tailored to specific Salesforce configurations.1423 npm17BSD 2-Clause "Simplified"
- AlicenseNot gradedqualityDmaintenanceEnables Salesforce developers to create code and configuration using local documentation, with optional semantic search.7 npm1MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI applications with Salesforce Commerce Cloud for product management, order analysis, custom object operations, and content asset management.8MIT