btp-sap-odata-to-mcp-server-optimized
LocalAbout btp-sap-odata-to-mcp-server-optimized
btp-sap-odata-to-mcp-server-optimized connects SAP OData services to AI clients, for teams running SAP BTP and Cloud Foundry. It combines configurable service discovery and authentication with layered tools, natural-language OData queries, and interactive UI tools.
Key features
- 01Modular authentication options
- 02Pattern, domain, and whitelist discovery
- 03Natural-language to OData queries
- 04Layered tool architecture and orchestration
- 05KPI monitoring and trend analysis
- 06Interactive forms, grids, and dashboards
Use cases
- 01Expose selected SAP OData services to AI clients
- 02Restrict access with granular roles and XSUAA
- 03Build dashboards and reports from SAP data
- 04Deploy the server on SAP BTP Cloud Foundry
MCP support
Acts as an MCP server that exposes discovered SAP OData services through a layered collection of tools. AI clients can use natural-language routing, analytics, and interactive UI tools.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y btp-sap-odata-to-mcp-serverSAP_IAS_URLURL of the SAP Identity Authentication Service tenantSAP_IAS_CLIENT_IDClient ID for the OAuth application in IASSAP_IAS_CLIENT_SECRETSecretClient Secret for the OAuth application in IASSAP_DESTINATION_NAMEName of the BTP destination used for service discoveryODATA_DISCOVERY_MODEOData discovery mode: pattern, business, whitelist, or allODATA_INCLUDE_PATTERNSComma-separated patterns to include (pattern mode)ODATA_EXCLUDE_PATTERNSComma-separated patterns to exclude (pattern mode)PORTThe port on which the Express server will listenNODE_ENVThe application's operating environmentLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
19Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Maximum number of services to return |
| query | string | No | Search term to filter services (name, title, description) |
| category | enum | No | Service category filterbusiness-partner | sales | finance | procurement | hr | logistics | all |
Details
From the project READMESAP 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
🚀 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.
🚀 Quick Links
| 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
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.