ZS

zautre/sfcc-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 5 forks 质量 52 趋势 18

A Model Context Protocol (MCP) server for interacting with Salesforce Commerce Cloud (SFCC) APIs.

概览

A Model Context Protocol (MCP) server for interacting with Salesforce Commerce Cloud (SFCC) APIs. - Dynamic endpoint registration based on endpoints.json configuration - Automatic handling of path and query parameters - Support for both GET and POST requests - OCAPI authentication using client credentials flow - Support for SFCC Data API endpoints, including product search - : HTTP-based server with OAuth authentication - : Each session can use different SFCC credentials and API endpoints - : Multiple clients can connect to different SFCC instances simultaneously - : GitHub Actions integration for Google App Engine deployment - : Automated versioning and deployment workflows Create a .env file in the project root directory with the following variables: To use the SFCC Data APIs, you need to configure an API client in SFCC with the proper permissions: 1. In SFCC Account Manager, go to API Client 2. Create a new API client or edit an existing one 3.

README

以下为原文 README 节选,完整内容请查看原文。

SFCC MCP Server

A Model Context Protocol (MCP) server for interacting with Salesforce Commerce Cloud (SFCC) APIs.

Features

  • Dynamic endpoint registration based on endpoints.json configuration
  • Automatic handling of path and query parameters
  • Support for both GET and POST requests
  • OCAPI authentication using client credentials flow
  • Support for SFCC Data API endpoints, including product search
  • Remote mode: HTTP-based server with OAuth authentication
  • Per-session configuration: Each session can use different SFCC credentials and API endpoints
  • Multi-tenant support: Multiple clients can connect to different SFCC instances simultaneously
  • Automated deployment: GitHub Actions integration for Google App Engine deployment
  • Version management: Automated versioning and deployment workflows

Installation

# Install dependencies
npm install

# Build the server
npm run build

Configuration

Create a .env file in the project root directory with the following variables:

# SFCC API Configuration
SFCC_API_BASE=https://your-instance.api.commercecloud.salesforce.com/

# Admin API Credentials (Client credentials flow)
SFCC_ADMIN_CLIENT_ID=your_admin_client_id
SFCC_ADMIN_CLIENT_SECRET=your_admin_client_secret

OCAPI Configuration

To use the SFCC Data APIs, you need to configure an API client in SFCC with the proper permissions:

API Client

  1. In SFCC Account Manager, go to API Client
  2. Create a new API client or edit an existing one
  3. Configure the OAuth settings:
    • OAuth Client ID: (your client ID)
    • OAuth Client Secret: (your client secret)
    • Default scopes: Include the scopes needed for your endpoints
    • Token Endpoint Auth Method: client_secret_post
  4. Configure API client roles:
    • Assign appropriate roles to access the required data

Business Manager

  1. In SFCC Business Manager, go to Administration > Site Development > Open Commerce API Settings
  2. See ocapi-bm-config.json for the configuration example

MCP Configuration for VSCode

  1. Open Command Palette (Ctrl/Cmd + Shift + P)
  2. Type “MCP” and choose MCP: Add Server...
  3. Choose Command (stdio) Manual Install
  4. Type node /build/index.js for the command (replace path placeholder before submit)
  5. Name the MCP (e.g., “sfcc”)
  6. Choose to configure for User or Workspace

This will create a new server definition either in your user settings.json or in workspace .vscode/mcp.json

{
    "servers": {
        "sfcc": {
            "type": "stdio",
            "command": "node",
            "args": [
                "/build/index.js"
            ]
        }
    }
}

Now you can monitor/start/restart/stop your server through MCP: List Servers command. Work with tools by switching to Agent mode in GitHub Copilot Chat

Usage

Start the server:

node build/index.js

Endpoint Configuration

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →