← Back to Blog

The Ontology is the Source of Truth

By Zain • January 27, 2024

In ont-run, everything flows from a single configuration file: ontology.config.ts. Define your functions, access controls, and schemas once — and the framework generates everything else automatically.

Define Once, Generate Many

Your ontology.config.ts file is the single source of truth. It defines:

  • Functions — what your application can do
  • Schemas — the shape of inputs and outputs (using Zod)
  • Access controls — who can call each function
  • UI flags — which functions get interactive visualizers

Here's the architecture at a glance:

ont-run architecture diagram

Automatic REST API

Every function in your ontology becomes a REST endpoint at POST /api/{functionName}. No routing code to write, no controllers to maintain. The API respects your access controls and validates inputs against your Zod schemas.

Automatic MCP Server

The same ontology generates MCP (Model Context Protocol) tools that AI agents can use. Claude, and other MCP-compatible assistants, can call your functions directly. The tool descriptions, parameter schemas, and access controls all come from your ontology definition.

The Frontend

ont-run includes a built-in frontend that calls your API endpoints. You can customize the HTML, CSS, and JavaScript in the public/ directory, or replace it entirely with your own frontend framework.

MCP Apps

Functions with ui: true in your ontology get interactive visualizers. These render directly inside Claude on the web and other MCP hosts, letting users interact with your application without leaving their AI assistant.

The Lockfile

The ont.lock file captures a snapshot of your ontology. It's used for enforcement and ensures consistency between what you defined and what's running in production.


This architecture means you spend less time on boilerplate and more time on what matters: the logic of your application. Define it once, and let ont-run handle the rest.