Configure Credentials for the Custom API Discovery MCP Tool

Configure the Commerce Cloud instance credentials so that the Custom API Discovery MCP Tool, scapi_custom_api_discovery, can authenticate to your Commerce Cloud instance. Choose one of the available methods to configure your Commerce Cloud credentials.

Create a dw.json file under your PWA Kit project directory with your Commerce Cloud credentials.

If the dw.json file isn't under your PWA Kit project directory, update your mcp.json file to point to the dw.json file path.

The MCP server fetches dw.json locally in this order of priority.

  1. dw.json path supplied from mcp settings args, if set.
  2. PWA_STOREFRONT_APP_PATH/dw.json
  3. PWA_STOREFRONT_APP_PATH/../dw.json
  4. PWA_STOREFRONT_APP_PATH/../../dw.json

Use environment variables to set your Commerce Cloud instance credentials.

Environment variables take precedence over dw.json values if both are provided.

If Commerce Cloud credentials aren't available for the scapi_custom_api_discovery MCP tool, provide local custom API files using one of these methods.

Set the SFCC_CARTRIDGE_PATH environment variable to point to your custom API cartridge directory.

If SFCC_CARTRIDGE_PATH isn't set, the tool automatically searches for api.json and schema.yaml files starting from PWA_STOREFRONT_APP_PATH and traversing up through parent directories until it reaches the filesystem root or home directory (maximum of 10 levels). At each directory level, it searches recursively down through subdirectories, up to 10 levels deep.

The MCP server searches for local custom API files in this order.

  1. Commerce Cloud credentials in the dw.json file or environment variables.
  2. The SFCC_CARTRIDGE_PATH environment variable. The MCP server searches recursively up to 10 levels deep in subdirectories.
  3. The PWA_STOREFRONT_APP_PATH environment variable and up to 5 parent directories. Searches recursively up to 10 levels deep in subdirectories at each level.