sap-ewm-mcp
v0.1.0
Published
MCP server for SAP Extended Warehouse Management — connects AI agents to S/4HANA EWM using standard OData V4 APIs. Works with Claude Desktop, Claude Code, and any MCP-compatible client.
Maintainers
Readme
SAP EWM MCP Server — Build Journal
Author: Noman Mohamed Hanif · Senior SAP Technology Consultant GitHub: CodeOfHANA · LinkedIn: noman-mohamed-hanif
What is this?
An MCP (Model Context Protocol) server that connects AI agents directly to SAP Extended Warehouse Management — using only standard, SAP-released OData V4 APIs. No custom objects. No Z-programs. Works on any customer S/4HANA system out of the box.
The goal: replace transactions like LX03, LS24, and LT10 with a single natural language conversation.
"Show me all empty bins in warehouse 1710"
"Where is material EWMS4-03 stocked?"
"What is the fixed bin assignment for material EWMS4-42?"
"Assign material EWMS4-03 to bin 052.08 as its fixed storage location"
"Confirm warehouse task 100000001 in warehouse 1710"Why MCP?
MCP (Model Context Protocol) is an open standard by Anthropic. Any AI agent — Claude, Joule, Cursor — can connect to the same server via one protocol. Build once, serve any agent.
- Today: Claude Code (local, stdio transport)
- Tomorrow: SAP Joule Studio (BTP CF, SSE transport)
- SAP's own ABAP MCP server was announced but not yet shipped — community builds now
Architecture
Phase 1 — Local (current)
Claude Code ──stdio──► MCP Server (Node.js, local)
│
Standard SAP OData V4
│
S/4HANA EWM (On-Premise)Phase 2 — BTP Cloud Foundry (next)
Joule / Claude ──SSE──► MCP Server (BTP CF)
│
Cloud Connector
│
S/4HANA OData V4 APIsProject Structure
sap-ewm-mcp/
├── README.md
├── CHANGELOG.md ← milestone-by-milestone build log
├── ROADMAP.md ← Phase 1 → 2 → 3 plan
├── CONTRIBUTING.md
├── LICENSE
├── .env.example ← copy to .env and fill in your credentials
├── .gitignore
├── package.json
├── index.js ← MCP server entry point, all 7 tools registered
│
├── tools/ ← one file per EWM tool
│ ├── binStatus.js ← get_bin_status
│ ├── stockByMaterial.js ← get_stock_for_material
│ ├── emptyBins.js ← find_empty_bins
│ ├── binUtilization.js ← get_bin_utilization
│ ├── confirmWarehouseTask.js ← confirm_warehouse_task
│ └── fixedBinAssignment.js ← get_fixed_bin_assignments + assign_fixed_bin
│
├── lib/
│ └── s4hClient.js ← shared S/4HANA HTTP client (OData GET + CSRF-aware POST)
│
├── deploy/ ← deployment manifests (Phase 2+)
│ └── phase2-btp/
│ ├── manifest.yml ← CF push config
│ └── xs-security.json
│
└── scripts/
└── run-vsp.sh ← vibing-steampunk ABAP MCP wrapper (optional)Milestones are tracked via git tags (
v0.1.0-week01,v1.0.0-phase1) and documented in CHANGELOG.md. No week-N folders — the commit history and tags are the build journal.
Week 01 — Prerequisites & Setup
1. Runtime
| Requirement | Version | Notes | |---|---|---| | Node.js | v20+ | nodejs.org | | npm | v10+ | bundled with Node.js | | bash | any | Git Bash on Windows works fine |
Verify:
node --version # v20.x.x
npm --version # 10.x.x2. SAP System Access
You need an S/4HANA system (on-premise or private cloud) with:
| Item | Your system |
|---|---|
| Host | your IP/hostname |
| HTTPS port | usually 44300 |
| Client | your client |
| User | a user with developer + EWM display access |
Verify connectivity:
curl -sk -o /dev/null -w "%{http_code}" \
--user YOUR_USER:YOUR_PASSWORD \
"https://YOUR_HOST:44300/sap/bc/ping?sap-client=YOUR_CLIENT"
# Expected: 2003. SAP OData V4 Services — BASIS Activation
Standard SAP EWM OData V4 services are not active by default on on-premise systems. Ask your BASIS team to publish the following service groups via /IWFND/V4_ADMIN → Publish Service Groups:
| Service Group | Used for |
|---|---|
| API_WHSE_STORAGE_BIN_2 | Storage bin status, empty bins, utilization |
| API_WHSE_PHYSSTOCKPROD | Physical stock by material |
| API_WAREHOUSE_ORDER_TASK_2 | Confirm warehouse tasks (bound action) |
| API_WHSE_FIXBIN_ASSGNMNT | Fixed bin assignments — read and create |
Reference: SAP Note 2948977
Verify each service is active in the browser — all four should return service metadata JSON, not a 404:
# Storage Bins (Tools 1, 3, 4)
https://YOUR_HOST:44300/sap/opu/odata4/sap/api_whse_storage_bin_2/srvd_a2x/sap/warehousestoragebin/0001/WarehouseStorageBin
# Physical Stock (Tool 2)
https://YOUR_HOST:44300/sap/opu/odata4/sap/api_whse_physstockprod/srvd_a2x/sap/whsephysicalstockproducts/0001/WarehousePhysicalStockProducts
# Warehouse Task (Tool 5)
https://YOUR_HOST:44300/sap/opu/odata4/sap/api_warehouse_order_task_2/srvd_a2x/sap/warehouseorder/0001/WarehouseTask
# Fixed Bin Assignment (Tools 6, 7)
https://YOUR_HOST:44300/sap/opu/odata4/sap/api_whse_fixbin_assgnmnt/srvd_a2x/sap/whsefixedbinassignment/0001/WarehouseFixedBinAssignment4. ABAP MCP Servers
Two MCP servers are used together — one for live system access, one for ABAP knowledge.
4a. vibing-steampunk (vsp) — optional
Gives Claude Code live read/write/activate access to the S/4HANA ABAP system. Useful during development for creating objects, running classes, and inspecting the system directly from the conversation. Not required to run the EWM MCP server — the server makes its own direct OData calls and works completely independently.
Install vsp:
# Download the latest vsp binary from the vibing-steampunk releases
# Place at: ~/.vsp/vsp.exe (Windows) or ~/.vsp/vsp (Mac/Linux)Configure credentials — .env:
S4H_BASE_URL=https://YOUR_HOST:44300
S4H_CLIENT=YOUR_CLIENT
SAP_USER=YOUR_USER
SAP_PASSWORD=YOUR_PASSWORD
SAP_INSECURE=true
.envis gitignored — never commit credentials.
Configure MCP — .mcp.json:
{
"mcpServers": {
"abap-s4h": {
"command": "bash",
"args": ["scripts/run-vsp.sh"],
"env": {
"SAP_INSECURE": "true",
"SAP_ALLOW_TRANSPORTABLE_EDITS": "true",
"SAP_ALLOWED_PACKAGES": "Z*,$TMP,$*",
"SAP_ALLOWED_TRANSPORTS": "YOUR_TRANSPORT_PREFIX*"
}
}
}
}
.mcp.jsonis gitignored — configure per system, never commit.
Verify vsp is working:
bash scripts/run-vsp.sh --version4b. ABAP Docs MCP by Marian Zeis — recommended
A community-built MCP server that gives Claude access to ABAP language documentation and best practices. No system connection needed — works purely as a knowledge layer on top of vsp.
Particularly useful when working with RAP, CDS, OData, or anything where you want Claude to reference official ABAP patterns rather than guessing.
{
"mcpServers": {
"abap-docs": {
"command": "npx",
"args": ["mcp-remote@latest", "https://mcp-abap.marianzeis.de/mcp"]
}
}
}No installation beyond npx (included with Node.js). Add alongside your vsp entry in .mcp.json.
Built by Marian Zeis — SAP community contribution.
5. Node.js Dependencies
npm install @modelcontextprotocol/sdk node-fetch dotenv zod| Package | Purpose |
|---|---|
| @modelcontextprotocol/sdk | MCP server framework |
| node-fetch | HTTP calls to SAP OData APIs |
| dotenv | Load .env credentials |
| zod | Tool parameter schema validation |
6. Claude Code MCP Registration
Once .mcp.json is in place, Claude Code picks up the MCP servers automatically on startup. To verify tools are loaded, open Claude Code in this directory and run:
/mcpEWM Tools
| # | Tool | API | Type | Status |
|---|---|---|---|---|
| 1 | get_bin_status | API_WHSE_STORAGE_BIN_2 | Read | ✅ Live |
| 2 | get_stock_for_material | API_WHSE_PHYSSTOCKPROD | Read | ✅ Live |
| 3 | find_empty_bins | API_WHSE_STORAGE_BIN_2 | Read | ✅ Live |
| 4 | get_bin_utilization | Both above | Read | ✅ Live |
| 5 | confirm_warehouse_task | API_WAREHOUSE_ORDER_TASK_2 | Write (bound action) | ✅ Live |
| 6 | get_fixed_bin_assignments | API_WHSE_FIXBIN_ASSGNMNT | Read | ✅ Live |
| 7 | assign_fixed_bin | API_WHSE_FIXBIN_ASSGNMNT | Write (POST) | ✅ Live |
All 7 tools verified live against S/4HANA EWM warehouse 1710.
Write tools (5, 7) use CSRF token fetch + session cookie forwarding. Tool 5 additionally fetches the ETag and passes If-Match as required by the bound action.
Week 01 — What Was Built
- [x] Project scaffold and architecture design
- [x]
.env+.mcp.jsonconfigured, server starts clean - [x] All 4 SAP OData V4 service groups published and verified live
- [x] 7 EWM tools built, registered, and verified against warehouse 1710
- [x] Read tools (1–4, 6) — OData GET, live data confirmed
- [x] Write tools (5, 7) — CSRF token fetch + session cookie forwarding + ETag/If-Match implemented and verified
- [x] Fixed bin assignment (Tools 6+7) — full CRUD, first write to master data confirmed live
- [x] MCP server works standalone — no dependency on vibing-steampunk or any other MCP server
Follow the Journey
This build is documented publicly milestone by milestone.
- CHANGELOG.md — what was built at each tag
- ROADMAP.md — the full Phase 1 → 2 → 3 plan
- LinkedIn — post per working milestone
- GitHub Releases — tagged snapshots with narrative
