sfcc-logs-mcp
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-logs-mcp tail the latest error logs for the current SFCC instance"
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.
๐ Salesforce Commerce Cloud (SFCC) Logs MCP Server
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.jsonor.env. Switch between client projects or sandbox environments seamlessly without restarting your MCP server or changing settings.โก Bandwidth-Optimized Range Chunking: Uses HTTP
Rangeheaders (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 (YYYYMMDDortoday).โฑ๏ธ 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
Global Installation (Recommended)
Install globally to make the sfcc-logs-mcp binary available everywhere in your PATH:
npm install -g sfcc-logs-mcpOnce installed globally, you can run:
sfcc-logs-mcp
# or shorthand alias
sfcc-logsRun 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/Logs3. 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 |
| List all available log files or return the last |
|
| Clean/reset an active log file by replacing it with a timestamped cleared marker. |
|
| Fetch the newest error logs for |
|
| Fetch the newest warning logs for |
|
| Fetch the newest info logs for |
|
| Fetch the newest debug logs for |
|
| Generate a statistical breakdown of log categories, file counts, and sizes. |
|
| Search across multiple log files matching level/date for a text pattern. |
|
| List background cron job log files ( |
|
| Filter background job logs strictly by Job ID/name (e.g. |
|
| Retrieve trailing log entries inside a job log, optionally filtered by severity. |
|
| Search for a text pattern strictly within background job logs. |
|
| Parses job step boundaries to return structured execution timeline & status ( |
|
๐ Connecting to AI Clients
Claude Desktop
Add to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%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.
Available Tools
13 toolsclean_sfcc_logfileA
Clean/reset a specific SFCC log file by overwriting it with a clean message.
Inputs: logFileName (required).
get_job_execution_summaryB
Parses standard SFCC job steps boundries inside the newest job log file, returning a structured steps executioin audit timeline and step statuses (OK/ERROR/RUNNING).
Inputs: jobName.
get_job_log_entriesB
Retrieve trailing log entries inside a specific job log, optionally filtered by severity.
Inputs: level, limit, jobName.
get_latest_debugB
Retrieve the latest Debug logs from the active appserver.Tails the newest debug log file.
Inputs: date, limit.
get_latest_errorB
Retrieve the latest Error logs from the active appserver.Tails the newest error log file.
Inputs: date, limit.
get_latest_infoA
Retrieve the latest Info logs from the active appserver.Tails the newest info log file.
Inputs: date, limit.
get_latest_job_log_filesB
Lists active background cron job log files (starting with job- prefix) newest first.
Inputs: limit.
get_latest_warnB
Retrieve the latest Warning logs from the active appserver.Tails the newest warn log file.
Inputs: date, limit.
get_sfcc_logfileA
Get SFCC last Log file records. If logFileName is not provided list all available log files. If provided, return the last "count" lines from the file.
Inputs: count, logFileName.
search_job_logsC
Searches for a text pattern strictly inside background job logs.
Inputs: pattern (required), level, limit, jobName.
search_job_logs_by_nameB
Filters background job logs strictly by a specific job ID/name (e.g. (CatalogImport).
Inputs: jobName (required), limit.
search_logsC
Searches across multiple log files matching logLevel/date for a specific text pattern.
Inputs: pattern (required), date, limit, loglevel.
summarize_logsB
Retrieve a statistical audit overview of all log files generated on a specific date (clutter categories, active volume, newest active items).
Inputs: date.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 13 tools
Each tool targets a distinct log operation or type (error, warn, info, debug, job, general). Descriptions clearly differentiate overlapping aspects like search_job_logs vs search_logs.
All tools follow a verb_noun pattern with consistent use of get_, search_, clean_, summarize_. No mixing of conventions.
13 tools is well-scoped for a log management server, covering reading by severity, searching, summarizing, clearing, and job-specific operations without excess.
The toolset covers all major log operations: retrieval by severity, search, summary, file listing, clearing, and job log details. No obvious gaps for the domain.
Maintenance
Related MCP Connectors
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Ingest and search LogsLoom logs from coding agents.
Securely search and manage workspace context files for AI agents and teams.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Related MCP Servers
- AlicenseAqualityFmaintenanceProvides 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.151,007 npm28MIT
- AlicenseAqualityDmaintenanceEnables 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.65MIT
- AlicenseAqualityDmaintenanceEnables 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.8MIT
- AlicenseAqualityCmaintenanceEnables AI agents to interact with Adobe Commerce Cloud projects via REST API and SSH for database queries, log reading, environment management, and more, with no PHP CLI required.1580 npmMIT