sap-ewm-io-agent
# 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`](./ARCHITECTURE.md) for the confirmed service map, known data
gaps, and what's currently blocked.
## Status at a glance
| Tool | Status |
|---|---|
| `get_stock_overview` | ✅ Live |
| `get_bin_utilization` | ✅ Live |
| `get_storage_type_capacity` | ✅ Live |
| `get_goods_movement_history` | 🚫 Blocked (see ARCHITECTURE.md) |
| `abc_xyz_classify` | ✅ Works standalone (needs caller-supplied value/demand data) |
| `calc_safety_stock` | ✅ Works standalone |
| `calc_reorder_point` | ✅ Works standalone |
| `detect_slow_moving_stock` | ✅ Live on-hand qty + caller-supplied movement age |
| `forecast_demand` | ✅ Works standalone |
## Setup
```bash
npm install
cp .env.example .env
# fill in SAP_USERNAME / SAP_PASSWORD in .env
```
## Run
```bash
npm start
```
## Test
```bash
npm test
```
Runs 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`](./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.
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.