K2view named a Visionary in Gartner’s Magic Quadrant 🎉

Read More arrow--cta
Get Demo
Start Free
Start Free

SAP MCP: Unlocking SAP data access for AI agents

Iris Zarecki

Iris Zarecki,Product Marketing Director

In this article

SAP MCP: Unlocking SAP data access for AI agents

    Take the product tour
    Group 838370

    Learn how to ground GenAI apps with enterprise data

    Take the product tour

    Table of Contents

    SAP MCP: Unlocking SAP data access for AI agents
    9:34

    MCP for SAP enables AI to securely access real-time SAP data and context, improving agentic AI accuracy and data governance across SAP landscapes. 

    Why do SAP and MCP matter for AI agents?

    Many organizations rely on SAP to manage their business operations, from finance and logistics to human resources and supply chain activities. Increasingly, they are exploring the use of AI agents — powered by Large Language Models (LLMs) — to automate tasks, streamline processes, or provide instant insights and recommendations.

    But there’s a catch. In most organizations, SAP data is only one part of the bigger enterprise data picture. Information relevant to any business process is often scattered across multiple business applications, databases, cloud systems, and files, both inside and outside of SAP. For AI agents to deliver meaningful answers and actions, they need access to all relevant data, not just data isolated SAP tables. When data remains fragmented, AI agents can only see a piece of the puzzle, limiting their effectiveness and sometimes leading to inaccurate results.

    This is where Model Context Protocol (MCP) comes in. MCP is an open, standardized approach that enables Large Language Models (LLMs) and AI agents to access up-to-date, well-governed enterprise data – across SAP and other business systems – on demand, while maintaining privacy, auditability, and control.


    MCP diagram 1-1

     

    Instead of copying or syncing data, MCP makes it possible for AI models to dynamically retrieve exactly the data they need from SAP and other relevant source systems at the time of the user request. This grounded, orchestrated access ensures AI agents are working with the most current and complete SAP-sourced information, while also enforcing privacy and security guardrails to prevent sensitive data exposure.

    By connecting SAP systems to AI agents through MCP, businesses can unlock the true value of their enterprise data for advanced GenAI-based use cases.

    SAP MCP use cases 

    Many enterprises are realizing the benefits of connecting SAP data – and data from other business systems – to AI agents using the Model Context Protocol (MCP). By allowing secure, governed, and real-time access to multi-source enterprise data, MCP for SAP helps AI agents drive value across different use cases.

    One common use case of SAP MCP is in customer service for industries like telecommunications. For instance, when customers have questions about billing or service outages, the information needed to answer the questions often spans SAP systems (for billing and product data) as well as external customer care applications. With MCP, AI agents can quickly and securely pull up-to-date information from both SAP and other systems, so customers receive accurate answers without delays. At the same time, MCP’s privacy and audit controls help ensure that sensitive data – such as payment information – is protected throughout the process.

    Analytics and reporting are also enhanced by MCP for SAP. For example, business leaders often need insights into areas like inventory levels and supply chain status. While inventory data may reside in SAP S4/HANA, freight details might be tracked in a thirfd-party cloud logistics platform, and supplier data could be stored in another system. Using MCP, an AI agent can gather and combine real-time information from all these different sources, presenting executives with a complete and current business snapshot – all through a simple conversational query or chat.

    A personalized AI customer experience and automated back-office processing are additional areas where connecting SAP to AI agents is valuable. Imagine a retail scenario where an AI assistant recommends personalized promotions by pulling together purchasing history from SAP ERP and recent website activity logs. Or, in insurance, an AI agent may support automated claims processing by accessing claim details from SAP, CRM records, and scanned claim images – all coordinated and secured through MCP.

    According to the K2view State of Data for GenAI survey, only 2% of organizations in the US and UK are ready to deploy GenAI. The main barrier is fragmented enterprise data, especially from core systems like SAP. By tackling these challenges with standards such as MCP, businesses are starting to unlock AI’s real potential – grounded in reliable, multi-source data. 

    SAP MCP challenges in multi-source landscapes  

    Enterprise data rarely lives in just one system. While an SAP landscape covers many core business processes, most organizations have important data scattered across several other applications, databases, and cloud services. This fragmentation requires AI agents to communicate with multiple MCP servers, creating  major challenges: 

    1. Security and privacy  

    Security and privacy are essential priorities, especially since sensitive business data managed in systems like SAP must always be safeguarded.

    When connecting an MCP client to multiple MCP servers, each one linked to a different data source, you must implement guardrails, data governance, access controls, and auditability -- separately in each MCP server.  

    2. Fresh data in real time 

    Stale data can lead to inaccurate suggestions or missed opportunities.  
    A major hurdle for an MCP server is accessing fresh data from the SAP landscape and connected systems.  

    To be effective, MCP clients need rapid, real-time access to the latest information, not outdated records from data warehouses or lakes. Because conversational interactions require speed, MCP servers must quickly fetch and process data from multiple sources to keep responses timely and relevant.    

    3. Data integration 

    Retrieving information for AI agents about customers, suppliers, employees, or other business entities means integrating data from multiple systems like SAP, Salesforce, Workday, and support platforms. Each of these systems would require the implementation of it own MCP server, leaving the cross-system data harmonization to the AI agent.

    This means that agentic AI systems must be supported by: 

    • Metadata enrichment and semantic layers

    • Entity resolution (master data management)

    • Tooling descriptions and ontology mappings

    • Aggregator layers that unify responses

    • Few-shot examples, chain-of-thought reasoning, and fallback mechanisms 

    4. Accurate answers  

    Without up-to-date and unified data access, LLMs may hallucinate answers – generating information that’s plausible but incorrect – based on incomplete or outdated data, or data that lacks utility.  

    In summary, to address these challenges, generative AI techniques like chain-of-thought prompting (guiding the model step by step), retrieval-augmented generation (retrieving data in data at runtime), and table-augmented generation (querying and conceptualizing tabular business data) must be implemented.  

    Additionally, metadata enrichment and management (data cataloging), data governance (data quality and privacy enforcement), and real-time data integration are required.

    This means complexity, multiple points of failure, and high risk.  

    These challenges are reflected in a recent K2view survey. Fragmented, hard-to-access data was cited as a major obstacle by most respondents. Solving these data access hurdles is key for organizations aiming to unlock the full power of AI agents, grounded in real, accurate, and secure business information. 

     

    Accessing SAP data for MCP clients with K2view 

    K2view GenAI Data Fusion simplifies MCP for SAP implementation, providing a scalable and robust solution for exposing multi-source, SAP-centric data to MCP clients.  

    The solution’s patented semantic data layer makes your multi-source enterprise data instantly and securely accessible to GenAI apps. Using the K2view solution you can expose your structured and unstructured data through a single MCP server to ground your GenAI apps and deliver accurate and personalized responses.

    At the heart of our solution is the K2view Data Product Platform, which is accessible as an MCP server – a high-performance, entity-based data platform designed for real-time delivery of multi-source enterprise data to MCP clients.  

    If your business information resides in SAP and/or other operational or analytics systems, K2view acts as a unified MCP server, connecting and virtualizing data across data silos – for fast, secure, and governed data access.  

    K2view MCP Server for SAP
     
    K2view makes MCP enterprise-ready by: 

    • Unifying fragmented data, including key SAP records, directly from all core systems and exposing it at conversational latency for immediate use. 

    • Enforcing granular privacy and compliance controls, so sensitive SAP and non-SAP data stays protected, accessible only to authorized users and use cases. 

    • Delivering real-time data to AI agents and LLMs, using built-in data virtualization and transformation capabilities for consistency and context. 

    • Supporting both on-prem and cloud deployments, so enterprises can connect AI tools across any environment. 

    K2view MCP orchestrator workflow

    To demonstrate how the K2view MCP orchestrator enables real-time SAP data access for AI agents, imagine a customer asking a chatbot:

    “Why was this month's invoice $75 more than last month's invoice?”

    The answer depends on real-time billing data stored in SAP, and often aligned with other enterprise sources like usage logs or pricing plans. Rather than hardcoding logic for every possible billing scenario, the K2view MCP orchestrator dynamically interprets the question, queries the customer’s SAP-synchronized Micro-Database™, and responds with a natural-language explanation.

    Below is the orchestrator workflow, explained step by step, showing how a natural language question becomes a precise, grounded answer – without requiring static rules or templates.

    MCP orchestrator-2

    1.   Receive the input from the chatbot (MCP client)


    javascript:

    Copy
    Edit
    var customerId = input.customerId;
    var userText = input.userText;
    var entityName = "Customer";

    Explanation:

    The K2view MCP server receives the chatbot request, which includes the authenticated customerId and the user's natural-language input. The orchestrator is scoped to the Customer entity, which defines the Micro-Database to be queried.

    2.   Retrieve the entity schema

    javascript:

    Copy
    Edit
    var schemaResponse = callDataService("k2view/getEntitySchema", { entity: entityName });
    var entitySchema = schemaResponse.schema;

    Explanation:

    The orchestrator calls an internal service to dynamically retrieve the schema for the Customer entity. This schema reflects the tables and fields available in the per-customer Micro-Database, such as invoices, invoice_items, and usage_charges, aligned with backend SAP tables like VBRK and VBRP.

    3.   Use an LLM to generate an SQL query

    javascript:

    Copy
    Edit
    var prompt = `
    Given the schema below and the user’s question, generate a SQL query 
    that compares the latest two invoices for customer_id = '${customerId}'.

    Schema:
    ${entitySchema}

    User question: "${userText}"
    `;

    var llmResponse = callExternal("llm/generateSQL", { prompt: prompt });
    var sql = llmResponse.generatedSQL;

    Explanation:

    A prompt is constructed for a Large Language Model (LLM), combining the schema and the user's question. The LLM generates SQL dynamically to answer the question based on real-time customer billing data in the Micro-Database.

    4.   Execute the SQL in the entity’s Micro-Database

    javascript:

    Copy
    Edit
    var queryResult = execSQL(entityName, customerId, sql)

    Explanation:

    The generated SQL is executed against the customer’s dedicated Micro-Database. This ensures secure, isolated access to just that customer’s synchronized SAP data — no additional data integration or batch sync is required.

    5.   Have the LLM explain the SQL result

    javascript:

    Copy
    Edit
    var explanationPrompt = `
    The user asked: "${userText}"
    The SQL used: ${sql}
    Result: ${JSON.stringify(queryResult)}

    Generate a clear, human-readable explanation suitable for a chatbot.
    `;

    var explanationResponse = callExternal("llm/explainResult", { prompt: explanationPrompt });

    Explanation:

    This step is required in chatbot scenarios. The LLM is prompted to translate the raw SQL result into a conversational explanation – without technical jargon – for direct display to the user.

    6.   Build the structured MCP response

    javascript:

    Copy
    Edit
    var finalResponse = {
      explanation: explanationResponse.text,
      data: queryResult,
      intent: llmResponse.intent || "invoiceComparison",
      executedSQL: sql,
      traceId: generateTraceId()
    };

    Explanation:

    The orchestrator returns a structured response including the natural-language explanation, the raw query result (for optional UI display), the executed SQL (for auditing), and a trace ID (for logging and observability).

    7.   Return the response to the chatbot

    javascript:

    Copy
    Edit
    return finalResponse;

    Explanation:
    The MCP server returns the structured response to the chatbot client. The chatbot displays the explanation to the user and may use the structured data for additional formatting or follow-up questions.

    Workflow summary

    User question:

    “Why was this month's invoice $75 more than last month's invoice?”

    Generated SQL:

    Copy
    Edit
    SELECT 
      curr.amount AS current_amount,
      prev.amount AS previous_amount,
      curr.amount - prev.amount AS difference
    FROM (
      SELECT amount FROM invoices 
      WHERE customer_id = 'C12345' 
      ORDER BY invoice_date DESC LIMIT 1
    ) curr
    JOIN (
      SELECT amount FROM invoices 
      WHERE customer_id = 'C12345' 
      ORDER BY invoice_date DESC LIMIT 1 OFFSET 1
    ) prev ON 1=1;
    SQL result
    json
    Copy
    Edit
    {
      "current_amount": 325,
      "previous_amount": 250,
      "difference": 75
    }

    MCP response:

    json:

    Copy
    Edit
    {
      "explanation": "Your last invoice was $325, which is $75 higher than the previous month’s $250. The increase is due to additional service charges for extended data usage.",
      "data": {
        "current_amount": 325,
        "previous_amount": 250,
        "difference": 75
      },
      "intent": "invoiceComparison",
      "executedSQL": "...",
      "traceId": "mcp-2025-07-27-abc123"
    }

    MCP orchestration takeaways for SAP developers

    • No hardcoding required: The logic is fully dynamic and driven by real-time user input and schema.
    • Live SAP data access: Customer Micro-Databases stay continuously synchronized with SAP S/4HANA.
    • Orchestrator-based governance: All access is scoped, auditable, and privacy-controlled.
    • Enterprise-grade flexibility: This same pattern is applicable to any use case – not just billing – simply by changing the schema and user query.

    By combining the K2view orchestrator with LLM-powered intent interpretation, SAP developers can unlock conversational AI access to enterprise data with full control, speed, and security – without creating brittle, rule-based logic.

    K2view represents the enterprise approach to MCP

    Integrating data from diverse systems like SAP, Salesforce, and others for AI agents is a complex challenge. Traditionally, each system requires its own MCP server, leaving AI agents to manage critical tasks such as metadata enrichment, entity resolution, privacy controls, and real-time access. This fragmented setup often leads to governance issues, outdated or incomplete data, and a greater risk of errors – ultimately limiting the effectiveness of AI.

    K2view GenAI Data Fusion streamlines this process by acting as a single, comprehensive MCP server that connects and unifies data across all core systems. Its patented semantic data layer enables secure, real-time access to both structured and unstructured data through a single platform. The result is consistent, accurate, and up-to-date information that empowers AI agents to deliver intelligent, personalized, and enterprise-grade responses.

    MCP diagram

    Discover how K2view GenAI Data Fusion unlocks SAP data for MCP clients.

    Achieve better business outcomeswith the K2view Data Product Platform

    Solution Overview
    Take the product tour
    Group 838370

    Learn how to ground GenAI apps with enterprise data

    Take the product tour