SAPUse Case

SAP + Model Context Protocol

An MCP Server for SAP: Giving AI Agents Safe, Governed Access to ECC and S/4HANA

Short answer

An MCP server for SAP exposes a small set of well-defined tools, such as get open sales orders, check stock or look up a PO, that AI agents can call through the Model Context Protocol. Each tool maps to a released OData API or CDS view in S/4HANA or a BAPI in ECC, runs with the user's SAP authorisations, and stays read-only unless a write tool is explicitly approved.

ERP
SAP S/4HANA, SAP ECC 6.0, SAP S/4HANA Cloud
Industries
Manufacturing, Aerospace, Electronics, Industrial Machinery
Written for
Enterprise Architect

The Model Context Protocol has become a common way to connect AI agents to business systems. Instead of each assistant integrating with SAP in its own way, an MCP server publishes tools with clear names, inputs and outputs, and any MCP-capable client or agent framework can use them.

For SAP, this is attractive and risky in equal measure. Attractive, because agents need structured, reliable access to orders, stock, purchasing and production data. Risky, because a poorly designed MCP server with broad technical user access turns every agent into a powerful, unaudited SAP user.

SAP is building its own agent capabilities into Joule and BTP and has signalled support for agent interoperability. If you are on S/4HANA Cloud and SAP's agents cover your scenarios, use them. A self-built or partner MCP server makes sense when you need agents over ECC or on-prem S/4HANA, when agents must combine SAP with other systems, or when everything must run inside your network.

This page describes how to design an SAP MCP server: tool selection, mapping to SAP interfaces, authentication, logging and the rules for write operations.

What usually gets in the way

The problems we hear most from enterprise architect teams running SAP S/4HANA.

Point-to-point AI integrations

Each AI pilot builds its own SAP connection, leading to duplicated effort and inconsistent security.

Overly broad tools

A generic run any query tool gives agents unlimited reach and makes behaviour unpredictable.

Shared technical users

MCP servers often authenticate to SAP with one technical user, losing per-user authorisation and audit.

Unclear write controls

Without explicit rules, agents may create or change SAP documents without the approvals that apply to people.

ECC left out

Many examples assume S/4HANA OData; ECC landscapes need BAPI and RFC-based tools.

Where AI earns its place in SAP S/4HANA

Each use case names the ERP objects it reads or writes, so your ERP team can judge the integration effort before anyone commits budget.

Sales order lookup tool

Return open sales orders for a customer with status, delivery dates and blocks.

Touches: API_SALES_ORDER_SRV in S/4HANA; BAPI_SALESORDER_GETLIST and VBAK/VBAP in ECC

Outcome: Agents answer customer service questions with live SAP data.

Stock availability tool

Return stock and availability for a material and plant, including open receipts.

Touches: API_MATERIAL_STOCK_SRV; BAPI_MATERIAL_AVAILABILITY in ECC

Outcome: Reliable availability answers for sales and planning agents.

Purchase order status tool

Return PO lines, confirmations and goods receipts for a PO or supplier.

Touches: API_PURCHASEORDER_PROCESS_SRV; BAPI_PO_GETDETAIL1 in ECC

Outcome: Buyers and agents see supply status without opening ME23N.

Production order status tool

Return production order status, operations and confirmations.

Touches: Production order APIs in S/4HANA; BAPI_PRODORD_GET_DETAIL in ECC

Outcome: Supervisors and agents track order progress in plain language.

Draft purchase requisition tool

Create a purchase requisition that then follows release strategy, only after user confirmation.

Touches: Purchase requisition API in S/4HANA; BAPI_PR_CREATE in ECC

Outcome: Agents prepare requests while approvals stay intact.

Document search tool

Search attached documents and long texts related to an SAP object.

Touches: GOS attachments, long texts, DMS documents

Outcome: Agents combine structured data with related documents.

Cross-system composite tools

Combine SAP data with MES or PLM through separate MCP servers used by the same agent.

Touches: SAP MCP tools plus MES and PLM MCP tools

Outcome: Agents answer plant questions across systems.

Reference architecture

The MCP server sits between agents and SAP, exposing curated tools that map to released interfaces, authenticating per user and logging every call. Write tools are separate, explicit and gated by confirmation.

  1. 1

    Agent clients

    MCP-capable assistants and agent frameworks, using a private model on your infrastructure.

  2. 2

    MCP server

    Tool definitions with typed inputs and outputs, input validation and rate limits.

  3. 3

    SAP adapters

    OData clients for S/4HANA and RFC clients via the SAP NW RFC SDK for ECC BAPIs.

  4. 4

    Identity

    OAuth or SAML with principal propagation so SAP calls run as the user.

  5. 5

    Audit

    Logs of tool calls, parameters, results and users forwarded to the SIEM.

Integration notes for your ERP team

  • Design narrow, task-specific tools rather than a generic query tool.
  • Map S/4HANA tools to released OData APIs from the SAP Business Accelerator Hub.
  • Use PyRFC or node-rfc with the SAP NW RFC SDK for ECC BAPI-based tools.
  • Propagate user identity to SAP; avoid shared technical users for interactive tools.
  • Mark write tools clearly and require explicit user confirmation before execution.
  • Log every tool call with user, parameters and result size, and alert on unusual patterns.
  • Version tool definitions and test them against a fixed evaluation set after SAP upgrades.

Deployment options

On-prem MCP server

ECC and on-prem S/4HANA, restricted environments.

Server and model run inside your network with direct access to SAP.

Private cloud MCP server

SAP in a hyperscaler under your account.

Server in your VPC with private connectivity to SAP.

SAP-native agents first

S/4HANA Cloud with SAP agent coverage.

Use SAP's agents and add MCP only for gaps.

Compliance and data control

How the architecture supports your obligations. Certification and accountability stay with your organisation; the design keeps the evidence straightforward.

SOX

Write tools create drafts subject to existing approvals and release strategies; no direct posting.

NIST SP 800-171 / CMMC

Per-user authentication, least privilege tools and logging support the customer's controls.

ITAR / EAR

On-prem server and model keep controlled data inside the boundary.

Internal AI policy

Tool lists are reviewed like role designs and recertified periodically.

How an engagement runs

Phase 1 . 1-2 weeks

Tool design

  • -Use case to tool mapping
  • -SAP interface selection
  • -Security design

Phase 2 . 3-4 weeks

Build

  • -MCP server with read tools
  • -Identity integration
  • -Logging

Phase 3 . 3-4 weeks

Pilot

  • -Agent pilot with users
  • -Evaluation set
  • -Security testing

Phase 4 . Ongoing

Extend

  • -Gated write tools
  • -Cross-system tools
  • -Tool recertification

Questions to ask any vendor, including us

A short list that separates real SAP S/4HANA AI work from a chatbot demo.

  1. Which SAP interfaces does each tool use, and are they released APIs?
  2. Does the server authenticate per user or with a shared account?
  3. How are write tools gated?
  4. How do you test tools after SAP upgrades?
  5. Where do the model and server run?
  6. How do tool calls appear in our audit logs?

Frequently asked questions

What is an MCP server for SAP?

It is a service that implements the Model Context Protocol and exposes SAP operations as tools that AI agents can call. Each tool has defined inputs and outputs and maps to an SAP interface such as an OData API or a BAPI. Agents use these tools to read SAP data, and in controlled cases to prepare documents, without custom integration per assistant.

Does SAP provide an official MCP server?

SAP is building agent capabilities into Joule and BTP and has signalled support for agent interoperability standards. Check SAP's current announcements for the state of official MCP support for your products. ECC and on-prem S/4HANA customers often build or buy an MCP server that uses standard SAP interfaces.

Can an MCP server work with SAP ECC?

Yes. Tools map to BAPIs and RFC-enabled function modules called through the SAP NW RFC SDK, using libraries such as PyRFC or node-rfc. The design principles are the same as for S/4HANA: narrow tools, per-user authorisation and logging.

Should agents be able to write to SAP?

Only through specific write tools that create drafts, such as purchase requisitions subject to release strategy or parked documents, after explicit user confirmation. Direct posting by agents bypasses controls and should be avoided except for low-risk, approved scenarios.

How many tools should an SAP MCP server have?

Start small, with five to fifteen read tools covering the most common questions in your pilot use case. Narrow tools make agent behaviour more predictable and easier to secure. Add tools based on observed needs rather than exposing everything at once.

How is security handled?

Through per-user authentication with principal propagation, least-privilege tool design, input validation, rate limiting and logging forwarded to your SIEM. Tool lists are reviewed like role designs. The model and server should run on infrastructure you control when data is sensitive.

Can one agent use SAP and other systems together?

Yes. An agent can connect to several MCP servers, for example SAP, MES and PLM, and combine their results. This is one of MCP's main benefits for manufacturing, where many questions cross system boundaries.

Talk it through with an engineer who knows SAP S/4HANA

Bring one real question your team cannot answer from the ERP today. We will map the data path, the model, and where it runs, and tell you honestly if AI is the wrong tool for it.

Try it here, free

SAP MM and QM BAPI and API List Reference

Open full tool

A searchable list of the common SAP MM and QM BAPIs and S/4HANA OData APIs, what each does, and whether it needs a commit.

Get ERP alerts and new tools

Support deadlines, release changes and new free tools for the ERP you run. A couple of emails a month at most.

Free. Unsubscribe with one click from any email.

ArchRay builder
Design the on-prem AI stack: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

Keep exploring

Free tools

ERP fixes and how-tos

Guides

AI on your ERP

Integrations