
Sfcc Dev Mcp
io.github.taurgis由 GitHub 帳號 taurgis 發布v1.1.0更新於 Oct 24, 2026
MCP server for Salesforce B2C Commerce Cloud development assistance
概覽
本機 MCP 伺服器,讓 AI 助理查詢 Salesforce B2C Commerce Cloud(SFCC)文件、分析記錄檔並產生 cartridge。
- 可以做什麼
- 提供可搜尋的 SFCC API、SFRA 與 ISML 範本文件,以及檢視系統物件定義與站台偏好設定的工具。在具備認證的模式下,還會加入即時記錄檔與工作記錄檔分析、程式碼版本管理及指令碼偵錯工具操作。它也能產生 cartridge 結構,並將 AGENTS.md 與技能檔案引導寫入專案。
- 適用情境
- 適合希望助理回答 API 與範本問題、檢查執行個體記錄檔或建立 cartridge 的 SFCC 開發人員。僅文件模式不需要任何 SFCC 執行個體,也適合學習與離線查閱。
- 執行需求
- 需要 Node.js,透過 npx 或全域 npm 安裝執行,以本機 stdio 程序運作。僅文件模式不需要認證。完整模式需要 SFCC 執行個體主機名稱與一組認證:username 與 password,或 client-id 與 client-secret,可透過 dw.json 檔案、--dw-json 路徑或 SFCC_HOSTNAME、SFCC_USERNAME、SFCC_PASSWORD、SFCC_CLIENT_ID、SFCC_CLIENT_SECRET 環境變數提供。指令碼偵錯工具觸發可選用 storefrontUsername 與 storefrontPassword。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sfcc Dev Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
SFCC Development MCP Server
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
🚀 Quick Start
Option 1: Documentation-Only Mode (No SFCC credentials needed)
Option 2: Full Mode (With SFCC credentials for log and job analysis)
Create a dw.json file with your SFCC credentials. You can use either auth mode (or both):
- Basic auth:
username+password - OAuth:
client-id+client-secret - Optional storefront auth (for script debugger trigger on Basic-Auth storefronts):
storefrontUsername+storefrontPassword
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:
🔧 Configuration Discovery Priority
The server discovers SFCC credentials in this order (highest priority first):
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
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:
📦 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.
Global Installation
🐛 Debug Mode & Logging
Enable Debug Logging
--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
🧪 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:
Check pending release state against main before merging:
The 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:
In 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
🔒 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?
來源:README.md,提交 6105786
工具
0版本歷史
1- v1.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分