Sponsored by Deepsite.site

SAP Commerce MCP Server

Created By
Dunkansdk8 months ago
SAP Commerce (Hybris) MCP Server
Content

SAP Commerce MCP Server

This Model Context Protocol (MCP) server integrates with SAP Commerce Cloud's OCC APIs to enable natural language interactions with product data through Claude.

Features

  • Product Search: Search through products using natural language queries
  • Advanced Search: Filter products by category, price range, and more
  • Product Details: Get detailed information about specific products
  • Stock Availability: Check product stock levels and availability
  • Categories: Browse and search products by categories
  • Promotions: Get information about active promotions
  • Reviews: Access product reviews and ratings
  • Product Suggestions: Get personalized product recommendations
  • Cart Management: Full shopping cart operations support
  • Health Monitoring: Real-time service health tracking
  • Performance Analytics: Historical performance analysis and insights

Tools Available

  1. search-products: Basic product search with pagination support

    • Parameters:
      • query: Search query string
      • currentPage: (Optional) Page number
      • pageSize: (Optional) Results per page
  2. search-products-advanced: Advanced product search with filters

    • Parameters:
      • query: (Optional) Search query string
      • categoryCode: (Optional) Category code filter
      • minPrice: (Optional) Minimum price filter
      • maxPrice: (Optional) Maximum price filter
      • sort: (Optional) Sort order
      • currentPage: (Optional) Page number
      • pageSize: (Optional) Results per page
  3. get-product-details: Get detailed product information

    • Parameters:
      • productCode: Product code/SKU
  4. check-product-availability: Check product stock levels

    • Parameters:
      • productCode: Product code/SKU
      • location: (Optional) Warehouse/store location code
  5. get-categories: Browse product categories

    • Parameters:
      • categoryId: (Optional) Specific category ID
  6. get-products-by-category: Get products in a category

    • Parameters:
      • categoryId: Category ID
      • currentPage: (Optional) Page number
      • pageSize: (Optional) Results per page
      • sort: (Optional) Sort order
  7. get-promotions: Get promotion information

    • Parameters:
      • promotionId: (Optional) Specific promotion ID
  8. get-product-reviews: Get product reviews

    • Parameters:
      • productCode: Product code/SKU
  9. get-product-suggestions: Get product recommendations

    • Parameters:
      • productCode: Reference product code/SKU
      • maxResults: (Optional) Maximum number of suggestions
  10. create-cart: Create a new shopping cart

    • Parameters: None
  11. get-cart: Get cart details

    • Parameters:
      • cartId: Cart ID to retrieve
  12. add-to-cart: Add a product to cart

    • Parameters:
      • cartId: Cart ID
      • productCode: Product code/SKU
      • quantity: (Optional) Quantity to add (default: 1)
  13. update-cart-entry: Update product quantity in cart

    • Parameters:
      • cartId: Cart ID
      • entryNumber: Entry number in cart
      • quantity: New quantity
  14. remove-from-cart: Remove a product from cart

    • Parameters:
      • cartId: Cart ID
      • entryNumber: Entry number to remove
  15. get-order-status: Check order status

    • Parameters:
      • orderId: Order ID
  16. get-order-history: View order history

    • Parameters:
      • userId: User ID
  17. check-service-health: Get current service health status

    • Parameters: None
  18. analyze-performance: Get historical performance insights

    • Parameters: None

Configuration

The server can be configured using environment variables:

# SAP Commerce Cloud Configuration
SAP_COMMERCE_URL=https://your-commerce-url/occ/v2
SAP_COMMERCE_SITE=your-site-name
SAP_COMMERCE_TIMEOUT=10000
SAP_COMMERCE_VALIDATE_SSL=false

# OAuth2 Authentication (optional)
SAP_COMMERCE_CLIENT_ID=your-client-id
SAP_COMMERCE_CLIENT_SECRET=your-client-secret

# Logging Configuration
LOG_LEVEL=info # debug, info, warn, or error

Setup

  1. Install dependencies:

    npm install
    
  2. Build the project:

    npm run build
    
  3. Start the server:

    npm start
    

Claude Integration Example Queries

  • "Search for all products related to 'hacendado'"
  • "Find electronics products under $500"
  • "Get details for product with code 'ABC123'"
  • "Check stock availability for product 'XYZ789'"
  • "Show me all products in the 'electronics' category"
  • "What promotions are currently active?"
  • "Show me reviews for product 'ABC123'"
  • "Suggest products similar to 'ABC123'"
  • "Create a new shopping cart"
  • "Add 2 units of product 'ABC123' to my cart"
  • "Update the quantity of item 1 in my cart to 3"
  • "Remove item 2 from my cart"
  • "Show me my cart details"
  • "What's the status of order 'ORD123456'?"
  • "Show me my order history"
  • "Check the current health status of the service"
  • "Analyze performance for the last 12 hours"
  • "Show me performance insights"
  • "Get cache hit rates for today"

Development

The project includes VS Code integration through .vscode/mcp.json for easy debugging and development. Make sure to update the configuration with your SAP Commerce instance details.

Running in Development Mode

For development, you can use:

npm run dev

This will start TypeScript in watch mode, recompiling on changes.

Performance Monitoring

Real-time Health Checks

The server includes real-time health monitoring with metrics for:

  • API latency
  • Error rates
  • Cache hit rates
  • Service status (healthy/degraded/unhealthy)

Historical Analysis

Performance data is stored and analyzed with:

  • 24-hour historical trends
  • P95 latency tracking
  • Error rate patterns
  • Cache efficiency metrics
  • Automated performance insights

Logging

Logs are stored in the logs directory with automatic rotation:

  • Error logs: logs/error-YYYY-MM-DD.log
  • Combined logs: logs/combined-YYYY-MM-DD.log
  • Health metrics: logs/health-YYYY-MM-DD.log

Logs are automatically rotated daily and kept for 30 days.

Error Handling

The server includes comprehensive error handling for common SAP Commerce API issues:

  • Invalid product codes
  • Network connectivity problems
  • Authentication errors
  • API rate limiting
  • Invalid category or promotion IDs
  • Price range validation
  • Sorting parameter validation
  • Cart operation failures

Authentication

The server supports OAuth2 client credentials flow for authenticated requests to SAP Commerce. Configure the client ID and secret in the environment variables to enable authenticated requests.

Token Management

  • Automatic token refresh handling
  • Buffer time for token expiration (5 minutes)
  • Graceful fallback for authentication failures

Caching

The server implements intelligent caching with:

  • 5-minute TTL for product data
  • Automatic cache invalidation
  • Cache hit rate monitoring
  • Eviction policies for memory management

Cart Session Management

The server maintains cart sessions for anonymous users with the following features:

  • Automatic cart creation
  • Persistent cart ID tracking
  • Cart entry management
  • Cart totals calculation
  • Product availability validation

Security Notes

  • SSL certificate validation can be disabled for development using SAP_COMMERCE_VALIDATE_SSL=false
  • For production, ensure proper SSL certification and authentication are configured
  • Store sensitive credentials (client ID/secret) in environment variables, never in code
  • Regular security audits recommended for production deployments
  • Cart IDs should be treated as sensitive information

Performance Optimization

The server includes several performance optimization features:

  • Automatic request retries with exponential backoff
  • Response caching for frequently accessed data
  • Request batching and throttling
  • Performance monitoring and alerting
  • Historical performance analysis
  • Automated performance insights and recommendations
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
DeepChatYour AI Partner on Desktop
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
CursorThe AI Code Editor
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.