Originally published at naditu.com/blog/mcp-gateway-vs-enterprise-ai-ontology-for-erp-data.
Platform and security teams rolling out Model Context Protocol (MCP) infrastructure routinely deploy LLM proxies and MCP gateways—such as LiteLLM, Kong AI Gateway, Cloudflare AI Gateway, or container-based MCP routers—expecting them to govern operational database access end to end.
Six weeks later, the security review stalls. Why? Because an MCP gateway only sees JSON-RPC envelopes and tool names, while the downstream SQL or OData server still executes raw queries against unmapped ERP tables under a single shared technical service account.
Just as Envoy or Kong never replaced your database schema or application domain model, an MCP gateway does not teach an AI agent how your ERP, CRM, and plant MES tables fit together.
What an MCP Gateway Actually Governs vs. Where It Stops
| Layer & Responsibility | MCP Gateway / LLM Proxy | Enterprise AI Ontology |
|---|---|---|
| TLS, OAuth 2.1 / CIMD & SSRF edge checks | Yes (terminates auth & rate-limits clients) | Receives verified caller identity from gateway or IdP |
| Token spend caps & model routing | Yes (per-key budgets & provider failover) | Model-agnostic (serves Claude, ChatGPT, Cursor, custom agents) |
| Coarse tool-list filtering | Hides/exposes whole MCP tools (search_orders) | Evaluates row & column permissions inside each query |
| Cross-system joins without foreign keys | Blind to table schemas | Resolves confirmed joins across ERP, CRM, and MES (account.erp_code = CUST.CODE) |
| 1:N chasm-trap & status-code semantics | Blind to SQL semantics | Isolates header/line grain & maps local codes (ORD_HDR.STAT = 4 → shipped, not invoiced) |
| Field-level cost & PII masking | Cannot rewrite SQL join projections | Masks restricted fields (unit_cost: "masked") per Okta / Entra ID group |
| Operational ERP write safety | Sees a valid HTTP POST | Blocks raw SQL writes; routes approved mutations via official ERP APIs |
Four ERP Failures an MCP Gateway Cannot Catch
- Service-account privilege flattening: Even when the gateway authenticates the caller, generic SQL or OData MCP containers typically connect to SAP, SQL Server, PostgreSQL, or Oracle through one static pool user—exposing global territories, supplier rebates, and unit manufacturing costs unless row/column RBAC is enforced in the data layer.
- Undeclared cross-table and cross-system joins: Physical ERP schemas split reality across fiscal-period table prefixes (
LG_001_01_ORFLINE), header/status tables (VBAK/VBUK), variant matrices, and separate CRM or MES databases with zero declared foreign keys. - Cryptic numeric status codes: No HTTP header tells an LLM that
STAT = 4means shipped, awaiting invoice rather than cancelled, or thatCONTRACTin IFS Cloud denotes a plant site rather than a customer contract. - Unsafe mutations disguised as valid tool calls: A syntactically valid JSON tool call still bypasses e-Invoice lock states, lot reservations, and human purchasing sign-off unless gated by domain rules.
Pairing Both Layers in One Reference Stack
You do not need to rip out LiteLLM, Kong, or a Kubernetes MCP gateway to adopt an ontology—the two layers are complementary:
- Keep transport controls at the MCP gateway: Let your gateway terminate TLS, validate OAuth 2.1 / CIMD metadata fetches, enforce token budgets, and propagate W3C OpenTelemetry traces.
- Register the ontology as your single governed operational MCP endpoint: Instead of wiring twenty raw database containers to the gateway, run an on-premises Enterprise AI Ontology in front of SAP S/4HANA, Dynamics 365, NetSuite, Odoo, Logo Tiger, Nebim V3, and plant MES databases—so every assistant and scheduled agent inherits verified joins, business definitions, field masks, and SIEM audit logs.
(For a vendor-neutral 9-row capability matrix and reference topology, see the open CC BY 4.0 handbook guide at ontoloji.org/en/guides/mcp-gateway-vs-enterprise-ai-ontology-architecture—also queryable directly from Claude Code or Cursor via the public MCP endpoint https://ontoloji.org/mcp.)
