Text-to-SQL that admits when it can't answer
An MCP server that wraps NVIDIA Auto Ontology's semantic layer so your assistant writes SQL against a reviewed ontology instead of guessing joins from raw schemas.

What it does
auto-ontology-mcp is a Python MCP server that does two jobs: it lets Claude, ChatGPT, Codex, Cursor and friends query your databases through a semantic layer, and it doubles as a personal knowledge base that ingests documents into typed tables, concept pages and a full-text index. The clever architectural move is that all the language work (reading, extracting, naming, writing SQL) is delegated to the model in your MCP client — no LLM endpoint to host, no API key. The server keeps only the deterministic parts: schema extraction, profiling, key inference, validation, storage and read-only SQL execution in local SQLite.
The interesting bit
The pitch is that text-to-SQL fails quietly: the query runs, a number comes back, and nothing says it’s wrong. So instead of hoping the model joins correctly, tools like validate_sql, check_answerable and find_join_path catch the classic blunders — joining on overlapping integers, filtering 'pennsylvania' against stored 'Pennsylvania', fan-out inflation from one-to-many joins — before execution. check_answerable even tells the model when a question (say, return on ad spend) simply isn’t covered by the data, so it says so instead of summing whatever revenue column it finds.
Key highlights
- Works with any MCP client over stdio or streamable HTTP; Python 3.12+, Apache-2.0.
- Knowledge base stores facts as typed records, ideas as linked concepts, passages in a full-text index — every record keeps its source and quote, with originals preserved in an Obsidian vault.
export_wikiwrites the whole ontology out as an Obsidian vault with[[links]]and graph view — an explicit alternative to Karpathy’s LLM Wiki pattern, but queryable with SQL.- Structured and unstructured data live in separate datasources, so the model can combine “what happened” (the database) with “why” (the documents) while keeping numbers and explanations apart.
- Ships a demo: a synthetic 11-table retail database with 3,200 orders plus three store documents, with questions that require both.
Caveats
- Terms and joins start as drafts the model created; the README itself warns answers built on them are “unreviewed” until a human reviews the relationships.
- Default role selection can be arbitrary — with no unqualified column name, Auto Ontology’s fallback picks the alphabetically first role, so which city column counts as “the customer’s city” can flip between scans.
Verdict
Worth a look if you use an MCP-capable assistant against real databases and are tired of quietly-wrong SQL, or if you want a knowledge base you can actually query rather than just read. Skip it if you don’t have an MCP client or your data already lives behind a well-governed semantic layer.
Frequently asked
- What is gogoymh/auto-ontology-mcp?
- An MCP server that wraps NVIDIA Auto Ontology's semantic layer so your assistant writes SQL against a reviewed ontology instead of guessing joins from raw schemas.
- Is auto-ontology-mcp open source?
- Yes — gogoymh/auto-ontology-mcp is open source, released under the Apache-2.0 license.
- What language is auto-ontology-mcp written in?
- gogoymh/auto-ontology-mcp is primarily written in Python.
- How popular is auto-ontology-mcp?
- gogoymh/auto-ontology-mcp has 521 stars on GitHub.
- Where can I find auto-ontology-mcp?
- gogoymh/auto-ontology-mcp is on GitHub at https://github.com/gogoymh/auto-ontology-mcp.