Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

MCP, HTTP, SQL: Three-Layer Stack Turning OntoL Ontology into Standard AI Agent Tools

The article presents a three-layer architecture — SQL for storage, HTTP for traditional systems, MCP for AI Agents — that maps OntoL ontology capabilities to MCP primitives (Tools, Resources, Prompts) while centralizing governance, permissions, auditing, and stateless design in the OntoL kernel, enabling one ontology build to serve both business systems and AI agents.

MCP, HTTP, SQL: Separate Concerns, Unified Kernel

The integration challenge: multiple Agent platforms (Claude, ChatGPT, WorkBuddy, DeepSeek Harness) each wanting access to OntoL ontology. Building a custom adapter per platform would be N×M effort. The solution is a three-layer architecture:

SQL layer — native graph storage dialect or translated OntologyL_Cypher /natural-language queries executed as SQL; handles data access, bulk stats, complex filters, transactions.

HTTP layer — REST/GraphQL endpoints for business systems, low-code platforms, custom apps; the familiar enterprise integration channel.

MCP layer — Model Context Protocol server exposing ontology as standardized Tools, Resources, Prompts; reduces integration to N+M (one MCP implementation, all MCP-compatible Agents connect).

These layers are not alternatives; they converge on the same OntoL kernel, governance rules, permission model, and audit trail.

Mapping OntoL Capabilities to MCP Primitives

Tools (executable operations)

Write operations : create repair ticket, approve device scrap, add entity relations. Packaged as MCP Tools and HTTP endpoints; parameter validation passes, then translated to transactional SQL writes.

Query/inference operations : natural language → OntologyL_Cypher, graph path queries, rule inference. Exposed as read-only MCP Tools and HTTP query interfaces; query plan becomes SQL execution, returning structured ontology results.

Critical constraint: query Tools are strictly read-only, isolated from mutating Tools in permissions, transactions, and SQL execution paths.

Resources (readable knowledge assets)

Static, pre-loadable assets: Object Type schema, business rule documents, classification dictionaries, metric definitions. Served as MCP Resources for Agent pre-loading; also available via HTTP metadata endpoints; backed by SQL reads of metadata tables and static knowledge base.

Prompts (pre-defined task templates)

High-frequency fixed tasks: counterparty risk screening, BOM consistency check, ECN change impact analysis, supply-chain path exploration reports. Registered as MCP Prompts; Agents fetch template, fill ontology parameters. HTTP also offers template rendering. Internally, templates orchestrate calls to Tools and Resources, auto-generate queries, execute SQL, assemble output.

Governance Lives in the Kernel, Not the Channels

MCP standardizes call envelopes, tool descriptions, parameter passing. HTTP standardizes routing, status codes, serialization. SQL standardizes data syntax. None carry business governance. All of the following are implemented once in the OntoL kernel:

Permission checks, attribute-level authorization, row/field-level permissions

Business rule interception, change risk controls

Same operation — whether invoked via MCP by an Agent, via HTTP by a business system, or via direct SQL by an admin — must traverse the identical validation chain. No channel gets relaxed rules. The SQL layer itself enforces anti-escalation, anti-full-scan, and blocks direct modification of core entities bypassing the ontology model.

Unified Identity & Permission Mapping

Remote MCP uses OAuth 2.1 for client and user identity.

HTTP supports OAuth, token, internal SSO.

SQL connections use internal service pools, never exposed externally.

After identification, all authorization delegates to OntoL's ABAC engine. A principal arriving through MCP or HTTP sees exactly the same accessible entities, callable Actions, readable fields. MCP OAuth identities and HTTP login identities map into the same OntoL subject model, preventing multiple permission models and inconsistencies.

Unified Audit Trail Across All Channels

MCP lacks a standard audit log spec; HTTP access logs and database slow-query logs are fragmented. Solution: every entry point (MCP tool call, HTTP API call, kernel-triggered SQL change) is instrumented at the OntoL kernel aspect. Logged fields: caller, identity, input parameters, operation type, affected ontology entities, execution result, latency, underlying SQL fingerprint. Agent-driven reasoning and operations merge with Web and API operations into a single traceable ontology operation timeline, satisfying compliance, root-cause analysis, and impact analysis.

Stateless Design Aligned with MCP Evolution

MCP is evolving toward statelessness, weakening long sessions and requiring full context per request. Implications for the three-layer stack:

Do not rely on MCP server to store multi-turn reasoning intermediate state.

Agent multi-turn exploration (e.g., first query material lineage, then associated supplier risk) carries context and previous result summaries in request parameters.

Ontology service itself becomes stateless — queries, inference, Actions horizontally scalable.

SQL query design adapts: avoid session-level temp tables and session variables; use context IDs passed as parameters and off-heap temporary result sets.

This statelessness also benefits the HTTP layer (naturally stateless), aligning the whole OntoL service cluster with load balancing and failover simplicity.

Summary

MCP connects the AI Agent ecosystem, HTTP connects traditional business systems, SQL powers the ontology graph storage and computation. All three share one OntoL kernel, one permission model, one audit trail, one set of business rules. Wrapping OntoL as an MCP Server while retaining mature HTTP integration and controlled SQL capability delivers: one ontology capability investment serving business systems, developers, and diverse Agents. The key is not merely connecting the ontology to MCP, but holding the line: access protocols may vary, but the ontology's governance boundaries, permission model, audit provenance, and read/write isolation never change across channels.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

architectureSQLMCPHTTPAI AgentgovernanceontologyOntoL

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion