connect-mcp-server-template

commercetools/connect-mcp-server-template

3.1

If you are the rightful owner of connect-mcp-server-template and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This project provides a template for building a Model Context Protocol (MCP) server for commercetools Composable Commerce.

Remote MCP Server Template [Early version]

This project provides a template for building a Model Context Protocol (MCP) server for commercetools Composable Commerce. The MCP server can be hosted on commercetools Connect and is designed to be easily configurable and extensible for various commerce use cases.

Overview

The MCP server acts as a servicable channel to AI agents that enables secure, flexible, and context-aware access to commercetools APIs. It supports both public and private authentication modes and allows fine-grained control over available tools and actions.

Features

  • Configurable authentication: Supports both client_credentials and auth_token authentication.
  • Tool-based access control: Enable or restrict API actions using the TOOLS configuration.
  • Admin mode: Optionally allow resource creation and editing.
  • Easy deployment: Ready to be hosted on commercetools Connect.

Configuration

Configuration is managed via the connect.yaml file. Below is an explanation of each field:

standardConfiguration

KeyDescriptionDefaultRequired
AUTH_TYPEUse client_credentials for public MCP with configured API client, or auth_token for Bearer token access.client_credentialsNo
AUTH_URLcommercetools Composable Commerce Auth URL.Yes
API_URLcommercetools Composable Commerce API URL.Yes
TOOLSComma-separated list of tools (see documentation). Use all for all tools.allYes
IS_ADMINSet to true to allow resource creation and editing. Review your use case before enabling.falseNo

securedConfiguration

KeyDescriptionRequired
PROJECT_KEYcommercetools Composable Commerce project key.Yes
CLIENT_IDcommercetools Composable Commerce client ID.Yes
CLIENT_SECRETcommercetools Composable Commerce client secret.Yes

Authentication

  • Public Mode (client_credentials):
    Uses the configured API client credentials for authentication.
  • Private Mode (auth_token):
    Requires an Authorization header with a Bearer token in each request.

Tool Configuration

The TOOLS field controls which API actions are available.

  • Use a comma-separated list (e.g., products.read,cart.create).
  • Use all to enable all available tools.
  • Refer to the MCP Essentials documentation for the full list.

How to develop

  1. Clone the repository:

    git clone <your-repo-url>
    cd composable-commerce-remote-mcp
    
  2. Install dependencies:

    npm install
    
  3. Configure your environment:

    • Edit connect.yaml to set your project credentials and desired configuration.
    • Optionally, use a .env file for local development.
  4. Run the MCP server locally:

    npm run build
    npm start
    
  5. Deploy to Connect:

    • Package your service and deploy using commercetools Connect documentation.

Support

For questions or issues, please contact the commercetools support team.

References