The SFCC Development MCP Server provides comprehensive tools for Salesforce B2C Commerce Cloud (SFCC) development, offering AI assistants and developers structured access to documentation, best practices, system object definitions, and log analysis.
Core Capabilities:
• SFCC Documentation Access: Retrieve detailed class information (properties, methods, descriptions), search for classes/methods by name, access raw documentation, and view complete lists of available SFCC classes
• Best Practices Consultation: Access guides for cartridge creation, OCAPI/SCAPI hooks, SFRA controllers, custom endpoints, performance, and security; search across all guides for specific topics; view detailed reference tables for hook endpoints and extension points
• System Object Definitions (requires OAuth credentials): Explore system objects (Product, Customer, Order), retrieve detailed attribute definitions including custom attributes and constraints, search site preferences across sites and preference groups, and discover attribute categories
• Log Analysis (requires credentials): Retrieve latest error/warning/info messages, get log activity summaries, search for specific patterns, and list available log files with metadata
• AI Assistant Enhancement: Provides structured data to improve AI accuracy and reduce hallucination for SFCC development tasks
Configuration Options: Supports documentation-only mode (no credentials required) and full mode (with SFCC credentials for advanced log analysis and system object features).
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
SFCC Development MCP Server
TL;DR - Quick Setup
To use this MCP server with Claude Desktop or other MCP clients, add the following to your MCP settings file:
Documentation-Only Mode (No SFCC credentials needed):
Full Mode (With SFCC credentials for log analysis and system object tools):
For Full Mode, create a dw.json
file with your SFCC credentials:
Available Tools by Mode
Tool Category | Documentation-Only Mode | Full Mode |
---|---|---|
SFCC Documentation (7 tools) | ✅ Available | ✅ Available |
Best Practices Guides (4 tools) | ✅ Available | ✅ Available |
Log Analysis (6 tools) | ❌ Requires credentials | ✅ Available |
System Object Definitions (6 tools) | ❌ Requires OAuth | ✅ Available with OAuth |
Get started immediately: The server works without any credentials - just use npx sfcc-dev-mcp
to access all documentation and best practices tools!
🤖 AI Assistant Integration
For optimal AI assistance when working with SFCC projects, copy the sfcc-ai-instructions.md
file to your SFCC project directory and rename it to copilot-instructions.md
, claude.md
, or similar. This file provides comprehensive guidance to AI assistants on:
- When to use MCP tools vs. relying on general AI knowledge
- Specific tool recommendations for common SFCC development tasks
- Workflow patterns for debugging, implementation, and best practices
- Error reduction by encouraging use of current, verified SFCC information
This significantly improves AI assistance accuracy and reduces hallucination when working on SFCC development tasks.
An MCP (Model Context Protocol) server that provides comprehensive access to Salesforce B2C Commerce Cloud development features. This allows AI agents to assist with SFCC development tasks including log analysis, debugging, monitoring, and SFCC documentation querying.
Features
SFCC Best Practices Guides
- Get Available Guides: List all available SFCC best practice guides covering OCAPI hooks, SCAPI hooks, SFRA controllers, and custom SCAPI endpoints
- Get Complete Guide: Retrieve comprehensive best practice guides with structured content for specific SFCC development areas
- Search Best Practices: Search across all best practice guides for specific terms, concepts, or patterns
- Get Hook Reference: Access detailed hook reference tables for OCAPI and SCAPI hooks with endpoints and extension points
SFCC Documentation Querying
- Get Class Information: Retrieve detailed information about any SFCC class including properties, methods, and descriptions
- Search Classes: Find SFCC classes by name with partial matching
- Get Class Methods: List all methods for a specific SFCC class with signatures
- Get Class Properties: List all properties for a specific SFCC class with types and modifiers
- Search Methods: Find methods across all SFCC classes by name
- List All Classes: Get a complete list of available SFCC classes
- Get Raw Documentation: Access the complete Markdown documentation for any class
SFCC System Object Definitions
- Get All System Objects: Retrieve a complete list of all system object definitions with metadata including attribute counts
- Get System Object Definition: Get detailed information about a specific system object (Product, Customer, Order, etc.) including all attributes
- Get System Object Attribute Definitions: Get comprehensive attribute definitions for a specific system object type with detailed information about all attributes including custom attributes, their types, constraints, and metadata. This provides more detailed attribute information than the basic system object definition.
- Search System Object Attribute Definitions: Search for specific attribute definitions within a system object type using complex queries. Supports text search on id/display_name/description, filtering by properties like mandatory/searchable/system, and sorting. Essential for finding custom attributes or attributes with specific characteristics.
- Search Site Preferences: Search site preferences across sites in the specified preference group and instance. Essential for discovering custom site preferences, understanding preference configurations, or when working with site-specific settings. Supports complex queries with text search, filtering, and sorting.
- Search System Object Attribute Groups: Search attribute groups for a specific system object type. Essential for discovering site preference groups (use "SitePreferences" as objectType) needed for the site preferences search API. Supports complex queries with text search, filtering, and sorting on group properties.
Note: System object definition tools require OAuth credentials (clientId and clientSecret) and are useful for discovering custom attributes and site preferences added to standard SFCC objects.
Log Analysis & Monitoring
- Get Latest Errors: Retrieve the most recent error messages from SFCC logs
- Get Latest Warnings: Fetch recent warning messages
- Get Latest Info: Access recent info-level log entries
- Summarize Logs: Get an overview of log activity with error counts and key issues
- Search Logs: Search for specific patterns across log files
- List Log Files: View available log files with metadata
Installation
- Clone this repository
- Install dependencies:
- Build the TypeScript code:
Configuration
Overriding the Working Directory
The server uses the current working directory (cwd) to locate documentation files. By default, it expects to find a docs/
folder in the directory where the server is started. If you need to use documentation from a different location, you have several options:
Option 1: Start the server from the correct directory
Option 2: Use the --cwd flag (if your MCP client supports it)
Option 3: Create symbolic links
Expected Directory Structure: The server expects the following structure relative to the working directory:
Using dw.json (Recommended)
The server supports the standard SFCC dw.json
configuration format used by Commerce Cloud development tools. Create a dw.json
file in your project root:
Required fields:
hostname
: Your SFCC instance hostnameusername
: Your SFCC usernamepassword
: Your SFCC password
Optional fields:
client-id
: OAuth client ID (for API access)client-secret
: OAuth client secret (for API access)code-version
: Code version to use
Using Environment Variables
Alternatively, you can configure the server using environment variables:
Data API Configuration
Business Manager Setup for System Object Definition Tools
To use the system object definition tools (get_system_object_definitions
, get_system_object_definition
, get_system_object_attribute_definitions
, search_system_object_attribute_definitions
, search_site_preferences
, search_system_object_attribute_groups
), you need to configure Data API access in Business Manager:
Step 1: Create API Client in Account Manager
- Log into Account Manager (not Business Manager)
- Navigate to API Client section
- Click Add API Client
- Configure the API client:
- Name:
SFCC Dev MCP Server
(or any descriptive name) - Password: Generate a secure password
- Scopes: Select SFCC scope
- Roles: Assign appropriate roles for your organization
- Name:
Step 2: Configure Data API Access in Business Manager
- Log into Business Manager for your instance
- Navigate to Administration > Site Development > Open Commerce API Settings
- Click on Data API tab
- Configure the following settings:
Client Configuration:
Required Settings:
- Client ID: Your API client ID (e.g.,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
) - Resource ID:
/system_object_definitions/*
(allows access to all system object definition endpoints) - Resource ID:
/site_preferences/preference_groups/*/*/preference_search
(allows access to site preferences search) - Methods:
get
andpost
(required for retrieving and searching system objects and preferences) - Read Attributes:
(**)
(allows reading all attributes) - Write Attributes:
(**)
(may be required for some operations)
Step 3: Update Your Configuration
Add the client credentials to your dw.json
:
Troubleshooting Data API Access
Common Issues:
- 403 Forbidden: Check that your API client has the correct scopes and roles
- 401 Unauthorized: Verify your client credentials are correct
- Resource not found: Ensure the resource ID pattern matches
/system_object_definitions/*
and/site_preferences/preference_groups/*/*/preference_search
Testing Your Configuration: You can test your Data API access using the MCP tools:
Testing Site Preferences Workflow:
Usage
Launch Parameters and Command Line Options
The server supports several command line parameters to customize its behavior:
--dw-json <path>
Specify a custom path to your dw.json
configuration file:
--debug <true|false>
Control debug logging output to customize the verbosity of server logs:
Debug logging includes:
- Method entry and exit logs
- Detailed timing information for operations
- Full response previews for debugging
- Additional context for troubleshooting
Production usage: Use --debug false
in production environments to reduce log noise and improve performance.
Configuration Loading Priority
The server loads configuration in the following order of preference:
- Command line
--dw-json
argument (highest priority)- Allows you to specify a custom path to your dw.json file
- Useful for different environments or project configurations
./dw.json
file in current directory- Automatically detected if present in the working directory
- Standard SFCC development workflow
- Environment variables (lowest priority)
- Falls back to environment variables if no dw.json is found
- See the "Using Environment Variables" section below
Starting the Server
Using with npx
You can also run the server directly using npx without installing it locally:
Note: When using npx, make sure your dw.json
file is in the current working directory or specify the full path using the --dw-json
parameter.
MCP Client Configuration
Add this server to your MCP client configuration. For example, in Claude Desktop's config:
Using Local Installation
Using npx (Recommended)
You can configure the MCP client to use npx, which automatically handles package installation and updates:
Example configurations:
For automatic configuration detection (uses ./dw.json in working directory):
Benefits of using npx in MCP configuration:
- Automatically installs the latest version if not present
- No need to manually clone or build the project
- Automatic updates when new versions are released
- Consistent behavior across different environments
- Easy to share configurations with team members
Available Tools
SFCC Documentation Tools
get_sfcc_class_info
- Get comprehensive information about an SFCC classsearch_sfcc_classes
- Search for classes by nameget_sfcc_class_methods
- Get all methods for a classget_sfcc_class_properties
- Get all properties for a classsearch_sfcc_methods
- Find methods across all classeslist_sfcc_classes
- List all available SFCC classesget_sfcc_class_documentation
- Get raw documentation
SFCC Best Practices Tools
get_available_best_practice_guides
- List all available best practice guidesget_best_practice_guide
- Get a complete best practice guidesearch_best_practices
- Search across all best practice guidesget_hook_reference
- Get hook reference tables for OCAPI/SCAPI
SFCC System Object Definition Tools
get_system_object_definitions
- Get all system object definitionsget_system_object_definition
- Get specific system object definitionget_system_object_attribute_definitions
- Get attribute definitions for an object typesearch_system_object_attribute_definitions
- Search attribute definitionssearch_site_preferences
- Search site preferencessearch_system_object_attribute_groups
- Search attribute groups
Log Analysis Tools
get_latest_errors
- Get recent error messagesget_latest_warnings
- Get recent warning messagesget_latest_info
- Get recent info messagessummarize_logs
- Get log summary with countssearch_logs
- Search for patterns in logslist_log_files
- List available log files
Example AI Assistant Interactions
With this MCP server, AI assistants can now answer questions like:
"Create a new cartridge called "plugin_example" with a controller and ISML template"
- The assistant uses
get_best_practice_guide
to retrieve the best practices for cartridge creation. - It then generates the necessary files and directories based on the best practices, including a controller and ISML template.
"How does the Catalog class work in SFCC?"
- The assistant queries
get_sfcc_class_info
for the Catalog class - Gets back structured information about properties (description, displayName, ID, root) and methods (getDescription, getDisplayName, etc.)
- Provides a comprehensive explanation of the class functionality
"Find all classes related to products"
- The assistant uses
search_sfcc_classes
with query "product" - Returns classes like
dw.catalog.Product
,dw.catalog.ProductMgr
,dw.catalog.ProductOption
, etc.
"What methods are available for managing customers?"
- The assistant calls
search_sfcc_methods
with "customer" - Gets back customer-related methods from multiple classes across the SFCC API
"How do I implement SFRA controller extensions properly?"
- The assistant uses
get_best_practice_guide
with "sfra_controllers" - Returns comprehensive best practices including server.append(), server.prepend(), and server.replace() patterns
- Provides code examples and architectural guidance for SFRA development
"What are the security best practices for OCAPI hooks?"
- The assistant calls
search_best_practices
with query "security" - Finds security-related content across all best practice guides
- Returns specific guidance on input validation, authorization, and data integrity
"Show me all available SCAPI hook extension points"
- The assistant uses
get_hook_reference
with "scapi_hooks" - Returns comprehensive tables of all SCAPI hook endpoints and their available extension points
- Provides structured reference for implementing custom hook logic
"Find all site preference groups available in my SFCC instance"*
- The assistant uses
search_system_object_attribute_groups
with objectType "SitePreferences" - Returns all available preference groups with their IDs, display names, and descriptions
- Provides the group IDs needed for subsequent site preference searches
"Search for payment-related site preferences in the PaymentSettings group"
- The assistant first uses
search_system_object_attribute_groups
to find preference groups related to payment - Then uses
search_site_preferences
with the discovered group ID and instance type - Returns specific site preferences related to payment configuration
Best Practices Coverage
The server includes comprehensive best practices guides for all major SFCC development areas:
- OCAPI Hooks - Legacy API extension patterns and implementation guidance
- SCAPI Hooks - Modern API hooks with transactional integrity and performance considerations
- SFRA Controllers - Storefront controller patterns, middleware chains, and extension strategies
- Custom SCAPI Endpoints - Three-pillar architecture for building new API endpoints
Documentation Coverage
The server includes comprehensive documentation for all SFCC packages:
dw.campaign
- Campaign and promotion managementdw.catalog
- Product and catalog managementdw.content
- Content managementdw.customer
- Customer managementdw.order
- Order processingdw.system
- System utilitiesdw.web
- Web framework- And many more...
Security Notes
- Store your
dw.json
file securely and never commit it to version control - Add
dw.json
to your.gitignore
file - Use environment variables in production environments
- Ensure your SFCC credentials have appropriate permissions
Development
Building from Source
Running Tests
Documentation Generation
The SFCC documentation is automatically converted from the official SFCC documentation using the included scraping script:
Contributing
We welcome contributions! Please see our Contributing Guide for details on:
- Setting up the development environment
- Code style and conventions
- Testing requirements
- Pull request process
- Types of contributions we're looking for
Whether you're fixing bugs, adding features, improving documentation, or enhancing the best practices guides, your contributions help make SFCC development more accessible for everyone.
License
This project is licensed under the ISC License - see the LICENSE file for details.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Provides comprehensive access to Salesforce B2C Commerce Cloud development tools including SFCC API documentation, best practices guides, log analysis, and system object definitions. Enables AI assistants to help with SFCC development tasks through both documentation-only mode and full credential-based mode.
- TL;DR - Quick Setup
- 🤖 AI Assistant Integration
- Features
- Installation
- Configuration
- Data API Configuration
- Usage
- Available Tools
- Example AI Assistant Interactions
- Best Practices Coverage
- Documentation Coverage
- Security Notes
- Development
- Contributing
- License
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityExposes Salesforce CLI functionality to LLM tools like Claude Desktop, allowing AI agents to execute Salesforce commands, manage orgs, deploy code, and query data through natural language.Last updated -566431JavaScript
- AsecurityAlicenseAqualityProvides offline access to SAP documentation and real-time SAP Community content, integrating official documentation with community-driven solutions for comprehensive developer support.Last updated -341TypeScriptApache 2.0
- -securityAlicense-qualityAn MCP server implementation that integrates Claude/VS Code with Salesforce, enabling natural language interactions with your Salesforce data and metadata.Last updated -MIT License
- AsecurityAlicenseAqualityProvides professional UI/UX design expertise and frontend development tools for analyzing interfaces, generating design systems, and creating modern components with accessibility and best practices built-in. Supports React, Vue, Angular and other frameworks with seamless Claude Code CLI integration.Last updated -4JavaScriptMIT License