commerce-cloud-integrations/sap-commerce-mcp-server
If you are the rightful owner of sap-commerce-mcp-server 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.
The SAP Commerce MCP Server is a Model Context Protocol server that interfaces with SAP Commerce OCC APIs to facilitate various e-commerce operations.
SAP Commerce MCP Server
This project exposes a Model Context Protocol (MCP) server that wraps a growing subset of the SAP Commerce OCC APIs—covering discovery flows, product lookups, store details, ASM endpoints, and cart management. The server supports both stdio and HTTP+SSE transports so it can be used by local MCP-capable agents or remote services.
Features
- Discovery suite that lists base sites, store locations, catalogs, catalog versions, and category products.
- Product detail + stock lookup helpers to support agent-assisted merchandising tasks.
- Cart and cart-entry operations for both authenticated and anonymous users.
- ASM Customer 360 and customer search endpoints for support-focused agents.
- FastMCP transport over stdio (
python -m app.server) and SSE (fastmcp serve app/server.py --sse :8080). - Configurable base URL, fields, media type, and timeouts via environment variables (see
.env.example). - Docker and Docker Compose support for containerized deployments.
Getting Started
-
Initialize the environment
uv sync -
Configuration
cp .env.example .env -
Run in stdio mode
python -m app.server -
Run in SSE mode
fastmcp serve app/server.py --sse :8080 -
Docker
docker build -t sap-commerce-mcp . docker run --env-file .env -p 8080:8080 sap-commerce-mcp -
Docker Compose
docker compose up --build
Testing
- Run the full suite (includes unit + smoke checks):
pytest -q - Run only the discovery live flow (spins up the MCP server in-process and hits the public OCC API):
pytest tests/test_integration_live.py -s - Run the cart lifecycle flow (creates and mutates an anonymous cart against the live API):
pytest tests/test_integration_cart_flow.py -s
Note
Both the smoke and live integration tests reach out to the public SAP Commerce OCC endpoint referenced in your.env; they require network access and a working internet connection.
Documentation
- MCP manifest, resources, and tool registration live under
app/server.py. - Contribution guide for agents and automation:
AGENTS.md
Supported OCC Endpoints
- Base Sites
-
GET /basesites
-
- Stores
-
GET /{baseSiteId}/stores -
GET /{baseSiteId}/basestores/{baseStoreUid}
-
- Catalogs
-
GET /{baseSiteId}/catalogs -
GET /{baseSiteId}/catalogs/{catalogId} -
GET /{baseSiteId}/catalogs/{catalogId}/{catalogVersionId}
-
- Categories
-
GET /{baseSiteId}/categories/{categoryId}/products
-
- Products
-
GET /{baseSiteId}/products/{productCode} -
GET /{baseSiteId}/products/{productCode}/stock -
HEAD /{baseSiteId}/products/{productCode}/stock
-
- Carts
-
GET /{baseSiteId}/users/{userId}/carts -
POST /{baseSiteId}/users/{userId}/carts -
GET /{baseSiteId}/users/{userId}/carts/{cartId} -
DELETE /{baseSiteId}/users/{userId}/carts/{cartId}
-
- Cart Entries
-
GET /{baseSiteId}/users/{userId}/carts/{cartId}/entries -
POST /{baseSiteId}/users/{userId}/carts/{cartId}/entries -
GET /{baseSiteId}/users/{userId}/carts/{cartId}/entries/{entryNumber} -
PUT /{baseSiteId}/users/{userId}/carts/{cartId}/entries/{entryNumber} -
PATCH /{baseSiteId}/users/{userId}/carts/{cartId}/entries/{entryNumber} -
DELETE /{baseSiteId}/users/{userId}/carts/{cartId}/entries/{entryNumber}
-
- ASM
-
POST /{baseSiteId}/users/{userId}/customer360 -
POST /customers -
POST /customers/search -
POST /customers/suggestions/search
-