Skip to content

taurgis/sfcc-dev-mcp

Repository files navigation

SFCC Development MCP Server

npm version License: MIT

An AI-powered Model Context Protocol (MCP) server that provides comprehensive access to Salesforce B2C Commerce Cloud development tools, documentation, and best practices.

✨ Key Features

  • πŸ” Complete SFCC Documentation Access - Search and explore all SFCC API classes and methods
  • πŸ“š Best Practices Guides - Curated development guidelines for cartridges, hooks, controllers, and more
  • πŸ—οΈ SFRA Documentation - Enhanced access to Storefront Reference Architecture documentation
  • πŸ“Š Log Analysis Tools - Real-time error monitoring and debugging for SFCC instances
  • βš™οΈ System Object Definitions - Explore custom attributes and site preferences
  • πŸš€ Cartridge Generation - Automated cartridge structure creation

πŸš€ 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 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:

{
  "hostname": "your-instance.sandbox.us01.dx.commercecloud.salesforce.com",
  "username": "your-username",
  "password": "your-password", 
  "client-id": "your-client-id",
  "client-secret": "your-client-secret"
}

🎯 Operating Modes

Mode Tools Available SFCC Credentials Required
Documentation-Only 15 tools ❌ No
Full Mode 30 tools βœ… Yes

Documentation-Only Mode

Perfect for learning and development - no SFCC instance required:

  • Complete SFCC API documentation (5 tools)
  • Best practices guides (4 tools)
  • SFRA documentation (5 tools)
  • Cartridge generation (1 tool)

Full Mode

Complete development experience with live SFCC instance access:

  • All documentation-only features (15 tools)
  • Real-time log analysis (7 tools)
  • System object definitions (6 tools)
  • Code version management (2 tools)

πŸ€– AI Interface Setup

Choose your preferred AI assistant:

Interface Best For Setup Guide
Claude Desktop Multi-turn conversations, debugging πŸ“– Setup Guide
GitHub Copilot VS Code integration, inline suggestions πŸ“– Setup Guide
Cursor Modern AI-powered editor πŸ“– Setup Guide

πŸ“¦ Installation

Using npx (Recommended)

# Test the server
npx sfcc-dev-mcp

# Use with your configuration
npx sfcc-dev-mcp --dw-json /path/to/your/dw.json

Global 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 sfcc-dev-mcp --debug

# Or with configuration file
npx sfcc-dev-mcp --dw-json /path/to/your/dw.json --debug

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 messages
  • sfcc-mcp-debug.log - Detailed debug information (only when --debug is enabled)
  • sfcc-mcp-error.log - Error messages and stack traces
  • sfcc-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')"

## πŸ“– Documentation

**πŸ“š [Complete Documentation](https://taurgis.github.io/sfcc-dev-mcp/)** - Comprehensive guides and references

Quick Links:
- **[Installation Guide](https://taurgis.github.io/sfcc-dev-mcp/installation)** - Detailed installation options
- **[AI Interface Setup](https://taurgis.github.io/sfcc-dev-mcp/ai-interfaces)** - Configure Claude Desktop, GitHub Copilot, or Cursor
- **[Configuration Guide](https://taurgis.github.io/sfcc-dev-mcp/configuration)** - SFCC credentials and Data API setup
- **[Available Tools](https://taurgis.github.io/sfcc-dev-mcp/tools)** - Complete tool reference
- **[Examples](https://taurgis.github.io/sfcc-dev-mcp/examples)** - Real-world usage patterns
- **[Troubleshooting](https://taurgis.github.io/sfcc-dev-mcp/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" πŸ€– Provides best practices guide with complete hook implementation examples


## πŸ”’ 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

## 🀝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

**πŸš€ Ready to supercharge your SFCC development with AI?**

**[πŸ“– Get Started with the Full Documentation](https://taurgis.github.io/sfcc-dev-mcp/)**

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published