SAP-Commerce-MCP
This server is an MCP (Model Context Protocol) server that enables AI assistants to directly control, automate, orchestrate, and self-heal SAP Commerce Cloud (Hybris) environments and headless Spartacus storefronts.
HAC Core Runtime & Authentication: Configure credentials, check connection status, SSO login, run FlexibleSearch queries, import ImpEx scripts, and execute Groovy scripts.
Greenfield Site Provisioning: Scaffold complete sites (BaseSite, BaseStore, catalogs, OAuth, currencies, languages), scaffold CMS content, and generate Spartacus app config.
Spartacus Diagnostics & Auto-Healing: Run headless storefront health checks (CORS, OAuth, OCC URL patterns, CMS status) and auto-fix common issues.
B2B Organization Governance: Scaffold full B2B unit hierarchies, cost centers, budgets, approval thresholds, and demo users; audit user org context.
Drools Promotion Engine: Scaffold and publish promotion rules (threshold discounts, free gifts, bundles, potential messages) with automatic Drools compilation.
Solr Search & Catalog Sync: Trigger full/incremental Solr reindexing, query indexer status, sync catalog versions (Staged→Online), and clear region cache.
External Storefront Ingestion: Crawl existing e-commerce sites (Shopify, WooCommerce, Magento) to extract products and generate Hybris-compatible ImpEx imports.
i18n Completeness Checks: Audit missing translations across product catalogs and languages.
Self-Evolution & Script Library: List/retrieve verified scripts, run self-diagnostics, self-improve server modules, and record knowledge base entries.
Provides tools for interacting with SAP Commerce Cloud (Hybris) environments, enabling AI assistants to control and automate site provisioning, B2B organization governance, Drools promotions, Solr indexing, catalog synchronization, and more.
Allows crawling Shopify storefronts to extract product data and generate SAP Commerce Cloud-compatible ImpEx for import into Hybris catalogs.
Allows crawling WooCommerce storefronts to extract product data and generate SAP Commerce Cloud-compatible ImpEx for import into Hybris catalogs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SAP-Commerce-MCP run a full Solr reindex on my Hybris environment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SAP Commerce Cloud MCP Server (SAP-Commerce-MCP)
SAP-Commerce-MCP (sap-commerce-mcp) is an enterprise-grade Model Context Protocol (MCP) server that empowers AI assistants (Claude, Antigravity, Cursor, etc.) to directly control, automate, orchestrate, and self-heal SAP Commerce Cloud (Hybris) environments and Headless Composable Storefronts (Spartacus).
Far beyond a basic Hybris Administration Console (HAC) bridge, it functions as a comprehensive Commerce Cloud Copilot with Greenfield site provisioning, B2B organizational governance, Drools promotion engine orchestration, headless Spartacus storefront diagnostics, Solr search indexing, catalog synchronization, and an agentic self-evolution engine.
📜 Evolution: From hybris-hac-mcp to Enterprise SAP-Commerce-MCP
Why do tool names keep the
hac_*prefix?This project originated as
hybris-hac-mcp, a developer tool focused on executing FlexibleSearch queries and Groovy scripts through the Hybris Administration Console (HAC).In actual enterprise delivery, large-scale customer engagements (such as a Fortune 500 FMCG/Beverage eB2B portal and a Global Medical Device B2B procurement platform) required far more than low-level script execution. They demanded Greenfield site provisioning, B2B organizational approval chain governance, Drools promotion engine compilation, Solr real-time indexing, and headless Spartacus full-stack diagnostics.
Therefore, the project was comprehensively upgraded to
SAP-Commerce-MCP. To ensure 100% backward compatibility with existing AI agents, prompts, and automation skills, all tool names strictly retain theirhac_*prefixes, while their underlying implementations and domain capabilities have evolved into a complete, enterprise-grade Commerce DevOps engine.
flowchart LR
V1["Phase 1: hybris-hac-mcp\n(HAC Script Runner)"] -->|Evolution & Production Validation| V2["Phase 2: SAP-Commerce-MCP\n(Full-Lifecycle Commerce DevOps Engine)"]
subgraph V1_Cap ["Phase 1 Focus"]
direction TB
c1["FlexibleSearch Queries"]
c2["ImpEx Imports"]
c3["Groovy Execution"]
end
subgraph V2_Cap ["Phase 2 Enterprise Capabilities"]
direction TB
d1["Zero-to-One Greenfield Site Scaffolding"]
d2["B2B Organizational Governance & Approval Audit"]
d3["Drools Promotion Engine Rule Orchestration"]
d4["Spartacus Headless Auto-Healing & CORS"]
d5["Solr Indexing & Catalog Sync Platform Ops"]
d6["Knowledge Base & Self-Evolution Engine"]
end
V1 -.-> V1_Cap
V2 -.-> V2_CapRelated MCP server: SAP Commerce MCP Server
🌟 Key Capabilities at a Glance
🚀 Two-Call Greenfield Pipeline:
hac_provision_sitescaffolds the branded structure (and returns a machine-readablenext_stepschecklist); thenhac_ingest_external_storefront— given the site URL — auto-chains the rest in ONE call: crawl real products → import → provision Solr config → catalog sync (Staged→Online, multi-language) → provision stock → Solr reindex (on the new catalog's config). Every sub-step is individually toggleable for step-by-step debugging.🌎 Instance-Adaptive / Zero-Config: values that differ per SAP Commerce instance (taxGroup, blueprint site, languages, user groups, Solr blueprint) are auto-detected from the target instance at runtime — with caller-override params and safe fallbacks — so it runs on a fresh instance without editing code. FX rates for multi-currency pricing are demo-grade defaults, overridable via
fx_rates.🏗️ Zero-to-One Greenfield Provisioning: Instant scaffolding of
BaseSite,BaseStore,ProductCatalog(Staged & Online), Content Catalogs, Sync Jobs (withsyncLanguagesso localized names actually sync), Multi-currency, Multi-language, and OCC OAuth client credentials (with the requiredregisteredRedirectUri).🌐 External Storefront Ingestion: Crawl any existing e-commerce website (Shopify, WooCommerce, Magento, custom) to extract product catalogs, images, prices, and attributes — then auto-generate Hybris-compatible ImpEx for instant import.
🩺 Headless Spartacus Doctor & Auto-Healing: Deep diagnostics for Composable Storefronts, detecting CORS whitelist gaps, OCC URL regex mismatches, OAuth client registrations, and CMS online status with one-click automated remediation.
🏢 B2B Organization Governance: Automated setup and validation of multi-tiered
B2BUnithierarchies,B2BBudget,B2BCostCenter,B2BOrderThresholdPermissionapproval limits, and demo buyer/approver personas.🏷️ Drools Promotion Engine Orchestration: Code-free provisioning of B2B/B2C promotion rules (Spend Thresholds, Free Gifts, A+B+C Bundles, and Potential Promotion reminders) with automatic Drools rule compilation and publishing.
⚡ Direct Hybris Runtime Control: Seamless execution of FlexibleSearch queries (rendered as Markdown tables), transactional ImpEx imports with strict validation, and Groovy scripts executed live in the Hybris JVM container.
🔍 Solr Indexing & Platform Ops: In-process full/update Solr reindexing, cronjob monitoring, catalog synchronization, and Hybris Region Cache clearing.
🧠 Self-Evolution & Proven Script Library: Built-in script asset manager archiving verified Groovy/ImpEx scripts, domain knowledge base accumulating troubleshooting experience, and self-improving meta-tools.
🏢 Field-Tested Enterprise Case Studies
🥤 Case 1: FMCG Beverage eB2B Ordering Portal (Asia-Pacific Region)
Challenge: Deliver a brand-new eB2B beverage ordering platform with 100+ drink SKUs, 13 product lines, bilingual localization (Traditional Chinese
zh_TWand Englishen), Drools beverage bundle promotions, and an Angular/Spartacus headless storefront.SAP-Commerce-MCP in Action:
hac_scaffold_greenfield_site: Initialized the dedicated BaseSite, dual product catalogs, and OCC OAuth clients in 15 seconds.hac_impex_import: Imported 100+ beverage SKUs with multi-tier wholesale pricing and category mappings.hac_groovy_execute: Bound official product imagery in bulk directly within the Hybris JVM container.hac_promotion_scaffold: Provisioned an A+B+C beverage bundle promo with automatic Drools rule compilation.hac_solr_reindex: Executed full Solr reindexing to immediately expose all products in the search facet index.hac_storefront_autofix: Automatically configured CORS whitelisting and OCC URL patterns for Spartacus on port 4200.
🏥 Case 2: Global Medical Device B2B Multi-Tier Approval & Cost Center Governance
Challenge: Establish an enterprise medical device procurement hierarchy across global branches, enforcing multi-tier cost center budgets and order threshold approvals.
SAP-Commerce-MCP in Action:
hac_b2b_scaffold_org: Created the corporate Root Unit, department-level sub-units (e.g. Radiology, Surgical), designated Cost Centers, and assigned budgets with dual-threshold approval rules.hac_b2b_org_doctor: Instantly analyzed and audited test buyer accounts, validating approval threshold triggers and cost center deduction chains before going live.
🏛️ Architecture Overview
flowchart TD
subgraph AI_Agents ["AI Assistants & IDEs"]
Agent[Claude / Antigravity / Cursor]
end
subgraph MCP_Server ["SAP-Commerce-MCP (sap-commerce-mcp)"]
Server[MCP Server Core - JSON-RPC Stdio]
HAC[HAC HTTP Client & CSRF Handler]
SSO[Corporate SSO Authenticator]
Scaffolder[Site & CMS Scaffolder]
Doctor[Spartacus Doctor & AutoFix]
B2B[B2B Org Governance]
Promo[Drools Promotion Engine]
Solr[Solr & Platform Ops]
Crawler[Storefront Ingestion]
SelfEvolve[Self-Evolution & Script Library]
end
subgraph Target_Environments ["SAP Commerce Cloud Ecosystem"]
HybrisJVM["SAP Commerce Cloud (CCL 2211 / CCv2)\n- HAC & Web Services (OCC)\n- Drools Rule Engine\n- Solr Search Engine"]
Storefront["Composable Storefront (Spartacus)\nAngular / SSR on Node.js"]
end
Agent <-->|MCP Protocol (JSON-RPC)| Server
Server --> HAC
Server --> SSO
Server --> Scaffolder
Server --> Doctor
Server --> B2B
Server --> Promo
Server --> Solr
Server --> Crawler
Server --> SelfEvolve
HAC <-->|HTTPS / Session / CSRF| HybrisJVM
Doctor <-->|REST / DOM Probe| Storefront🛠️ Complete Tool Suite (27 Tools)
1. HAC Core Runtime & Authentication (6 Tools)
Tool Name | Key Parameters | Description |
|
| Dynamically configures the target Commerce Cloud instance URL, credentials, and session cache path. |
| (None) | Checks connection health, active credentials, session validity, and CSRF token status. |
| (None) | Launches an interactive browser session to handle corporate SSO (SAP Identity / Microsoft Entra) and caches the session cookie. |
|
| Executes FlexibleSearch queries and formats tabular output directly into Markdown. |
|
| Imports ImpEx scripts with strict/relaxed validation and detailed error reporting. |
|
| Executes Groovy scripts directly inside the Commerce Cloud JVM container. |
2. Greenfield Site Provisioning & CMS Orchestration (4 Tools)
Tool Name | Key Parameters | Description |
|
| Fully automates new site creation: BaseSite, BaseStore, Catalogs (Staged & Online), Sync Jobs, Currencies, Languages, OCC URL regex, and trusted OAuth clients. |
| (None) | Lists all configured |
|
| Scaffolds responsive homepage CMS structures (banners, carousels, responsive navigation nodes). |
|
| Generates or writes ready-to-use Spartacus |
3. Headless Spartacus Diagnostics & Auto-Healing (2 Tools)
Tool Name | Key Parameters | Description |
|
| Comprehensive headless storefront health check: BaseSite existence, OCC URL regex patterns, CORS allowed origins, OAuth client registration, and Homepage CMS status. |
|
| Automatically remediates identified Spartacus/OCC bottlenecks (CORS whitelisting, OAuth registration, staged-to-online CMS publishing). |
4. B2B Organization Hierarchy & Governance (2 Tools)
Tool Name | Key Parameters | Description |
|
| Scaffolds enterprise B2B customer hierarchy: Root Unit, sub-departments, Cost Centers, Budgets, Approval Thresholds, and Buyer/Approver demo accounts. |
|
| In-depth audit of a B2B user: Unit hierarchy, assigned cost centers, approval chains, user groups, and checkout authorizations. |
5. Drools Promotion Engine Orchestration (2 Tools)
Tool Name | Key Parameters | Description |
|
| Automates Drools promotion rules: Order Total Threshold discounts, Buy X Get Y Free Gifts, Multi-Product Bundles (A+B+C), and Potential Promotion reminders. |
|
| Lists and filters active |
6. Solr Search, Catalog Sync & Platform Ops (5 Tools)
Tool Name | Key Parameters | Description |
|
| Triggers in-process full or incremental Solr reindexing for target facet search configurations. |
|
| Queries the status and duration of running Solr indexer cronjobs. |
|
| Triggers catalog version synchronization jobs ( |
| (None) | Clears the Hybris Region Cache in memory. |
|
| Audits localization completeness across product catalogs (detects missing translations in |
7. External Ingestion, Script Library & Self-Evolution (6 Tools)
Tool Name | Key Parameters | Description |
|
| Crawls external e-commerce sites (Shopify, WooCommerce, Magento) to extract products and generate Hybris-compatible ImpEx. |
|
| Browses the local repository of proven, verified Groovy and ImpEx scripts. |
|
| Retrieves the full content of an archived script by identifier. |
| (None) | Performs self-diagnostics on the MCP server itself (module health, script library count, knowledge base rules). |
|
| Enhances server capability and internalizes new operational tools. |
|
| Persists domain knowledge, error patterns, and troubleshooting rules into |
🚀 10-Second Quick Start
Thanks to modern Python packaging with pyproject.toml, you do not need to manually clone, build, or configure Python virtual environments. You can run the server directly via uvx.
Method 1: Zero-Install with uvx (Recommended)
Option A: One-line setup with Claude CLI
claude mcp add sap-commerce-mcp -- uvx --from git+https://github.com/chriszhangrui/sap-commerce-mcp.git sap-commerce-mcpOption B: Configure in Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"sap-commerce-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/chriszhangrui/sap-commerce-mcp.git",
"sap-commerce-mcp"
],
"env": {
"HAC_URL": "https://localhost:9002",
"HAC_USER": "admin",
"HAC_PASS": "nimda"
}
}
}
}Option C: Configure in Antigravity / Gemini CLI (mcp_config.json)
{
"mcpServers": {
"sap-commerce-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/chriszhangrui/sap-commerce-mcp.git",
"sap-commerce-mcp"
]
}
}
}Method 2: Local Development / Manual Git Clone
For local MCP development or custom script additions:
# 1. Clone repo
git clone https://github.com/chriszhangrui/sap-commerce-mcp.git
cd sap-commerce-mcp
# 2. Create and activate venv
python3 -m venv venv
source venv/bin/activate
# 3. Install in editable mode
pip install -e .
# 4. Run test suite
python test_server.pyExpected verification output:
✓ Initialize: sap-commerce-mcp
✓ Registered tools count: 27
✓ Self-Diagnose Preview: 🟢 核心模块全部正常就绪
...
🎉 ALL 27 MCP TOOLS OPERATIONAL & VERIFIED OVER JSON-RPC STDIO!💡 Example Prompt Scenarios
Once connected, your AI assistant can execute complex Commerce tasks directly from natural language:
⭐ Scenario 0: One-Sentence Full-Stack Site Build (The Killer Feature)
"Build me a B2B site from scratch based on https://www.example.com." "Site name: APAC Beverages, Currencies: HKD, USD, Languages: zh_TW, en"
That's it. The agent reads the embedded pipeline from the tool description and automatically:
Scaffolds the BaseSite, Store, Catalogs, OAuth
Crawls the source website for products, images, prices
Generates and imports ImpEx
Binds product images
Syncs Staged → Online catalogs
Runs full Solr reindex
Runs Spartacus doctor + autofix
Scenario 1: Greenfield B2B Storefront Scaffolding
"Scaffold a new B2B site called
apac-beverageswith currency HKD and USD, languages zh_TW and en, link it to powertools catalogs, and verify Spartacus headless readiness."
Scenario 2: Drools Promotion Orchestration
"Create an A+B+C sparkling beverage bundle promotion in the powertoolsPromoGrp module: when a customer buys Coke, Sprite, and Fanta together, gift them 1 case of Monster Energy. Ensure the message is localized in English and Traditional Chinese."
Scenario 3: B2B Organization & Approval Flow Diagnosis
"Run an audit on B2B buyer
buyer.medtech_global@demo.com. Why is their checkout order being held for approval? Check their cost center and approval threshold."
Scenario 4: Live Data Inspection
"Execute a FlexibleSearch to list the top 10 products in powertoolsProductCatalog Online version ordered by creation time."
📚 Best Practices & Troubleshooting
Accumulated from field engagements and embedded in knowledge_base.json:
CSRF Token Handling: Commerce Cloud 2211 requires strict CSRF verification for all POST requests.
SAP-Commerce-MCPautomatically fetches and refreshes CSRF tokens alongside session cookies on every request.Drools Promotion Publication: After creating a
PromotionSourceRule, it must be compiled into a runtime rule.hac_promotion_scaffoldtriggers the Promotion Engine compilation job automatically.Solr Index Updates: After bulk-updating product categories or imagery via Groovy/ImpEx, always invoke
hac_solr_reindex(full_reindex=False)to synchronize search facets without server restarts.Spartacus CORS & OCC URL Mismatches: When Spartacus fails to load products, run
hac_spartacus_doctorfirst. 90% of issues stem from missing origins incorsfilter.commercewebservices.allowedOriginsor mismatchedurlEncodingAttributes. Usehac_storefront_autofixfor immediate resolution.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
27 toolshac_b2b_org_doctorC
Diagnoses a B2B user's organizational context (Unit, Cost Center, Budget, Approvers, Permissions) with language-aligned output.
Inputs: user_uid (required), lang. Returns: result
hac_b2b_scaffold_orgC
Scaffolds a complete, realistic B2B organization hierarchy with units, cost centers, budgets, permissions, and demo users.
Inputs: root_unit_id (required), root_unit_name (required), currency, languages, +8 more. Returns: result
hac_cache_clearA
Clears the Hybris Region Cache in real time to ensure modified data and CMS pages reflect immediately.
Inputs: no named parameters. Returns: result
hac_catalog_syncC
Triggers synchronization from source catalog version to target catalog version.
Inputs: catalog_id (required), source_version, target_version. Returns: result
hac_check_i18n_completenessC
Scans for missing localized names/descriptions in target languages.
Inputs: item_type, languages, catalog_id. Returns: result
hac_configureC
Configures the target SAP Commerce HAC instance and credentials.
Inputs: host (required), password, username, sso_storage_path. Returns: result
hac_flexsearchC
Executes a FlexibleSearch SQL query on the SAP Commerce database.
Inputs: query (required), host, max_count. Returns: result
hac_groovy_executeC
Executes a Groovy script in the HAC Scripting Console. Automatically archives successful scripts to script library.
Inputs: host, commit, script, file_path, +2 more. Returns: result
hac_impex_importC
Imports an ImpEx script into the SAP Commerce instance. Automatically archives successful scripts to script library.
Inputs: host, file_path, client_name, legacy_mode, +5 more. Returns: result
hac_ingest_external_storefrontA
Crawls an external storefront (Shopify, WooCommerce, Magento, or any public e-commerce site), extracts product catalog structure, product names, descriptions, prices, images, and attributes, normalizes them into SAP Commerce ImpEx format, imports them into the target ProductCatalog, syncs to Online, and reindexes Solr.
This is STEP 2 of the zero-to-live pipeline (automatically invoked after hac_scaffold_greenfield_site when the user provides a source_url).
After this tool completes, the agent should continue with:
hac_catalog_sync (if sync_online=False was set)
hac_solr_reindex (if reindex_solr=False was set)
hac_spartacus_doctor + hac_storefront_autofix (headless self-healing)
Args: site_url: The customer's existing website URL to crawl (e.g. 'https://shop.example.com') catalog_id: Target ProductCatalog ID to import products into max_products: Maximum number of products to extract (default 20) convert_to_b2b_cases: Convert product models to B2B unit-of-measure (cases/pallets) target_currency: Currency code for imported prices sync_online: Auto-sync Staged→Online after import (default True) reindex_solr: Auto-trigger full Solr reindex after import (default True)
Inputs: site_url (required), catalog_id (required), sync_online, max_products, +3 more. Returns: result
hac_library_getB
Retrieves the complete content and metadata of a verified script from the unified script library.
Args: script_id: Unique identifier of the script (e.g. 'impex_20260911_115440_b2b_org_medical_mindray')
Inputs: script_id (required). Returns: result
hac_library_listB
Lists and searches verified successful scripts (ImpEx and Groovy) stored in the unified script library.
Args: script_type: Filter by 'impex' or 'groovy' (optional) category: Filter by category (e.g. 'b2b_organization', 'search_solr', 'cache_ops') client: Filter by customer/client name (optional) query: Search keyword across script names, tags, descriptions (optional)
Inputs: query, client, category, script_type. Returns: result
hac_promotion_listB
Lists and monitors active and draft PromotionSourceRules in SAP Commerce Cloud.
Args: promo_group: Filter by PromotionGroup identifier (optional) status: Filter by status ('PUBLISHED', 'UNPUBLISHED', 'MODIFIED', 'ALL') lang: Output language ('zh' or 'en')
Inputs: lang, status, promo_group. Returns: result
hac_promotion_scaffoldA
Scaffolds, configures, and publishes a PromotionSourceRule in the SAP Commerce Drools Rule Engine.
Args: rule_code: Unique code for the promotion rule (e.g. 'promo_summer_sale_100') name: Business title/name of the promotion promo_type: Promotion pattern: - 'ORDER_THRESHOLD_DISCOUNT': Order threshold discount (spend X get fixed discount or percentage off) - 'ORDER_THRESHOLD_FREE_GIFT': Spend X get free gift SKU - 'BUNDLE_FREE_GIFT': Multi-product bundle (A+B+C) gets free gift - 'PRODUCT_DISCOUNT': Specific product percentage or fixed discount - 'POTENTIAL_MESSAGE': Upsell hint when cart has not reached threshold threshold_amount: Minimum cart total threshold (e.g. 500.0) currency: Currency code (e.g. 'USD', 'CNY', 'HKD', 'EUR') discount_amount: Fixed discount amount (e.g. 50.0) discount_percentage: Percentage discount (e.g. 10.0 for 10% off) qualifying_products: List of qualifying product codes (SKUs) gift_product: SKU of the free gift product gift_quantity: Quantity of the free gift product (default 1) target_rule_code: Target rule code to check execution for POTENTIAL_MESSAGE message_fired: User notification message when promotion executes promo_group: Target PromotionGroup identifier (default 'powertoolsPromoGrp') priority: Rule execution priority (default 150) compile_immediately: If True, triggers Drools rules-module compilation immediately (default True) lang: Output language ('zh' for Chinese, 'en' for English)
Inputs: name (required), rule_code (required), lang, currency, +13 more. Returns: result
hac_record_learningA
Records a newly discovered error pattern, solution, or best practice into the MCP's persistent knowledge base.
Args: pattern_name: Short title for the rule/pattern (e.g. 'B2BCostCenter Type Code') problem: Description of the obstacle, error, or symptom encountered solution: Exact fix, workaround, or ImpEx/Groovy snippet that solves it tags: Categorization tags (e.g. ['b2b', 'impex'])
Inputs: problem (required), solution (required), pattern_name (required), tags. Returns: result
hac_scaffold_greenfield_siteA
Scaffolds a complete greenfield SAP Commerce site, BaseStore, ProductCatalog, OCC headless URL patterns, OAuth clients, and optional B2B organization hierarchy.
⚠️ IMPORTANT — Full Zero-to-Live Pipeline Orchestration: When a user asks to "build a site from scratch" or "从零建站", this tool is only STEP 1 of a mandatory 7-step pipeline. After calling this tool, the AI agent MUST automatically continue executing ALL remaining steps WITHOUT waiting for further user instructions:
Step 1: hac_scaffold_greenfield_site → Create BaseSite, BaseStore, Catalogs, OAuth Step 2: hac_ingest_external_storefront → If source_url is provided, crawl the website to extract product categories, product names, descriptions, prices, images, and attributes, then auto-generate and import ImpEx Step 3: hac_impex_import → (If user provides CSV/Excel/ImpEx instead of URL) Step 4: hac_groovy_execute → Bind product images from CDN/S3/crawled URLs Step 5: hac_catalog_sync → Sync ProductCatalog from Staged to Online Step 6: hac_solr_reindex → Full Solr reindex to make products searchable Step 7: hac_spartacus_doctor + hac_storefront_autofix → Diagnose and auto-heal the headless Spartacus storefront (CORS, OAuth, OCC URL patterns)
The user should only need to provide:
Customer name (site_name)
B2B or B2C (channel)
Currencies and languages
The customer's existing website URL (source_url) — optional, for product crawling
Everything else is automatic. Do NOT ask the user to manually specify each step.
Args: site_id: Unique site identifier (e.g. 'apac-beverages') site_name: Human-readable site name (e.g. 'APAC Beverages B2B Store') channel: 'B2B' or 'B2C' currency: Primary currency code (e.g. 'HKD', 'USD', 'CNY') languages: List of language codes (e.g. ['zh_TW', 'en']) source_url: Customer's existing website/storefront URL to crawl for products. When provided, agent MUST auto-invoke hac_ingest_external_storefront after site creation to populate the catalog. storefront_origin: Spartacus frontend origin for CORS configuration content_catalog: Custom content catalog ID (auto-generated if omitted) delivery_countries: List of delivery country codes setup_b2b_org: Whether to scaffold B2B org hierarchy (only when channel='B2B') monthly_budget: B2B cost center monthly budget amount approval_threshold: B2B order approval threshold amount
Inputs: site_id (required), site_name (required), channel, currency, +8 more. Returns: result
hac_self_diagnoseA
Runs a self-health audit on the SAP-Commerce-MCP server: checks regression test suite, counts archived scripts in unified library, and reviews learned best-practice rules.
Inputs: no named parameters. Returns: result
hac_self_improveA
Self-evolves the MCP by updating one of its own Python modules. Automatically creates a backup, runs syntax checks and full regression test suite. Rolls back immediately if tests fail.
Args: target_file: Relative filename within MCP directory (e.g. 'site_scaffolder.py', 'b2b_org_helper.py') description: Summary of the improvement, fix, or capability being added updated_code: Complete updated Python code for the target module
Inputs: description (required), target_file (required), updated_code (required). Returns: result
hac_site_listC
Lists all CMSSites in the SAP Commerce instance with their BaseStore, ProductCatalog, ContentCatalogs, Languages, Currencies, and active status. Essential for enterprise multi-brand group governance.
Inputs: lang. Returns: result
hac_solr_reindexB
Triggers an immediate in-process Solr index build (FULL or UPDATE) bypassing cronjob queue delays.
Inputs: mode, config_name. Returns: result
hac_solr_statusA
Queries Solr search configurations and recent indexer cronjobs.
Inputs: no named parameters. Returns: result
hac_spartacus_doctorC
Performs a full headless readiness health check for a Spartacus storefront and Commerce Cloud BaseSite.
Inputs: lang, site_id, storefront_url. Returns: result
hac_sso_loginA
Launches a headed browser window for the user to complete SAP internal SSO authentication.
Inputs: host. Returns: result
hac_statusA
Checks the current status and authentication of the configured HAC connection.
Inputs: no named parameters. Returns: result
hac_storefront_app_configB
Inspects and aligns the local Composable Storefront Angular workspace configuration:
Synchronizes backend OCC CX_BASE_URL in .env-cmdrc
Aligns baseSite and multi-language routing in spartacus-b2b-configuration.providers.ts
Verifies B2B/B2C mode flags
Args: storefront_dir: Path to local Spartacus storefront repository backend_url: Target Commerce Cloud backend OCC URL (default 'https://localhost:9002') base_site: Target BaseSite UID (default 'powertools-spa') b2b_mode: Whether B2B mode is enabled (default True) lang: Output language ('zh' or 'en')
Inputs: lang, b2b_mode, base_site, backend_url, +1 more. Returns: result
hac_storefront_autofixA
One-click automated repair for Composable Storefront (Spartacus) headless readiness issues:
Injects matching frontend origin regex into BaseSite.urlPatterns
Dynamically permits frontend origin in CORS (corsfilter.commercewebservices.allowedOrigins)
Verifies OAuth2 client credentials
Flushes Region Cache for real-time frontend routing
Args: site_id: Target BaseSite UID (e.g. 'powertools-spa') storefront_url: Frontend URL Origin (e.g. 'http://localhost:4200' or 'https://localhost:4200') lang: Output language ('zh' or 'en')
Inputs: lang, site_id, storefront_url. Returns: result
hac_storefront_cms_scaffoldB
Scaffolds, customizes, and publishes CMS layout components for Composable Storefront (Spartacus).
Args: content_catalog: Target CMS Content Catalog (default 'powertools-spaContentCatalog') product_catalog: Target Product Catalog (default 'powertoolsProductCatalog') hero_title: Title text for the Hero announcement featured_products: List of product SKUs for the 'What's New' product carousel bestseller_products: List of product SKUs for the 'Bestsellers' product carousel banner_configs: List of banner dicts, each with 'uid', 'imageUrl', and optional 'urlLink' sync_online: If True, triggers synchronization from Staged to Online catalog (default True) clear_cache: If True, flushes Region Cache so changes reflect on storefront immediately (default True) lang: Output language ('zh' or 'en')
Inputs: lang, hero_title, clear_cache, sync_online, +5 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools have clearly distinct purposes (e.g., hac_impex_import vs hac_groovy_execute) and are well differentiated by resource and action. A few pairs like hac_catalog_sync and hac_solr_reindex are distinct, but hac_self_diagnose and hac_self_improve both act on the MCP itself and could be confused; hac_storefront_autofix and hac_storefront_app_config are related but one repairs backend whereas the other aligns local config, with descriptions clarifying the difference. Overall, an agent can typically select the correct tool, though some boundaries require careful reading.
All tool names consistently use the 'hac_' prefix followed by a snake_case verb_noun or noun pattern (e.g., hac_impex_import, hac_solr_reindex, hac_b2b_scaffold_org). The convention is predictable throughout, with no mixing of camelCase or alternative verb styles.
27 tools is on the higher side for a single server, especially given the broad domain spanning HAC connection, scripting, catalog management, B2B, storefront, and self-improvement. While each tool appears to serve a distinct function, the count is borderline heavy and could lead to cognitive overload or misselection for an agent.
The tool set covers a broad lifecycle: connection setup (hac_configure, hac_status), scripting (hac_impex_import, hac_groovy_execute), site scaffolding (hac_scaffold_greenfield_site), catalog sync (hac_catalog_sync), Solr management (hac_solr_reindex, hac_solr_status), B2B operations (hac_b2b_scaffold_org, hac_b2b_org_doctor), promotions, storefront repair, and even self-improvement. Minor gaps exist, such as dedicated CRUD for catalog items or user management, but core workflows are well supported with minimal dead ends.
Related MCP Connectors
Autonomous and governed SRE & MLOps control plane for AI agent platforms.
Agentic commerce with 58 MCP tools for product search, checkout, A2A negotiation, C-Suite analytics.
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
30+ deterministic dev and delivery tools: linting, metrics, diagrams, model advice, AI-text checks.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceTransforms SAP S/4HANA or ECC systems into conversational AI interfaces by exposing all OData services as dynamic MCP tools. Enables natural language interactions with ERP data for querying, creating, updating, and deleting business entities through SAP BTP integration.54 npm143MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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.MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to interact with SAP Commerce Cloud (Hybris) instances for product management, order viewing, FlexibleSearch queries, Groovy script execution, ImpEx operations, and system administration tasks.1617MIT
- FlicenseBqualityCmaintenanceEnables AI assistants to interact with SAP Commerce Cloud (Hybris) instances to manage products, orders, and system configurations. It supports advanced operations like FlexibleSearch queries, Groovy script execution, and ImpEx data management.16-