sap-ewm-io-agent
Provides live read-only queries against SAP EWM CDS views and standalone inventory-math calculators (ABC/XYZ classification, safety stock, reorder point, slow-moving detection, demand forecasting). Allows AI agents to interact with SAP EWM inventory-optimization tools.
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-ewm-io-agent Get stock overview for warehouse WH01"
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-ewm-io-agent
MCP server exposing SAP EWM inventory-optimization tools to Claude: live read-only queries against confirmed EWM CDS views, plus standalone inventory-math calculators (ABC/XYZ classification, safety stock, reorder point, slow-moving detection, demand forecasting).
See ARCHITECTURE.md for the confirmed service map, known data
gaps, and what's currently blocked.
Status at a glance
Tool | Status |
| ✅ Live |
| ✅ Live |
| ✅ Live |
| 🚫 Blocked (see ARCHITECTURE.md) |
| ✅ Works standalone (needs caller-supplied value/demand data) |
| ✅ Works standalone |
| ✅ Works standalone |
| ✅ Live on-hand qty + caller-supplied movement age |
| ✅ Works standalone |
Related MCP server: SAP MCP Command Center
Setup
npm install
cp .env.example .env
# fill in SAP_USERNAME / SAP_PASSWORD in .envRun
npm startTest
npm testRuns the calc/ unit test suite (29 tests, no SAP connectivity required).
Configuration
All SAP service names, entity sets, and field definitions are confirmed from live
$metadata and stored in src/config/serviceMap.json —
this is the single source of truth. Tool code never hardcodes a SAP field name
independently of this file; src/lib/s4hClient.js validates requested fields against it
and throws a clear error if a field doesn't exist, rather than silently guessing.
Available Tools
9 toolsabc_xyz_classifyA
Classifies materials by ABC (value/Pareto) and XYZ (demand variability) and returns the combined 9-cell matrix label (e.g. 'AX'). DEPENDS ON: caller-supplied { id, value } items for ABC and { id, demandSeries } items for XYZ — demand series cannot currently be sourced automatically from get_goods_movement_history, which is blocked pending CDS-view confirmation (see goodsMovementHistory.js).
Inputs: valueItems (required), demandItems (required).
calc_reorder_pointA
Calculates reorder point = (avgDemandPerPeriod * avgLeadTimePeriods) + safetyStock. DEPENDS ON: calc_safety_stock's output (or an equivalent safetyStock value) and the same demand/lead-time inputs — ultimately sourced from get_goods_movement_history, which is currently blocked (see that tool's file).
Inputs: safetyStock (required), avgDemandPerPeriod (required), avgLeadTimePeriods (required).
calc_safety_stockC
Calculates safety stock via the Z-score method (service-level driven). DEPENDS ON: demand/lead-time statistics which would normally come from get_goods_movement_history (currently blocked) — for now, pass these values directly.
Inputs: demandStdDev (required), avgDemandPerPeriod (required), avgLeadTimePeriods (required), z, +2 more.
detect_slow_moving_stockA
Flags slow-moving/dead stock by on-hand quantity vs. days-since-last-movement. Pulls on-hand quantities live from get_stock_overview for the given warehouse. DEPENDS ON: caller-supplied daysSinceLastMovement per material — this CANNOT currently be derived from get_goods_movement_history (blocked, no date field on that CDS view). Pass a movementAgeByMaterial map keyed by MaterialId.
Inputs: warehouse (required), movementAgeByMaterial (required), minOnHandQty, staleDaysThreshold.
forecast_demandA
Forecasts next-period demand via simple moving average (sma) or single exponential smoothing (ses). DEPENDS ON: a historical demand series which would normally come from get_goods_movement_history (currently blocked) — pass demandSeries directly for now.
Inputs: demandSeries (required), alpha, method, windowSize.
get_bin_utilizationA
Returns EWM bin-level utilization (block flags, distinct material count, empty flag) from the confirmed ZC_EWM_BIN_UTILIZATION_CDS view. NOTE: the raw field IsBlockedForOutbound actually blocks PUTAWAYS (inbound) per its own SAP quickinfo, and IsBlockedForInbound actually blocks STOCK REMOVALS (outbound). This tool returns both the raw fields and semantically-named aliases (isPutawayBlocked / isStockRemovalBlocked) to avoid that ambiguity.
Inputs: warehouse (required), top, storage_type.
get_goods_movement_historyA
BLOCKED. ZC_EWM_GOODS_MOVEMENT_HIST_CDS has no date field to support date_from/date_to filtering, and it is unconfirmed whether the view reads ORDIM_C (confirmed history) or ORDIM_O (open/in-progress tasks). Calling this tool currently raises an error explaining the gap rather than returning data.
Inputs: date_to (required), material (required), date_from (required), warehouse (required).
get_stock_overviewA
Returns EWM stock overview records (warehouse/storage type/bin/quantity/batch/owner) from the confirmed ZC_EWM_STOCK_OVERVIEW_CDS view. Does NOT support filtering by ERP plant or storage_location (those fields don't exist on this EWM-level view) and does NOT return any age/last-movement timestamp (none exists on this entity).
Inputs: top, plant, material, warehouse, +1 more.
get_storage_type_capacityA
Returns per-storage-type capacity utilization (bins, max/free capacity, volume, weight) for a warehouse, from the confirmed ZC_EWM_STORAGE_CAPACITY_CDS view.
Inputs: warehouse (required), top.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct inventory analysis function: ABC/XYZ classification, reorder point calculation, safety stock, slow-moving detection, demand forecasting, bin utilization, stock overview, storage capacity, and goods movement history. No two tools overlap in purpose, and descriptions clearly differentiate them.
Tool names use snake_case and are generally descriptive, but conventions vary: retrieval tools start with 'get_', calculations with 'calc_', but 'abc_xyz_classify', 'detect_slow_moving_stock', and 'forecast_demand' break this pattern. The mix is still readable but lacks a uniform verb prefix.
9 tools is a well-scoped set for inventory analytics in SAP EWM. It covers core data retrieval (stock, bins, capacity) and key calculations (ABC/XYZ, safety stock, reorder point, slow-moving, forecast) without being overwhelming or too sparse.
The server has a critical gap: get_goods_movement_history is blocked, yet it is a dependency for demand forecasting, safety stock, reorder point, and slow-moving detection. This undermines the server's ability to function autonomously, as agents must provide external data for these tools. No write operations exist, which is acceptable for a read-only analytics agent, but the missing data source is a serious limitation.
Maintenance
Related MCP Connectors
Read-only supply-chain decision support: forecasting, reorder policies, ABC-XYZ, data quality.
Find the cash trapped in your inventory, then size reorder points, safety stock and EOQ.
Securely query and analyze business data, dashboards, projections, alerts, and knowledge.
TOTVS Protheus ERP for AI: stock, sales, orders, customers and MRP. Read-only, official API.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceConnects to Odoo ERP to provide comprehensive inventory analysis, including demand forecasting, ABC/XYZ classification, and stock level monitoring. It enables users to identify slow-moving items and generate turnover or aging reports through natural language queries.MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying three synthetic SAP systems (ERP, S/4HANA, BW) for master data, transactions, and analytics via natural language or MCP tools, with a live dashboard.1MIT
- FlicenseAqualityDmaintenanceEnables read-only analytics queries on Acumatica ERP data, including sales orders, inventory, shipments, invoices, purchase orders, customers, and OData generic inquiries.16-
- FlicenseAqualityDmaintenanceEnables demand forecasting and replenishment recommendations using statistical models (Syntetos-Boylan classification, AutoETS, TSB) and provides tools for forecasting, evaluation, and order quantity calculation.6-