Home / Docs / APIs, SDKs & Ontology MCP

Developer toolchain

APIs, SDKs & Ontology MCP

Treat the ontology as a typed operational backend—serving web apps via OpenAPI/SDKs and powering external AI agents through governed Model Context Protocol (MCP) tools.

The Ontology as a governed "tool factory"

Hand-wiring bespoke database prompts for every AI agent creates brittle glue and bypasses access controls. When you derive typed SDK clients and MCP tool definitions directly from your ontology classes, queries and SHACL action shapes, both human interfaces and autonomous agents inherit the exact same schema and policy gates.

Separating consumption MCP from authoring MCP

MCP Pattern Actor Allowed Operations Guardrail
Ontology MCP (Runtime) Operational AI agents, copilots, support workflows Read typed objects, traverse links, run approved SPARQL templates, propose SHACL-gated actions Least-privilege tool allowlist, OAuth/RBAC scope, SHACL pre-commit validation
Authoring MCP (Build-Time) Engineers & coding agents in local IDEs Scaffold OWL modules, generate SHACL tests, run reasoners & R2RML mapping checks Git branch isolation, CI reasoner + pySHACL suite, human PR sign-off

Example: Governed MCP tool contract

Every tool exposed to an agent declares strict JSON Schema inputs mapped to ontology IRIs and executes through the same SHACL gate shown in the live sandbox:

{
  "name": "ontology.execute_action",
  "description": "Propose a SHACL-validated state transition on a MaintainableAsset.",
  "inputSchema": {
    "type": "object",
    "required": ["action", "target_iri", "evidence_iri"],
    "properties": {
      "action": { "type": "string", "enum": ["ta:ApproveRelease", "ta:ScheduleInspection"] },
      "target_iri": { "type": "string", "pattern": "^ta:asset/[a-z0-9-]+$" },
      "evidence_iri": { "type": "string", "pattern": "^ta:process/[a-z0-9-]+$" }
    },
    "additionalProperties": false
  }
}

Example: Typed Python client call

from axiomata_client import OntologyClient

client = OntologyClient(endpoint="https://graph.internal/sparql", auth="oidc")

# 1. Read verified object & linked evidence
asset = client.objects.get("ta:asset/turbine-04", include=["ta:verifiedBy"])

# 2. Execute SHACL-gated action (fails closed on missing evidence)
receipt = client.actions.execute(
    action="ta:ApproveRelease",
    target=asset.iri,
    evidence=asset.links["ta:verifiedBy"][0].iri,
)
assert receipt.shacl_conforms is True

Security first: Before connecting any local or enterprise agent to operational tools, review the 20-point Local AI Agent Security Checklist or explore Local AI Agents and Automation.