Skip to content
Back to search

enterprise-erp-odata-mcp-server

Enterprise ERP & SAP S/4HANA Clean-Core OData v4 MCP Server with EDM Schema Validation, C++20 $filter/BUKRS Guardrails, PII Masking & Hash-Chained Audit Log

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nagarjunak-pixel--enterprise-erp-odata-mcp-server/badge.svg)](/listings/nagarjunak-pixel--enterprise-erp-odata-mcp-server)

HTML

<a href="/listings/nagarjunak-pixel--enterprise-erp-odata-mcp-server"><img src="/api/listings/nagarjunak-pixel--enterprise-erp-odata-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

git clone https://github.com/nagarjunak-pixel/enterprise-erp-odata-mcp-server.git
cd enterprise-erp-odata-mcp-server
uv sync --python 3.13 --all-extras

# 1. Run 6 SAP S/4HANA Clean-Core OData guardrail scenarios + C++20 benchmark
uv run erp-odata-mcp demo

# 2. Benchmark C++20 $filter scanner, 20K-row BUKRS RBAC & 25K-entry audit chain
uv run erp-odata-mcp bench --rows 20000 --audit-len 25000

# 3. Execute a governed OData v4 query from CLI, FastAPI (:8270), or stdio MCP
uv run erp-odata-mcp query A_PurchaseOrder -f "GrossAmount ge 25000" -c "1000"
uv run erp-odata-mcp serve --port 8270
uv run erp-odata-mcp mcp

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 104 lines
  1. # Enterprise ERP OData MCP Server (`v1.0.0`)
  2. **SAP S/4HANA & Enterprise ERP OData v4 Model Context Protocol (MCP) Server with Clean-Core Schema Validation, C++20 `$filter` / `BUKRS` Row-Level Guardrails, PII Masking & Tamper-Evident Audit Logging (`CLI · FastAPI :8270 · MCP stdio · React 18 Workbench`)**
  3. [![CI](https://github.com/nagarjunak-pixel/enterprise-erp-odata-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/nagarjunak-pixel/enterprise-erp-odata-mcp-server/actions/workflows/ci.yml)
  4. [![Release](https://img.shields.io/badge/release-v1.0.0-0284c7)](https://github.com/nagarjunak-pixel/enterprise-erp-odata-mcp-server/releases/tag/v1.0.0)
  5. [![Coverage](https://img.shields.io/badge/branch%20coverage-98.05%25-10b981)](https://github.com/nagarjunak-pixel/enterprise-erp-odata-mcp-server)
  6. [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-slate.svg)](LICENSE)
  7. > **Executive Business Impact & Enterprise ROI (20-Second Scan)**
  8. > - **Enterprise Failure Mode Eliminated:** Connecting AI agents directly to SAP S/4HANA or enterprise ERP APIs without deterministic boundary controls causes four severe production failures: **(1) hallucinated legacy `Z-*` fields and raw table queries (`BSEG`/`EKKO`)** that violate SAP Clean Core, **(2) prompt-injected `$filter` tautologies (`or 1 eq 1`) and `$batch` smuggling**, **(3) cross-entity CompanyCode (`BUKRS`) financial data leakage or unredacted IBAN/Tax-ID exposure**, and **(4) unapproved autonomous Purchase Order / ledger mutations**.
  9. > - **What `enterprise-erp-odata-mcp-server` Delivers:** A deny-by-default **OData v4 MCP gateway** that validates every `$select`, `$filter`, `$orderby`, `$expand`, and `$top` parameter against typed EDM (`CSDL`) metadata *outside* the LLM prompt, enforces vectorized **C++20 `BUKRS` row-level authorization** and automatic **PII masking**, gates mutating ERP actions behind **fresh human approval tokens (`APR-...`) + 3-way match (`PO == GR == IR`) invariants**, and records every allowed or blocked call in a **SHA-256 + C++20 SplitMix64 hash-chained audit ledger**.
  10. > - **Measured Systems Proof (Apple Silicon / Clang `-O3 -std=c++20` & Ubuntu Python `3.13`):**
  11. > - **`67.03x` Native C++20 Guardrail Speedup:** **`0.101 ms`** (`clang++ -O3 -std=c++20` via zero-copy `array` buffers) vs **`6.783 ms`** (pure-Python reference twin) across a `20,000`-row `BUKRS` authorization pass + `$filter` security scan + `25,000`-record SplitMix64 audit-chain verification.
  12. > - **Strict Engineering Hygiene:** `mypy --strict` (`0` errors), `ruff` (`0` warnings), **`98.05%` pytest branch coverage** (including Hypothesis property-based C++20/Python parity suites), `Apache-2.0` license, and a **React 18 + TypeScript** Clean-Core Workbench UI.
  13. ---
  14. ## 60-Second Quickstart
  15. ```bash
  16. git clone https://github.com/nagarjunak-pixel/enterprise-erp-odata-mcp-server.git
  17. cd enterprise-erp-odata-mcp-server
  18. uv sync --python 3.13 --all-extras
  19. # 1. Run 6 SAP S/4HANA Clean-Core OData guardrail scenarios + C++20 benchmark
  20. uv run erp-odata-mcp demo
  21. # 2. Benchmark C++20 $filter scanner, 20K-row BUKRS RBAC & 25K-entry audit chain
  22. uv run erp-odata-mcp bench --rows 20000 --audit-len 25000
  23. # 3. Execute a governed OData v4 query from CLI, FastAPI (:8270), or stdio MCP
  24. uv run erp-odata-mcp query A_PurchaseOrder -f "GrossAmount ge 25000" -c "1000"
  25. uv run erp-odata-mcp serve --port 8270
  26. uv run erp-odata-mcp mcp
  27. ```
  28. ---
  29. ## Architecture & Guardrail Pipeline
  30. ```mermaid
  31. flowchart LR
  32. AGENT["AI Agent / Claude Code / Copilot<br/>(MCP JSON-RPC 2.0 or REST)"] --> GW["ODataGuardrailGateway<br/>(Out-of-Prompt Policy Boundary)"]
  33. GW --> CSDL["1. Clean-Core EDM Schema Gate<br/>(A_PurchaseOrder · A_SalesOrder ·<br/>A_JournalEntryItem · A_MaterialStock)"]
  34. CSDL --> SCAN["2. C++20 $filter Security Scanner<br/>(Blocks '1 eq 1', ';--', '$batch',<br/>unbalanced parens & cost DoS)"]
  35. SCAN --> AST["3. Recursive-Descent $filter AST<br/>(Zero-eval() EDM Literal Typecheck)"]
  36. AST --> RBAC["4. C++20 BUKRS Row-Level RBAC<br/>+ Automatic IBAN / Tax-ID Redaction"]
  37. RBAC --> MUT["5. Action Gate (Human Token APR-...<br/>+ MM 3-Way Match Invariant)"]
  38. MUT --> AUDIT["6. Tamper-Evident Audit Ledger<br/>(SHA-256 + C++20 SplitMix64 Chain)"]
  39. ```
  40. ---
  41. ## Released SAP S/4HANA Clean-Core EntitySets Included
  42. | OData v4 EntitySet | SAP Module | Clean-Core CDS Projection | Enforced Guardrails |
  43. | --- | --- | --- | --- |
  44. | `A_PurchaseOrder` | `MM` (Procure-to-Pay) | `I_PurchaseOrderAPI01` | `CompanyCode` (`BUKRS`) RBAC · `VendorIBAN` PII masking & `$filter` probe block · `max_top=100` · `ThreeWayMatchStatus == 'MATCHED'` + `APR-...` token on release |
  45. | `A_SalesOrder` | `SD` (Order-to-Cash) | `I_SalesOrderAPI01` | `CompanyCode` RBAC · `CustomerTaxId` PII masking & `$filter` probe block · `CreditBlockStatus` visibility · `max_top=100` |
  46. | `A_JournalEntryItem` | `FI` (Universal Journal) | `I_JournalEntryItemCube` (`ACDOCA`) | Strict `Edm.Int32` (`FiscalYear`) & `Edm.Decimal` typechecking · `CompanyCode` RBAC · `max_top=200` |
  47. | `A_MaterialStock` | `MM-IM` (Inventory) | `I_MaterialStock_2` | Plant & `CompanyCode` stock visibility · `SafetyStockQty` vs `UnrestrictedStockQty` checks |
  48. ---
  49. ## 6 Built-In Enterprise Verification Scenarios (`uv run erp-odata-mcp demo`)
  50. 1. **Authorized Clean-Core Query (`ALLOWED`):** Queries `A_PurchaseOrder` (`GrossAmount ge 25000`) for `CompanyCode=1000` (Dubai HQ)—returns `2` authorized rows, filters `2` cross-company (`2000`/`3000`) rows in C++20, and masks `VendorIBAN` (`AE07***REDACTED***456`).
  51. 2. **Hallucinated Legacy Z-Field (`BLOCKED`):** Rejects `ZZ_DIRTY_REBATE_CODE` (`UNKNOWN_SELECT_FIELD`, `UNKNOWN_FILTER_FIELD`) with exact released `I_PurchaseOrderAPI01` field remediation.
  52. 3. **Prompt-Injected OData Tautology (`BLOCKED`):** C++20 lexical scanner catches `CompanyCode eq '1000' or 1 eq 1` (`FILTER_INJECTION_BLOCKED`) before execution.
  53. 4. **Silent Autonomous ERP Write (`BLOCKED`):** Blocks `odata_simulate_po_release` when `human_approval_token` is missing (`MISSING_HUMAN_APPROVAL`).
  54. 5. **Goods-Receipt / Invoice Variance Hold (`BLOCKED`):** Blocks PO `4500010902` release *even with a valid human token* because `ThreeWayMatchStatus == 'VARIANCE_HOLD'` (`THREE_WAY_MATCH_FAILED`).
  55. 6. **Human-Approved + 3-Way-Matched Release (`ALLOWED`):** Releases PO `4500010901` (`MATCHED` + `APR-2026-DXB-8820`) and verifies cryptographic hash-chain integrity across all `6` audit entries.
  56. ---
  57. ## Measured Benchmarks
  58. | Workload | Native C++20 (`-O3 -std=c++20`) | Pure-Python Reference | Speedup |
  59. | --- | ---: | ---: | ---: |
  60. | `20,000`-row `BUKRS` RBAC filter + `$filter` security scan + `25,000`-entry SplitMix64 audit chain | **`0.101 ms`** | `6.783 ms` | **`67.03x`** |
  61. ---
  62. ## Scope Boundaries & Production Deployment Notes
  63. - **Deterministic Clean-Core Sandbox Out of the Box:** Ships with an in-memory multi-company (`1000` AED, `2000` SAR, `3000` GBP) SAP S/4HANA sandbox so CI, demos, and interviews run offline in `<1` second with zero SAP credentials required. Connecting to a live SAP BTP / S/4HANA Cloud OData v4 endpoint replaces the row-fetch adapter behind `ODataGuardrailGateway` while keeping the exact same pre-execution validation, `BUKRS` filtering, PII redaction, and audit chain.
  64. - **Subset OData v4 Grammar by Design:** Intentionally supports auditable Clean-Core predicates (`eq`, `ne`, `gt`, `ge`, `lt`, `le`, `and`, `or`, `not`, `startswith`, `endswith`, `contains`) and blocks `$batch`, `any()`/`all()` collection lambdas, and unbounded `$expand` trees to prevent ERP database DoS.
  65. ---
  66. ## Verification & CI Quality Gates
  67. ```bash
  68. uv run ruff format --check src tests
  69. uv run ruff check src tests
  70. uv run mypy src tests
  71. uv run pytest --cov=erp_odata_mcp --cov-report=term-missing --cov-fail-under=95
  72. cd ui && npm ci && npm run build
  73. ```
  74. ## Author & License
  75. Engineered by **Nagarjuna Kamireddy** ([Website](https://nagarjunak-pixel.github.io) · [GitHub](https://github.com/nagarjunak-pixel) · [LinkedIn](https://www.linkedin.com/in/nagarjuna-kamireddy)). Released under the [Apache-2.0 License](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.