🔌

SAP OData MCP

Enterprise•⭐ 620

Official SAP MCP server for OData enterprise data access.

SAP S/4HANASuccessFactorsBTP

Overview

Official SAP MCP server for OData enterprise data access.

Setup

Run with npx:

npx @sap/mcp-odata

Configuration

SAP_CLIENT_ID, SAP_CLIENT_SECRET, SAP_ODATA_BASE_URL environment variables

Documentation

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:

VariableDescriptionRequired
SAP_CLIENT_IDOAuth 2.0 client IDYes
SAP_CLIENT_SECRETOAuth 2.0 client secretYes
SAP_AUTH_URLOAuth 2.0 token endpointYes
SAP_ODATA_BASE_URLOData service base URLYes
SAP_TENANTSAP tenant identifierNo
SAP_DESTINATIONSAP destination nameNo
MCP_LOG_LEVELLogging verbosityNo

Available Tools

ToolDescription
get_metadataFetch and parse EDMX metadata
list_entitiesList all available OData entities
query_entityQuery an OData entity with filters
get_entityGet a single entity by key
create_entityCreate a new entity
update_entityUpdate an existing entity
delete_entityDelete an entity
expand_entityQuery entity with related entities expanded
batch_operationExecute multiple operations in a batch
get_entity_setGet 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

  1. Go to SAP BTP Cockpit → Security → Identity Provider → Register App
  2. Configure OAuth 2.0 client credentials flow
  3. 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

Resources