SAP OData to MCP Server
This server bridges SAP OData services with AI capabilities through the Model Context Protocol (MCP), enabling intelligent data access, analysis, and business process automation.
Core Capabilities:
Secure SAP Integration: Modular authentication supporting IAS, OAuth2, JWT, Basic Auth, and API keys with role-based access control and principal propagation
Service Discovery: Pattern-based filtering and whitelisting for simplified SAP OData service exploration
Intelligent Querying: Natural language to OData conversion through Smart Query Router and Natural Query Builder
CRUD Operations: Direct create, read, update, and delete operations with optimized query performance
AI-Powered Analytics: Smart data analysis for patterns, trends, forecasts, correlations, and business process insights with predictive modeling
Real-time Data: WebSocket streaming for continuous SAP data updates with configurable frequency
Dynamic UI Generation: Create SAP Fiori-styled forms, data grids, dashboards, workflows, and drill-down reports
KPI Management: Comprehensive dashboard building and business intelligence reporting with real-time visualization
Cloud-Native Deployment: Optimized for SAP BTP Cloud Foundry with health monitoring, structured logging, and graceful shutdown
Enables natural language interactions with SAP S/4HANA or ECC systems by exposing all OData services as dynamic MCP tools, supporting CRUD operations on entities like customers, purchase orders, banks, and other business data through conversational queries.
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 OData to MCP Server show me the top 5 sales orders from last week"
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 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 validationui-data-grid: Interactive tables with sorting and filteringui-dashboard-composer: Real-time KPI dashboardsui-workflow-builder: Visual workflow creationui-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 install2. Configuration
Configure the application using environment variables. See the Configuration Guide for detailed documentation.
cp .env.example .env
# Edit .env with your configurationQuick 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_S4HANA3. 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.
🚀 Quick Links
Category | Document | Description |
Getting Started | Environment setup, OData discovery, CF deployment | |
Architecture | System design, security model, tool hierarchy | |
🎨 Modern Diagrams | NEW! Interactive visual architecture | |
Usage | Authentication, tool usage, workflow examples | |
Reference | Complete tool documentation with parameters | |
Deployment | SAP BTP and local development setup | |
Development | Test suite and development guidelines | |
Changes | Version history and feature updates |
📖 Navigation Flow
README.md → docs/README.md → All Documentation
↓ ↓
Quick Start → Structured Navigation → Complete CoverageAvailable Tools
19 toolsbusiness-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
Scored across 19 tools
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.
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.
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.
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
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.
Discover, plan and run tools across your connected business systems through one OAuth MCP endpoint
Unified MCP Server is a remote MCP connector for AI agents and vertical AI products that provides access to 22,000+ authorized SaaS tools across 400+ integrations and 24 categories directly inside LLMs (Claude, GPT, Gemini, Cohere). Tools operate only on explicitly authorized customer connections, enabling agents to safely read and write against live third-party systems.
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.145MIT
- AlicenseNot gradedqualityDmaintenanceTransforms 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.1MIT
- AlicenseNot gradedqualityCmaintenanceA 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.33MIT
- AlicenseNot gradedqualityDmaintenanceDynamically generates MCP tools from any OData or OpenAPI spec, enabling natural-language queries via SAP AI Core.MIT