sap-s4-mcp
Provides read access to SAP S/4HANA business partners, sales orders, and supplier invoices, and supports proposing sales-order delivery blocks that require human approval before any change is sent to SAP.
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-s4-mcp Show supplier invoices posted this month and flag anything over 50,000"
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-s4-mcp
An MCP server that lets Claude (or any MCP client) read SAP S/4HANA data, and propose changes that a person has to approve before anything is written.
I built it because the hard part of putting an LLM in front of an ERP is not the query. It is making sure the model can't change financial data on its own, and that you can show an auditor exactly what it looked at.
What it does
Tool | SAP API | Notes |
|
| Find customers and suppliers by name |
|
| One partner, with addresses |
|
| Filter by customer and date, newest first |
|
| One order with its line items |
|
| Filter by supplier and posting date |
|
| Proposes a change; nothing is written yet |
| local | Shows proposals and their status |
Example prompts once it's connected to Claude:
"Which sales orders did customer 17100001 place since January? Total them by currency."
"Show me supplier invoices posted this month and flag anything over 50,000."
"Order 4711 looks like a credit risk. Propose a delivery block."
Related MCP server: SAP OData MCP Server
How writes work
Claude ──propose_delivery_block──▶ approval queue (SQLite) ──▶ nothing sent to SAP
│
person runs: sap-s4-mcp approve <id>
▼
CSRF token ─▶ PATCH to SAP ─▶ audit logThe model can only create a proposal. There is no tool that approves one.
A person approves from the command line, sees the full change first, and has to type
y.Writes are off unless
SAP_MCP_ALLOW_WRITES=true, and they're always refused against the public sandbox.Every tool call, refusal, approval and failure goes into
~/.sap-s4-mcp/audit.jsonl.
Quick start
pip install -e ".[dev]"
export SAP_API_KEY=... # free key: https://api.sap.com → log in → "Show API Key"
python scripts/smoke_test.py # calls each read tool once against the sandboxAdd it to Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"sap": {
"command": "sap-s4-mcp",
"args": ["serve"],
"env": { "SAP_API_KEY": "your-key" }
}
}
}To use your own tenant instead of the sandbox, set SAP_BASE_URL, SAP_USER and
SAP_PASSWORD. See .env.example for every setting.
Approving proposals:
sap-s4-mcp pending # what's waiting
sap-s4-mcp approve 3f9a1c2e # shows the change, asks y/N, then sends it
sap-s4-mcp reject 3f9a1c2e
sap-s4-mcp audit -n 50 # last 50 audit entriesDesign decisions
Filters are built, not passed through. Tools take typed arguments (customer id, date) and build the OData
$filterthemselves, with quotes escaped. Letting the model write raw$filterstrings is more flexible, but it's also how you get filter injection and queries that pull a whole table.Row cap.
$topis capped atSAP_MCP_MAX_ROWS(200 by default) whatever the model asks for.Results are cleaned. OData metadata and unexpanded navigation links are dropped, and SAP's
/Date(ms)/values becomeYYYY-MM-DD, so the model spends tokens on data.Errors go back to the model as text (with SAP's own message) instead of crashing the call, so it can correct a bad date or id and try again.
One write, done properly rather than many. A delivery block is a real, reversible action that shows the whole approval path, including SAP's CSRF handshake.
Tests
pytestThe tests use recorded SAP-style responses (via respx), so they run offline. They cover
filter escaping, date handling, the CSRF handshake, and the rule that a proposal sends
nothing to SAP until a person approves it.
What I'd add next
MCP elicitation so the approval can happen in the client UI, not only the CLI
Purchase orders and goods receipts, for a three-way-match check
OAuth for BTP-hosted tenants
License
MIT
Available Tools
7 toolsget_business_partnerBRead-only
Get one business partner with its addresses.
Inputs: business_partner (required).
get_sales_orderBRead-only
Get one sales order with its line items.
Inputs: sales_order (required).
list_proposalsBRead-only
List write proposals and their status (pending, executed, rejected, failed).
Inputs: status.
list_sales_ordersBRead-only
List sales orders, newest first.
Args: sold_to_party: customer (business partner) id to filter on. created_from: only orders on or after this date (YYYY-MM-DD).
Inputs: top, created_from, sold_to_party.
list_supplier_invoicesBRead-only
List supplier invoices, newest posting date first.
Args: invoicing_party: supplier id to filter on. posted_from: only invoices posted on or after this date (YYYY-MM-DD).
Inputs: top, posted_from, invoicing_party.
propose_delivery_blockA
Propose putting a delivery block on a sales order.
Nothing changes in SAP until a person approves the proposal with
sap-s4-mcp approve <id>. Returns the proposal id.
Inputs: reason (required), sales_order (required), block_reason_code (required).
search_business_partnersBRead-only
Find business partners (customers, suppliers) by part of their name.
Returns id, full name, category (1 = person, 2 = organization) and creation date.
Inputs: top, name_contains.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a distinct resource and action: business-partner search vs. lookup, sales-order get vs. list, supplier-invoice listing, and proposal workflow tools. There is little risk of an agent confusing the boundaries between these operations.
All tools follow a consistent snake_case verb_noun pattern, e.g. search_business_partners, get_sales_order, list_sales_orders, propose_delivery_block. The naming is predictable and readable throughout.
Seven tools is a well-scoped set for a focused SAP S/4 read-plus-proposal interface, and each tool has a clear role. The count is comfortably within a reasonable range and does not feel padded.
The surface covers business-partner lookup, sales-order retrieval, supplier-invoice listing, and one write proposal workflow, but notable gaps remain. There is no direct supplier-invoice detail getter, no business-partner list beyond search, and no broader sales-order create/update lifecycle coverage.
Maintenance
Related MCP Connectors
Governed MCP gateway for business apps: roles, previews, approvals and one audit log.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
One governed MCP endpoint for 40+ business systems. Read-only, source-cited answers.
MCP server for Product Management
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server for SAP S/4HANA via the ADT API, enabling querying and reading SAP systems with production write protection.MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for interacting with SAP S/4HANA OData services. It enables querying and controlled creation/update of sales orders, products, customers, and pricing conditions, with safety features like dry-run mode and ETag-based updates.-
- AlicenseNot gradedqualityDmaintenanceEnables testing and development against a mock S/4HANA Business Partner API, exposing customer and customer address entities through the MCP protocol.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables natural-language querying and authenticated CRUD operations against SAP S/4HANA or ECC OData services through dynamic MCP tools with progressive service and entity discovery.69 npmMIT