Skip to main content
Glama
nabhat

sfcc-logs-mcp

by nabhat

๐Ÿš€ Salesforce Commerce Cloud (SFCC) Logs MCP Server

CI Quality Gate Status Coverage License: MIT Node.js Version Model Context Protocol Dependabot Updates

A production-grade Model Context Protocol (MCP) server that enables AI coding assistants (Claude Desktop, Cursor, Gemini, Claude Code, VS Code Copilot, Windsurf, etc.) to query, tail, search, analyze, and clean Salesforce Commerce Cloud (SFCC / Demandware) logs in real-time over standard I/O (stdio).


โœจ Key Features

  • ๐Ÿ”„ Context-Aware Dynamic Workspace Resolution: Automatically detects the active workspace folder sent during the MCP initialization handshake and walks up the directory tree to find dw.json or .env. Switch between client projects or sandbox environments seamlessly without restarting your MCP server or changing settings.

  • โšก Bandwidth-Optimized Range Chunking: Uses HTTP Range headers (bytes=-1MB) over WebDAV to fetch only the trailing chunk of huge log files. Tail multi-gigabyte production logs in milliseconds with minimal bandwidth consumption.

  • ๐Ÿ” Multi-File Search & Filtering: Perform case-insensitive regex/text searches across multiple log files filtered by log level (error, warn, info, debug) or target date (YYYYMMDD or today).

  • โฑ๏ธ SFCC Background Job Analytics: Dedicated toolset to inspect cron job logs (job-*), filter entries by severity, and parse step boundaries to construct visual execution timelines (RUNNING, OK, ERROR).

  • ๐Ÿ“Š Statistical Log Volume Summaries: Generate high-level audits breaking down active log volume, category distributions, file counts, and newest active files for any given date.

  • ๐Ÿงน Log Sanitization: Clean or reset active log files directly from chat to isolate freshly reproduced bugs.


Related MCP server: Local Logs MCP Server

๐Ÿ“ฆ Installation

Install globally to make the sfcc-logs-mcp binary available everywhere in your PATH:

npm install -g sfcc-logs-mcp

Once installed globally, you can run:

sfcc-logs-mcp
# or shorthand alias
sfcc-logs

Run on Demand (npx)

npx sfcc-logs-mcp

๐Ÿ” Authentication & Credential Discovery

The server resolves credentials in the following order of priority:

1. dw.json (Standard SFCC Tooling Config)

Place a dw.json file in your workspace root (or any parent directory):

{
  "hostname": "your-sandbox.demandware.net",
  "username": "your_webdav_username",
  "password": "your_webdav_password",
  "webdav_path": "/on/demandware.servlet/webdav/Sites/Logs"
}

2. .env File

Alternatively, define credentials in a local .env file in your project folder:

SFCC_SERVER=your-sandbox.demandware.net
SFCC_USERNAME=your_webdav_username
SFCC_PASSWORD=your_webdav_password
SFCC_WEBDAV_PATH=/on/demandware.servlet/webdav/Sites/Logs

3. Environment Variables

Set system environment variables for static single-instance configurations:

DW_WEBDAV_USERNAME=your_webdav_username
DW_WEBDAV_PASSWORD=your_webdav_password
SFCC_SERVER=your-sandbox.demandware.net

๐Ÿ› ๏ธ MCP Tools Reference

Tool Name

Description

Arguments

get_sfcc_logfile

List all available log files or return the last count lines from a specific log file.

logFileName (optional), count (default: 10)

clean_sfcc_logfile

Clean/reset an active log file by replacing it with a timestamped cleared marker.

logFileName (required)

get_latest_error

Fetch the newest error logs for today or a specific date string (YYYYMMDD).

limit (default: 10), date (default: 'today')

get_latest_warn

Fetch the newest warning logs for today or a specific date string (YYYYMMDD).

limit (default: 10), date (default: 'today')

get_latest_info

Fetch the newest info logs for today or a specific date string (YYYYMMDD).

limit (default: 10), date (default: 'today')

get_latest_debug

Fetch the newest debug logs for today or a specific date string (YYYYMMDD).

limit (default: 10), date (default: 'today')

summarize_logs

Generate a statistical breakdown of log categories, file counts, and sizes.

date (default: 'today')

search_logs

Search across multiple log files matching level/date for a text pattern.

pattern (required), loglevel (default: 'all'), limit (default: 20), date (default: 'today')

get_latest_job_log_files

List background cron job log files (job-*), sorted newest first.

limit (default: 10)

search_job_logs_by_name

Filter background job logs strictly by Job ID/name (e.g. CatalogImport).

jobName (required), limit (default: 10)

get_job_log_entries

Retrieve trailing log entries inside a job log, optionally filtered by severity.

jobName (optional), level (default: 'all'), limit (default: 10)

search_job_logs

Search for a text pattern strictly within background job logs.

pattern (required), level (optional), limit (default: 20), jobName (optional)

get_job_execution_summary

Parses job step boundaries to return structured execution timeline & status (OK/ERROR/RUNNING).

jobName (optional)


๐Ÿ”Œ Connecting to AI Clients

Claude Desktop

Add to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "sfcc-logs": {
      "command": "sfcc-logs-mcp"
    }
  }
}

Cursor IDE

Add to .cursor/mcp.json in your workspace or global Cursor settings:

{
  "mcpServers": {
    "sfcc-logs": {
      "command": "sfcc-logs-mcp"
    }
  }
}

Windsurf / VS Code / Other MCP Clients

Configure the stdio server using the globally installed binary:

{
  "mcpServers": {
    "sfcc-logs": {
      "command": "npx",
      "args": ["-y", "sfcc-logs-mcp"]
    }
  }
}

๐Ÿงช Testing with MCP Inspector

You can test and verify all tools interactively using the official @modelcontextprotocol/inspector:

# 1. Interactive Web UI
npx @modelcontextprotocol/inspector sfcc-logs-mcp

# 2. CLI Mode (List tools)
npx @modelcontextprotocol/inspector --cli sfcc-logs-mcp --method tools/list

# 3. CLI Mode (Call a tool)
npx @modelcontextprotocol/inspector --cli sfcc-logs-mcp --method tools/call --tool-name get_latest_error

# 4. Interactive Terminal UI (TUI)
npx @modelcontextprotocol/inspector --tui sfcc-logs-mcp

๐Ÿ‘จโ€๐Ÿ’ป Development & Contributing

# Clone the repository
git clone https://github.com/nabhat/sfcc-logs-mcp.git
cd sfcc-logs-mcp

# Install dependencies
npm install

# Run unit tests with Vitest & coverage
npm run test

# Lint the codebase
npm run lint

# Compile TypeScript
npm run build

๐Ÿ“’ License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    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.
    15
    574
    27
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables monitoring and analysis of local application log files with real-time tailing, error tracking, and search capabilities. Perfect for debugging Node.js applications, web servers, or any application that writes to log files through natural language commands.
    6
    6
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to automatically inspect and analyze application runtime log files for debugging and troubleshooting. Supports monitoring multiple log directories simultaneously with tools for listing, reading, searching, and paginating through log files.
    8
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI coding agents with tools to query, search, and analyze persisted HTTP request logs, enabling efficient debugging without terminal noise.
    MIT

View all related MCP servers

Related MCP Connectors

  • Securely search and manage workspace context files for AI agents and teams.

  • Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.

  • Shared debugging memory for AI coding agents

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nabhat/sfcc-logs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server