Skip to main content
Glama
SAP OData to MCP Server

SAP OData to MCP Server

by Raistlin82

SAP OData to AI-Powered MCP Server (Optimized)

This repository is an enterprise-ready MCP (Model Context Protocol) server that bridges SAP OData services with AI capabilities. Based on the original project btp-sap-odata-to-mcp-server by @lemaiwo, this optimized version features enhanced security, simplified configuration, modular authentication, and comprehensive Cloud Foundry integration.

✨ Key Features

🔐 Enhanced Security Architecture

  • Modular Authentication System: Factory pattern supporting IAS, OAuth2, JWT, Basic Auth, and API Keys

  • Secure Session Management: Thread-safe session bridging with proper locking mechanisms

  • Role-Based Access Control: Granular permissions with XSUAA integration

  • Principal Propagation: Maintains user context throughout the request lifecycle

  • Security Best Practices: No sensitive data logging, secure error handling, JWT validation

🎯 Simplified OData Discovery

  • Pattern-Based Filtering: Simple include/exclude patterns for service discovery

  • Business Domain Mode: Pre-configured domains (sales, finance, HR, etc.)

  • Whitelist Mode: Explicit service control for production environments

  • Smart Defaults: Automatic exclusion of test/debug services

🧠 AI-Powered Capabilities

  • Smart Query Router: Natural language to OData conversion

  • Hierarchical Tool Architecture: 17+ tools organized in logical layers

  • Intelligent Workflow Orchestration: Automatic tool chaining and optimization

  • Real-time Analytics: KPI monitoring and trend analysis

🎨 Interactive UI Tools Suite

  • ui-form-generator: Dynamic SAP Fiori forms with validation

  • ui-data-grid: Interactive tables with sorting and filtering

  • ui-dashboard-composer: Real-time KPI dashboards

  • ui-workflow-builder: Visual workflow creation

  • ui-report-builder: Analytical reports with drill-down

☁️ Cloud-Native Features

  • Cloud Foundry Optimized: Native integration with CF services

  • Structured Logging: SAP Cloud Logging with fallback support

  • Health Monitoring: Comprehensive health check endpoints

  • Performance Metrics: Built-in performance tracking

  • Graceful Shutdown: Proper resource cleanup

Related MCP server: SAP OData to MCP Server

🚀 Quick Start

Prerequisites

  • Access to an SAP BTP, Cloud Foundry environment.

  • Required BTP services: XSUAA, Identity, Connectivity, Destination.

  • Node.js >= 18.

1. Installation

git clone <this-repo>
cd btp-sap-odata-to-mcp-server-optimized
npm install

2. Configuration

Configure the application using environment variables. See the Configuration Guide for detailed documentation.

cp .env.example .env
# Edit .env with your configuration

Quick Configuration Example

# Authentication
SAP_IAS_URL=https://your-tenant.accounts.ondemand.com
SAP_IAS_CLIENT_ID=your-client-id
SAP_IAS_CLIENT_SECRET=your-secret

# OData Discovery (Simplified)
ODATA_DISCOVERY_MODE=pattern
ODATA_INCLUDE_PATTERNS=*API*,Z*
ODATA_EXCLUDE_PATTERNS=*_TEST*,*_TEMP*
ODATA_MAX_SERVICES=50

# Destinations
SAP_DESTINATION_NAME=SAP_S4HANA

3. Build and Deploy

# Build the TypeScript source code for BTP
npm run build:btp

# Deploy to SAP BTP, Cloud Foundry
npm run deploy:btp

📚 Documentation

Complete documentation is available with structured navigation for all aspects of the project.

🏠 Documentation Hub

Main navigation center with use-case-based guidance and complete file index.

Category

Document

Description

Getting Started

Configuration Guide

Environment setup, OData discovery, CF deployment

Architecture

Architecture Overview

System design, security model, tool hierarchy

🎨 Modern Diagrams

Modern Architecture Diagrams

NEW! Interactive visual architecture

Usage

User Guide

Authentication, tool usage, workflow examples

Reference

Tool Reference

Complete tool documentation with parameters

Deployment

Deployment Guide

SAP BTP and local development setup

Development

Testing Guide

Test suite and development guidelines

Changes

Changelog

Version history and feature updates

📖 Navigation Flow

README.md → docs/README.md → All Documentation
     ↓           ↓
Quick Start → Structured Navigation → Complete Coverage

Available Tools

19 tools
business-intelligence-insightsGenerate business insights from SAP dataD

Generate business insights from SAP data

Inputs: action (required), entityTypes, serviceIds, analysisType, +5 more.

business-process-insightsBusiness Process InsightsC

Extract business process insights from SAP transactional data using AI pattern recognition. Identifies workflow inefficiencies and automation opportunities.

Inputs: processType (required), processData (required), timeframe, focusAreas.

check-sap-authenticationCheck SAP AuthenticationC

🔐 Validate/associate authentication session. Call with session_id to authenticate.

Inputs: session_id, validateSession, requestPreAuth, context.

discover-service-entitiesDiscover Service EntitiesA

List all entities and their capabilities within a specific SAP service. Use this after finding a service to understand what data you can work with.

Inputs: serviceId (required), showCapabilities.

execute-entity-operationExecute Entity OperationA

⚠️ Direct CRUD operations on SAP entities with precise OData queries. Use ONLY when you have exact OData query syntax (not natural language). For natural language queries, use natural-query-builder FIRST. Requires authentication.

Inputs: serviceId (required), entityName (required), operation (required), parameters, +1 more.

get-entity-schemaGet Entity SchemaC

Get detailed schema information for a specific entity including properties, types, keys, and constraints.

Inputs: serviceId (required), entityName (required).

kpi-dashboard-builderCreate and manage KPI dashboardsD

Create and manage KPI dashboards

Inputs: action (required), dashboardId, dashboard, updates, +1 more.

natural-query-builderNatural Query BuilderC

Convert natural language to OData queries

Inputs: naturalQuery (required), entityType (required), serviceId (required), userContext.

predictive-analytics-engineRun predictive analytics on SAP dataD

Run predictive analytics on SAP data

Inputs: action (required), entityType, serviceId, targetMetric, +6 more.

query-performance-optimizerQuery Performance OptimizerA

Optimize SAP OData query performance by analyzing execution patterns and suggesting improvements. Automatically identifies bottlenecks and recommends index strategies.

Inputs: query (required), entityType (required), executionStats, optimizationGoals.

realtime-data-streamStream SAP data via WebSocketD

Stream SAP data via WebSocket

Inputs: action (required), entityType, serviceId, subscriptionId, +4 more.

sap-smart-querySAP Smart Query RouterC

Routes SAP requests to optimal tool

Inputs: userRequest (required), context.

search-sap-servicesSearch SAP ServicesC

Find SAP services by keyword/category.

Inputs: query, category, limit.

smart-data-analysisSmart Data AnalysisC

Analyze SAP data patterns, trends, and generate actionable business insights with AI-powered statistical analysis. Provides automated data exploration and visualization recommendations.

Inputs: data (required), analysisType (required), entityType (required), businessContext.

ui-dashboard-composerUI Dashboard ComposerC

Creates comprehensive KPI dashboards with charts and real-time data

Inputs: dashboardTitle (required), widgets (required), layout.

ui-data-gridUI Data GridC

Creates interactive data grids with sorting, filtering, and export capabilities

Inputs: entityType (required), columns (required), features.

ui-form-generatorUI Form GeneratorC

Creates dynamic forms for SAP entity operations with validation and SAP Fiori styling

Inputs: entityType (required), formType (required), fields.

ui-report-builderUI Report BuilderC

Creates comprehensive drill-down reports with analytical capabilities

Inputs: entityType (required), reportType (required), dimensions (required), measures (required).

ui-workflow-builderUI Workflow BuilderC

Creates visual workflow processes with step-by-step forms and approvals

Inputs: workflowName (required), steps (required), entityType (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.6/5.0

    Scored across 19 tools

    Disambiguation3/5

    The tool set has clear distinctions in some areas, such as authentication, service discovery, and UI components, but there is significant overlap and ambiguity in others. For example, 'business-intelligence-insights', 'business-process-insights', and 'smart-data-analysis' all involve AI-powered analysis of SAP data, making it difficult for an agent to choose the right one without deeper context. Similarly, 'kpi-dashboard-builder' and 'ui-dashboard-composer' both handle dashboard creation, leading to potential confusion.

    Naming Consistency2/5

    The naming conventions are inconsistent and chaotic, with no discernible pattern across the tools. There is a mix of styles, such as hyphenated names (e.g., 'business-intelligence-insights'), snake_case (e.g., 'check-sap-authentication' uses hyphens but resembles snake_case), and varied verb usage (e.g., 'discover-service-entities' vs. 'search-sap-services'). Some tools use descriptive phrases rather than clear verb_noun patterns, making the set hard to navigate predictably.

    Tool Count3/5

    With 19 tools, the count is borderline high for a server focused on SAP OData integration, as it includes both core data operations and extensive UI components, which might be better split into separate servers. While the scope is broad, the number feels heavy and could overwhelm an agent, especially given the overlaps. A more streamlined set of 10-15 tools might be more appropriate for this domain.

    Completeness4/5

    The tool surface is largely complete for the SAP OData domain, covering authentication, service discovery, CRUD operations, query building, analytics, and UI components. However, there are minor gaps, such as no explicit tool for deleting or updating data in a natural language context (relying on 'execute-entity-operation' with OData syntax), and the UI tools might be overly detailed for a data-focused server. Overall, agents can work around these gaps, and core workflows are well-supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Transforms 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.
      145
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Transforms SAP S/4HANA or ECC systems into conversational AI interfaces by exposing OData services as dynamic MCP tools. Enables natural language interactions with ERP data for querying, creating, updating, and deleting business entities.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A config-driven MCP server that exposes OData and REST APIs as MCP tools, enabling AI assistants to query, manage, and monitor SAP backends through natural language.
      33
      MIT