sap-cloud-erp-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sap-cloud-erp-mcp list my open purchase orders"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SAP Cloud ERP MCP Server
An MCP (Model Context Protocol) server for SAP S/4HANA Cloud Public Edition, built on
the SDK's released business OData APIs. It exposes list / get / create (/update)
tools for 14 business objects, plus a small number of object-specific actions (e.g.
releasing a production order), for a total of 57 tools.
Object | Tools |
Material (Product) |
|
Material BOM |
|
Purchase Requisition |
|
Purchase Order |
|
Purchase Contract |
|
Sales Quotation |
|
Sales Order |
|
Sales Contract |
|
Production Order |
|
Planned Order |
|
Production Order Confirmation |
|
Production Operation Confirmation |
|
Material Document (goods movement) |
|
Outbound Delivery |
|
Inbound Delivery |
|
s4_production_order_release releases a production order via the OData V2 function
import ReleaseOrder — order status fields are read-only via PATCH, so this is the only
way to release an order through the API.
Setup
npm install
npm run build
cp .env.example .env # fill in your SAP connection detailsRequired env vars (see .env.example):
S4_BASE_URL— your SAP S/4HANA Cloud API base URLS4_AUTH_TYPE—oauth2_client_credentialsorbasicOAuth2:
S4_OAUTH_TOKEN_URL,S4_CLIENT_ID,S4_CLIENT_SECRETBasic:
S4_USERNAME,S4_PASSWORDMCP_TRANSPORT—stdio(default) orhttp;PORTwhen usinghttp
The services must be exposed via a Communication Arrangement in your SAP tenant
(Communication User + the matching Communication Scenario for each API — see the table
below, and the comments at the top of each src/tools/*.ts file for the exact service path).
Related MCP server: ABAP-ADT-API MCP-Server
Running
npm run start # stdio transport, for MCP clients like Claude Desktop
MCP_TRANSPORT=http npm run start # Streamable HTTP on $PORT
npm run inspector # MCP Inspector UI against the stdio serverRegistering with an MCP client
{
"mcpServers": {
"sap-cloud-erp": {
"command": "node",
"args": ["/absolute/path/to/sap-cloud-erp/dist/index.js"],
"env": {
"S4_BASE_URL": "https://your-tenant-api.s4hana.cloud.sap",
"S4_AUTH_TYPE": "basic",
"S4_USERNAME": "...",
"S4_PASSWORD": "...",
"MCP_TRANSPORT": "stdio"
}
}
}
}Verified against a live tenant
list (and CSRF-token acquisition) for the following was confirmed working against a
real S/4HANA Cloud Public Edition tenant: Purchase Order, Purchase Requisition, Sales
Quotation, Sales Contract, Sales Order, Production Order, Planned Order, Material
Document, Outbound Delivery, Inbound Delivery, Production Order Confirmation (both
levels). create (including deep-insert with nested account assignment), update, and
the release action were verified end-to-end for Purchase Order, Production Order,
Sales Order, and Material Document (goods receipt against a PO) against a live tenant.
create was also verified for Sales Order against a mock server — see evaluation/.
Not yet independently verified — these returned SAP-side authorization errors on the original test tenant, not code errors (the error was "no start authorization" / "no authorization to access service group", which happens even when the matching Communication Arrangement exists — it means either the arrangement's Inbound Communication tab doesn't have that specific API checked, or the Communication User's backend role/authorization profile is missing the corresponding authorization object):
s4_material_*(Product,CE_PRODUCT_0002, comm. scenarioSAP_COM_0009)
If you hit this, open the relevant Communication Arrangement in your tenant, check the Inbound Communication → services list, and confirm the Communication User's authorization profile includes that scenario.
Communication Scenarios (confirmed on a live SAP_COM catalog)
Object | Comm. Scenario |
Material |
|
Material BOM |
|
Purchase Requisition |
|
Purchase Order |
|
Purchase Contract |
|
Sales Quotation |
|
Sales Order |
|
Sales Contract |
|
Planned Order |
|
Production Order / Confirmation |
|
Material Document |
|
Outbound / Inbound Delivery |
|
Known limitations
All
additionalFields(create) /fields(update) parameters accept arbitrary extra OData fields as a passthrough, since exact optional-field lists vary by tenant configuration (e.g. account assignment, batch management, variant configuration).No delete/cancel tools are implemented by design — SAP has no hard-delete for these objects, and cancellation flows were explicitly out of scope.
s4_material_document_*,s4_production_order_confirmation_*,s4_production_operation_confirmation_*have no update tool — these SAP objects are immutable once posted (only cancellation exists, which is out of scope).Production order component fields (e.g. batch number) are read-only on the classic OData entity set exposed by this server's
s4_production_order_get; updating them requires the RAP-BO-based component entity, which is not yet wrapped in a dedicated tool (seeCLAUDE.md§3 for the pattern if you need to add one).
Architecture
src/sapClient.ts— shared OAuth2/basic auth, token caching, CSRF token handling, V2/V4 response normalization, OData error-message extraction, andsapCallFunctionImport()for calling OData V2 function imports (actions like release).src/tools/*.ts— one file per business object, each registering its ownlist/get/create(/update) tools with explicit Zod schemas. No shared "generic SAP object" abstraction by design — each object's fields and quirks are handled explicitly.src/index.ts— server bootstrap; registers all tools and starts either the stdio or stateless Streamable HTTP transport based onMCP_TRANSPORT.
See CLAUDE.md for implementation gotchas discovered while building and hardening this
server (OData V2 vs V4 decimal encoding, deep-insert requirements, ETag handling for
function imports, composite-key pitfalls, and more) — read it before modifying
sapClient.ts or adding a new create/update tool.
License
Available Tools
27 toolss4_material_bom_getGet Material BOM (header + optional components)ARead-onlyIdempotent
Get a Material BOM header by its composite key (billOfMaterial, billOfMaterialCategory, billOfMaterialVariant, material, plant, billOfMaterialVersion, engineeringChangeDocument). Set includeItems=true to also fetch its components.
Inputs: plant (required), material (required), billOfMaterial (required), billOfMaterialVariant (required), +4 more.
s4_outbound_delivery_createCreate Outbound DeliveryADestructive
Create an outbound delivery with reference to a preceding sales order (or other document). Required: shippingPoint, at least one item with referenceSDDocument.
Inputs: items (required), shippingPoint (required), shipToParty, deliveryType, +1 more.
s4_outbound_delivery_getGet Outbound DeliveryARead-onlyIdempotent
Get an outbound delivery header and its items by delivery number.
Inputs: deliveryDocument (required).
s4_planned_order_createCreate Planned OrderADestructive
Create a planned order. Practically required: material, mrpPlant, totalQuantity (exact mandatory-field rules are not fully documented by SAP for this API — verify on your tenant).
Inputs: material (required), mrpPlant (required), totalQuantity (required), additionalFields, +1 more.
s4_planned_order_getGet Planned OrderARead-onlyIdempotent
Get a planned order by its order number.
Inputs: plannedOrder (required).
s4_planned_order_listList Planned OrdersARead-onlyIdempotent
List planned orders. Supports OData $filter/$top/$skip/$select.
Inputs: top, skip, filter, select.
s4_production_order_getGet Production OrderBRead-onlyIdempotent
Get a production order by its order number.
Inputs: manufacturingOrder (required).
s4_production_order_listList Production OrdersBRead-onlyIdempotent
List manufacturing/production orders. Supports OData $filter/$top/$skip/$select.
Inputs: top, skip, filter, select.
s4_production_order_releaseRelease Production OrderADestructive
Release a production/manufacturing order (OData function import ReleaseOrder). Order status fields like OrderIsReleased are read-only via PATCH; this is the only way to release.
Inputs: manufacturingOrder (required).
s4_production_order_updateUpdate Production OrderADestructive
Update fields on an existing production order (e.g. dates, quantity). Components/operations are not updatable via this tool.
Inputs: fields (required), manufacturingOrder (required).
s4_purchase_contract_createCreate Purchase ContractBDestructive
Create a purchase contract (outline agreement) with at least one item. Required header: purchaseContractType, supplier, purchasingOrganization, purchasingGroup, companyCode, validityStartDate, validityEndDate. Required per item: plant, targetQuantity, orderQuantityUnit, and either material or materialGroup.
Inputs: items (required), supplier (required), companyCode (required), purchasingGroup (required), +5 more.
s4_purchase_contract_getGet Purchase ContractARead-onlyIdempotent
Get a purchase contract header (and optionally its items) by contract number.
Inputs: purchaseContract (required), includeItems.
s4_purchase_contract_listList Purchase ContractsARead-onlyIdempotent
List purchase contract (outline agreement) headers. Supports OData $filter/$top/$skip/$select.
Inputs: top, skip, filter, select.
s4_purchase_order_createCreate Purchase OrderADestructive
Create a purchase order with at least one item. Required header: companyCode, purchaseOrderType, supplier, purchasingOrganization, purchasingGroup. Required per item: plant, material, orderQuantity, netPriceAmount. For account-assigned items (e.g. category 'M' individual PO tied to a sales order), set item.accountAssignmentCategory and item.accountAssignment {salesOrder, salesOrderItem} — this creates a PurchaseOrderAccountAssignment record.
Inputs: items (required), supplier (required), companyCode (required), purchasingGroup (required), +3 more.
s4_purchase_order_getGet Purchase OrderARead-onlyIdempotent
Get a purchase order header (and optionally its items) by PO number.
Inputs: purchaseOrder (required), includeItems.
s4_purchase_order_updateUpdate Purchase OrderADestructive
Update fields on an existing purchase order header.
Inputs: fields (required), purchaseOrder (required).
s4_sales_contract_createCreate Sales ContractADestructive
Create a sales contract with at least one item (the header cannot be created without at least one item/association). Required header: salesContractType, salesOrganization, distributionChannel, salesDistrict, soldToParty. Required per item: material, requestedQuantity.
Inputs: items (required), soldToParty (required), salesDistrict (required), salesContractType (required), +4 more.
s4_sales_contract_getGet Sales ContractARead-onlyIdempotent
Get a sales contract header and its items by contract number.
Inputs: salesContract (required).
s4_sales_contract_listList Sales ContractsARead-onlyIdempotent
List sales contract headers. Supports OData $filter/$top/$skip/$select.
Inputs: top, skip, filter, select.
s4_sales_contract_updateUpdate Sales ContractBDestructive
Update fields on an existing sales contract header.
Inputs: fields (required), salesContract (required).
s4_sales_order_createCreate Sales OrderBDestructive
Create a sales order with at least one item. Required header: salesOrderType, salesOrganization, distributionChannel, organizationDivision, soldToParty. Required per item: material.
Inputs: items (required), soldToParty (required), salesOrderType (required), salesOrganization (required), +3 more.
s4_sales_order_getGet Sales OrderARead-onlyIdempotent
Get a sales order header and its items by order number.
Inputs: salesOrder (required).
s4_sales_order_listList Sales OrdersBRead-onlyIdempotent
List sales order headers. Supports OData $filter/$top/$skip/$select.
Inputs: top, skip, filter, select.
s4_sales_order_updateUpdate Sales OrderADestructive
Update fields on an existing sales order header.
Inputs: fields (required), salesOrder (required).
s4_sales_quotation_getGet Sales QuotationARead-onlyIdempotent
Get a sales quotation header and its items by quotation number.
Inputs: salesQuotation (required).
s4_sales_quotation_listList Sales QuotationsARead-onlyIdempotent
List sales quotation headers. Supports OData $filter/$top/$skip/$select.
Inputs: top, skip, filter, select.
s4_sales_quotation_updateUpdate Sales QuotationBDestructive
Update fields on an existing sales quotation header.
Inputs: fields (required), salesQuotation (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Every tool targets a distinct SAP document/resource and action, such as sales orders, purchase orders, sales contracts, or production orders. The get/list/create/update/release verbs are applied consistently, so there is little risk of selecting the wrong tool.
Tool names follow a strict s4_<resource>_<action> pattern with snake_case throughout. Actions are consistently list/get/create/update/release, making the API surface highly predictable.
27 tools is on the heavy side, but the server covers multiple ERP domains: sales, purchasing, manufacturing, and logistics. Each tool is distinct and purposeful, though the count is above the ideal range for a tightly scoped server.
Several document lifecycles are incomplete: there is no purchase order list, no sales quotation create, no production order create, and no outbound delivery list. These are significant gaps that would block common ERP workflows, even though core sales order and purchase order operations are covered.
Related MCP Connectors
MCP server for Product Management
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
MCP server for AI access to Swagger by SmartBear.
Related MCP Servers
- AlicenseCqualityCmaintenanceA Model Context Protocol server that facilitates communication between ABAP systems and MCP clients, providing tools for managing ABAP objects, handling transport requests, and performing code analysis to enhance ABAP development workflows.100207 npm212MIT
- AlicenseCqualityNot gradedmaintenanceA Model Context Protocol server that facilitates seamless communication between ABAP systems and MCP clients for managing ABAP objects, transport requests, and code analysis. It acts as a wrapper for the ABAP ADT API to enhance the efficiency of ABAP development workflows.100-
- AlicenseCqualityDmaintenanceAn MCP server that enables seamless communication between ABAP systems and MCP clients using the ABAP Development Tools (ADT) API. It provides tools for managing ABAP objects, handling transport requests, and performing code analysis directly through MCP-compatible interfaces.100MIT
- AlicenseBqualityDmaintenanceAn MCP server for automating SAP BTP Cloud Foundry operations, providing tools for deploying, managing, and monitoring applications.299 npmMIT