Overview
Official SAP MCP server for OData enterprise data access.
Setup
Run with npx:
npx @sap/mcp-odataConfiguration
SAP_CLIENT_ID, SAP_CLIENT_SECRET, SAP_ODATA_BASE_URL environment variablesDocumentation
SAP OData MCP
Overview
SAP OData MCP is an official Model Context Protocol server from SAP, designed to enable AI agents to interact with SAP enterprise systems including S/4HANA, SuccessFactors, and other OData-compliant services. Released in July 2026 with over 620 GitHub stars, this server represents a significant milestone in connecting enterprise resource planning (ERP) systems with AI agent workflows.
The server automatically parses OData EDMX metadata and generates a complete list of callable tools, enabling agents to query and manipulate enterprise data without requiring deep knowledge of SAP's complex data models. This makes SAP data accessible to AI agents through the same MCP protocol used by modern developer tools.
Features
- EDMX Metadata Parsing: Automatically discover and parse OData service metadata
- Tool Auto-Generation: Generate callable tools from OData entity definitions
- Complex Filtering: Support for OData filter expressions ($filter, $orderby, $select)
- Entity Expansion: Expand related entities with $expand queries
- Batch Operations: Execute multiple operations in a single request
- Enterprise OAuth 2.0: Client credentials and JWT authentication support
- S/4HANA Integration: Native support for SAP S/4HANA data models
- SuccessFactors Integration: HR data access through SuccessFactors OData services
Installation
# Install via npm
npm install -g @sap/mcp-odata
# Or via npx (no installation)
npx @sap/mcp-odata
Configuration
{
"mcpServers": {
"sap-odata": {
"command": "npx",
"args": ["@sap/mcp-odata"],
"env": {
"SAP_CLIENT_ID": "your-client-id",
"SAP_CLIENT_SECRET": "your-client-secret",
"SAP_AUTH_URL": "https://your-sap-account.authentication.sap.com/oauth2/token",
"SAP_ODATA_BASE_URL": "https://your-sap-system/api/v4/odatav4",
"SAP_TENANT": "your-tenant"
}
}
}
}
Environment Variables:
| Variable | Description | Required |
|---|---|---|
SAP_CLIENT_ID | OAuth 2.0 client ID | Yes |
SAP_CLIENT_SECRET | OAuth 2.0 client secret | Yes |
SAP_AUTH_URL | OAuth 2.0 token endpoint | Yes |
SAP_ODATA_BASE_URL | OData service base URL | Yes |
SAP_TENANT | SAP tenant identifier | No |
SAP_DESTINATION | SAP destination name | No |
MCP_LOG_LEVEL | Logging verbosity | No |
Available Tools
| Tool | Description |
|---|---|
get_metadata | Fetch and parse EDMX metadata |
list_entities | List all available OData entities |
query_entity | Query an OData entity with filters |
get_entity | Get a single entity by key |
create_entity | Create a new entity |
update_entity | Update an existing entity |
delete_entity | Delete an entity |
expand_entity | Query entity with related entities expanded |
batch_operation | Execute multiple operations in a batch |
get_entity_set | Get entity set metadata and navigation properties |
Usage Examples
Example 1: Discover Available Entities
# List all entities in the OData service
response = mcp_client.call_tool("sap-odata", "list_entities", {})
# Returns: {"entities": ["BusinessPartners", "SalesOrders", "Products", "Purchases"]}
Example 2: Query Business Partners
response = mcp_client.call_tool("sap-odata", "query_entity", {
"entity": "BusinessPartners",
"filter": "BusinessPartnerType eq '1' and Region eq 'US'", # Customers in US
"select": ["BusinessPartner", "Name", "Region", "CreditRating"],
"top": 50,
"orderby": "Name"
})
Example 3: Get Sales Order with Line Items
response = mcp_client.call_tool("sap-odata", "expand_entity", {
"entity": "SalesOrders",
"key": "SO123456789",
"expand": ["SalesOrderItems", "SalesOrderItems_SalesOrderProduct"]
})
Example 4: Create Sales Order
response = mcp_client.call_tool("sap-odata", "create_entity", {
"entity": "SalesOrders",
"data": {
"BusinessPartner": "BP123456",
"CurrencyCode": "USD",
"SalesOrderType": "OR",
"SalesOrderItems": [
{
"Product": "PROD001",
"Quantity": 100,
"GrossAmount": 1000.00
}
]
}
})
Example 5: Batch Operation
response = mcp_client.call_tool("sap-odata", "batch_operation", {
"operations": [
{
"method": "GET",
"entity": "BusinessPartners",
"filter": "BusinessPartnerType eq '1'"
},
{
"method": "GET",
"entity": "SalesOrders",
"filter": "SalesOrderType eq 'OR' and Status eq 'A'"
}
]
})
Example 6: Update Entity
response = mcp_client.call_tool("sap-odata", "update_entity", {
"entity": "BusinessPartners",
"key": "BP123456",
"data": {
"Name": "Updated Company Name",
"CreditRating": "Good",
"City": "San Francisco"
}
})
OAuth 2.0 Authentication Setup
Step 1: Register SAP App
- Go to SAP BTP Cockpit → Security → Identity Provider → Register App
- Configure OAuth 2.0 client credentials flow
- Note down Client ID and Client Secret
Step 2: Configure Destination
{
"SAP_CLIENT_ID": "your-client-id",
"SAP_CLIENT_SECRET": "your-client-secret",
"SAP_AUTH_URL": "https://your-account.authentication.sap.com/oauth2/token",
"SAP_ODATA_BASE_URL": "https://s4hana.ondemand.com/api/v4/odatav4"
}
Step 3: Test Connection
response = mcp_client.call_tool("sap-odata", "get_metadata", {})
# Should return EDMX metadata
Advanced Features
Complex Filtering
response = mcp_client.call_tool("sap-odata", "query_entity", {
"entity": "SalesOrders",
"filter": "(CreatedOn ge 2026-07-01 and CreatedOn le 2026-07-31) and (GrossAmount gt 10000 or CreditRating eq 'Good')"
})
Navigation Properties
response = mcp_client.call_tool("sap-odata", "expand_entity", {
"entity": "BusinessPartners",
"key": "BP123456",
"expand": [
"SalesOrders",
"SalesOrders/SalesOrderItems",
"Purchases"
]
})
Upsert Operations
response = mcp_client.call_tool("sap-odata", "update_entity", {
"entity": "BusinessPartners",
"key": "BP123456",
"data": {
"Name": "Updated Name"
},
"upsert": True # Create if doesn't exist
})
Enterprise Integration Patterns
Pattern 1: Financial Reporting
# Get monthly sales data
sales = mcp_client.call_tool("sap-odata", "query_entity", {
"entity": "SalesOrders",
"filter": "CreatedOn ge 2026-07-01 and CreatedOn le 2026-07-31",
"select": ["SalesOrder", "GrossAmount", "NetAmount", "CurrencyCode"]
})
Pattern 2: Inventory Management
# Check product availability
products = mcp_client.call_tool("sap-odata", "query_entity", {
"entity": "Products",
"filter": "StockQuantity gt 0",
"orderby": "StockQuantity desc"
})
Pattern 3: HR Data Access (SuccessFactors)
# Get employee data
employees = mcp_client.call_tool("sap-odata", "query_entity", {
"entity": "Employee",
"filter": "Division eq 'Engineering'",
"select": ["EmployeeID", "Name", "Department", "ManagerID"]
})
Pros
- ✅ Official SAP Support: Maintained by SAP with enterprise support
- ✅ Auto-Tool Generation: EDMX metadata automatically generates tools
- ✅ Enterprise Authentication: OAuth 2.0 with client credentials and JWT
- ✅ S/4HANA Native: First-class support for SAP S/4HANA
- ✅ Complete CRUD: Full create/read/update/delete operations
- ✅ Batch Operations: Efficient multi-operation requests
Cons
- ✅ Complex Setup: Requires SAP BTP and OAuth configuration
- ✅ Enterprise-Focused: Not suitable for non-SAP environments
- ✅ New Server: Limited production track record
- ✅ Documentation Gaps: Enterprise documentation still maturing
When to Use
- SAP S/4HANA Integration: Connect AI agents to SAP ERP systems
- Enterprise Reporting: Generate reports from SAP data through agents
- Supply Chain Automation: Automate purchase orders and inventory management
- HR Workflow Automation: Integrate SuccessFactors with AI agents
- Financial Analysis: Query financial data through natural language
- Enterprise Agent Workflows: Connect SAP data to broader agent ecosystems
