Provides tools for interacting with SAP Commerce OCC APIs, enabling management of e-commerce operations including product catalog browsing, cart management, store lookups, customer search through ASM (Assisted Service Module), and various discovery flows for base sites, catalogs, and categories.
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 syncConfiguration
cp .env.example .envRun in stdio mode
python -m app.serverRun in SSE mode
fastmcp serve app/server.py --sse :8080Docker
docker build -t sap-commerce-mcp . docker run --env-file .env -p 8080:8080 sap-commerce-mcpDocker Compose
docker compose up --build
Testing
Run the full suite (includes unit + smoke checks):
pytest -qRun only the discovery live flow (spins up the MCP server in-process and hits the public OCC API):
pytest tests/test_integration_live.py -sRun 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
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables interaction with SAP Commerce systems through OCC APIs, supporting product discovery, cart management, customer support operations, and store information retrieval. Provides both local and remote connectivity options for AI agents to perform e-commerce tasks.