Runs on your machine from its package; the steps are below.

Not assessed yet.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted โ your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
uvx canonic
MCP client config
{
"mcpServers": {
"canonic": {
"command": "uvx",
"args": [
"canonic"
]
}
}
}The context layer that lets AI agents query your data correctly.
Point canonic at your database and it builds the context an agent needs to answer data questions accurately: definitions, relationships, business meaning, and the guardrails that stop confidently-wrong answers. It keeps that context up to date as your data changes, and it never touches your warehouse beyond reading it.
๐ Full documentation: https://docs.getcanonic.app
An AI agent connected straight to your warehouse sees tables and columns, not meaning. It doesn't know that revenue lives in orders.amount but excludes refunds, or that "active customer" has a specific definition your finance team agreed on. So it guesses. Schema access makes an agent fluent. It doesn't make it correct.
Real output, captured from a live run against the ecommerce example:
$ canonic sql "SELECT SUM(amount) FROM fct_orders"
โโโโโโโโโโโ
โ sum โ
โกโโโโโโโโโโฉ
โ 4050.50 โ
โโโโโโโโโโโ
This total includes two refunded orders ($260), a confident, well-formatted number that's off by 6.4%.
$ canonic --json query --metrics revenue
{
"result": { "rows": [["3790.50"]] },
"compiled": {
"sql": "SELECT SUM(\"orders\".\"amount\") AS \"total_revenue\" FROM \"fct_orders\" AS \"orders\" WHERE \"orders\".\"status\" <> 'refunded'"
},
"metadata": {
"guardrails_fired": [{ "id": "revenue-excludes-refunds", "kind": "mandatory_filter" }]
}
}
canonic resolves "revenue" to its canonical definition, compiles the guardrail into the SQL whether or not anyone asked for it, and returns the right number with the reasoning attached.
canonic is not a BI tool and not a chat interface: it's the layer that feeds the tools you already have (a BI dashboard, an agent, a notebook) correct, governed answers.
mandatory_filter, required_dimension, restrict_source and min_trust are part of the contract, so a documented caveat can't be silently skipped. Contracts and guardrailsvia, canonic doesn't guess. Compilertrusted, provisional, caution) with the reasons behind it. Assertions gate CI, and confirmed-wrong outcomes lower a metric's trust. Trust and assertionsambiguous_join_path, guardrail_block, ...) the agent can act on, never as a guess. Error codescanonic review, canonic apply), drift is flagged, and references to things that disappeared are proposed for removal. Ingestioncanonic audit and canonic status, and an accuracy harness (canonic assert, canonic eval baseline) turns "trustworthy" into something you can check. Instrumentation your sources canonic consumers
โโโโโโโโโโโโ โโโโโโโ โโโโโโโโโ
warehouse schema โ ingest โโโโโโโโโโโโโโโโโโโโโโโโโโโโ CLI (query, sql, review)
dbt / Ossie โโโโโโโโโโโถ โ semantics/ knowledge/ โ โโโถ MCP server
Looker, Metabase โ propose โ contracts/ (files in git)โ Claude Code, Cursor, Codex,
Notion, web docs โ โ review โโโโโโโโโโโโโโโโโโโโโโโโโโโโ any MCP client
A question takes one deterministic path: resolve the metric, compile SQL against the canonical definition, apply guardrails, run it read-only, attach the metadata band. No LLM is involved at answer time.
Real output (abridged) from canonic --json query --metrics gross_revenue in the saas-analytics example:
{
"result": { "columns": [{ "name": "gross_revenue", "type": "decimal" }], "rows": [["77071.00"]] },
"compiled": {
"sql": "SELECT SUM(\"fct_invoices\".\"amount\") AS \"gross_revenue\" FROM \"fct_invoices\" AS \"fct_invoices\" WHERE \"fct_invoices\".\"status\" <> 'refunded' AND \"fct_invoices\".\"is_trial\" = FALSE",
"dialect": "duckdb"
},
"metadata": {
"resolved": { "metrics": { "gross_revenue": "fct_invoices.total_amount" } },
"guardrails_fired": [
{ "id": "revenue-excludes-refunds", "kind": "mandatory_filter", "severity": "error" },
{ "id": "revenue-excludes-trials", "kind": "mandatory_filter", "severity": "error" }
],
"freshness": [{ "source": "fct_invoices", "stale": false }],
"trust_score": {
"tier": "provisional",
"reasons": ["gross_revenue: assertion unverified (pass/fail not yet persisted)"]
}
}
}
The agent sees which definition answered, which rules shaped the SQL, and why the number is only provisional, so it can caveat the answer instead of presenting it as settled.
canonic's context lives in three committed surfaces: plain files in your git repo, reviewed like code.
| Layer | File | Answers | Owned by |
|---|---|---|---|
| Semantics | semantics/**/*.yaml | "How do I query this safely?" | auto-maintained |
| Knowledge | knowledge/**/*.md | "What does this mean to the business?" | auto-maintained |
| Contracts | contracts/**/*.yaml | "Which definition is canonical, and what must the answer obey?" | human-owned |
Changes how the SQL runs โ semantics. A human needs it to trust the answer โ knowledge. Governs which definition is authoritative โ contracts. See Concepts: the three layers.
canonic needs Python 3.13 or newer (uv fetches it for you).
uvx canonic --version # try it without installing
uv tool install canonic # persistent, global command
pip install canonic # without uv
docker pull ghcr.io/mischuh/canonic:latest # CI, headless, air-gapped
The fastest path uses local connectors, no server, no network. Point at a SQLite .db or DuckDB .duckdb/CSV/Parquet file:
canonic setup

The wizard names your project, connects a source, optionally configures an LLM, drafts your semantics from the live schema, then runs a real query and shows the answer with its freshness and definition. A server-based database or an LLM provider needs a credential in an environment variable (or a file: reference) before you run canonic setup, because canonic never stores secrets in canonic.yaml directly.
You now have a working context layer committed to your repo:
canonic overview # what's askable
canonic query --metrics revenue --dimensions order_date # ask it
canonic review && canonic status # review what it drafted
Air-gapped install and offline wheels: Installation.
canonic exposes its tools over a local, on-demand MCP server, verified with Claude Code, Cursor, and Codex:
canonic mcp start
{
"mcpServers": {
"canonic": {
"command": "uvx",
"args": ["canonic", "mcp", "start", "--project", "/path/to/canonic/examples/rental", "--suggestions"]
}
}
}
GUI-launched clients (Claude Desktop, Cursor) don't source your shell profile, so pass connection credentials via the config's env field, not export.
See Connecting your agent for remote and enterprise deployment (--transport http, per-client bearer tokens) and the tools reference. To see masking, run_sql gating and tenancy scoping applied to a real identity, scripts/local_idp runs the marketplace example behind a local Keycloak: walkthrough.
examples/ ships seven ready-to-run projects, each with a guide:
| Example | Backend | Shows |
|---|---|---|
| jaffle-shop | DuckDB | dbt manifest with MetricFlow models as evidence |
| ecommerce | Postgres | the full loop: guardrails, finality, Notion and dbt evidence, observability |
| rental | SQLite | cross-fact fanout and a NULL-handling guardrail, no setup needed |
| saas-analytics | DuckDB | every metric binding kind, all guardrail kinds, finality, assertions |
| dutch-railway | DuckDB | a geography dimension chain and ratio metrics |
| marketplace | SQLite | tenant scoping, role-based access and column masking |
| ossie-retail | SQLite | context bootstrapped from an Apache Ossie model |
| coffeehouse | DuckDB | the same questions answered by dbt MetricFlow and canonic: count distinct, averages, guardrails |
uv sync # install with dev dependencies
uv run pytest tests/ -x # tests, including the golden suite
uv run ruff check . && uv run ruff format --check .
uv run mypy canonic/
canonic/ is the package (compiler, connectors, contracts, ingestion, knowledge, MCP server, trust, instrumentation), tests/ mirrors it, examples/ holds the sample projects.ConnectorFactory by capability (introspect_schema, run_read_only_sql, extract_definitions, extract_evidence), and short-lived credentials plug in through the CredentialProviderRegistry.contract_info MCP tool, CONTRACT_CHANGELOG.md), and tests/golden/ locks compiled SQL and executed numbers for the examples.canonic.yaml config schema.Business Source License 1.1. Free for non-commercial, personal, evaluation, educational and developmental use. Commercial use needs a separate license. The licensed version converts to Apache 2.0 on July 17, 2030.