Auto Ontology MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| AUTO_ONTOLOGY_HOME | No | Where the ontology store, the knowledge store (knowledge.sqlite) and the demo database live | ~/.auto-ontology-mcp |
| AUTO_ONTOLOGY_STORE | No | Ontology store file | $AUTO_ONTOLOGY_HOME/ontology.db |
| AUTO_ONTOLOGY_MAX_ROWS | No | Maximum number of rows returned by run_sql | 30 |
| AUTO_ONTOLOGY_MCP_HOST | No | Host address for HTTP transport | 127.0.0.1 |
| AUTO_ONTOLOGY_MCP_PORT | No | Port for HTTP transport | 8765 |
| AUTO_ONTOLOGY_MCP_TOKEN | No | Token required for HTTP transport authentication | |
| AUTO_ONTOLOGY_PROFILE_ROWS | No | Number of rows sampled per table to estimate profiling statistics | 1000 |
| AUTO_ONTOLOGY_QUERY_TIMEOUT | No | Maximum time in seconds for query execution | 30 |
| AUTO_ONTOLOGY_ALLOW_DATASOURCE_TOOLS | No | Whether to expose add_datasource and scan_datasource tools | 1 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Auto Ontology MCP gives you (the model) a semantic layer over relational databases: business Terms mapped to columns, reviewed SQL attributes (measures, filters, joins) and verified relationships between tables. The server does the deterministic work (schema extraction, profiling, key inference, validation, read-only execution). You do the language work that NVIDIA Auto Ontology normally sends to its own LLM.
Answering a data question (always in this order):
check_readiness: is there a modeled datasource that can execute SQL?
check_answerable(question, entities): extract the entity phrases yourself, see which the ontology covers. If something material is not covered, say so and ask; do not guess.
get_query_context(terms): columns, sample values, SQL attributes, the join path and verified example queries for the Terms you will use.
lookup_values for any literal filter (names, statuses, places) you are not sure about.
Write the SQL yourself in the datasource dialect, using the join path and SQL attributes.
validate_sql with the user's question, fix every error, take warnings seriously (fan-out, near-miss literals, unverified joins, percent-vs-fraction).
run_sql with the user's question. Check the rows against the question before you answer, show the SQL, and mention truncation and any uncertified (draft) Terms you relied on.
If the user confirms the answer is right, save_example_query so the next answer reuses it.
Building an ontology: add_datasource → scan_datasource → get_modeling_worklist / save_table_terms until no tables remain → list_relationships / set_relationship to review proposed joins → suggest_sql_attributes / save_sql_attribute → certify what a person approved with update_term(status="certified"). After a schema change, scan_datasource again: Terms and reviewed joins are kept, and get_modeling_worklist returns new tables and modeled tables that gained columns (send their current_terms back with the new columns placed).
Keeping personal knowledge (datasource "knowledge", created on first use): when the user shares documents, images, notes or facts to remember, read them yourself and store what they contain. search_ontology first and reuse existing Terms instead of creating near-duplicates. Facts you would count, sum, filter or compare go into entities (define_entity, then add_records with a source); explanations, ideas and definitions go into concepts (save_concept) linked by typed relations. Documents (articles, papers, meeting notes) keep their full text as the original in the Obsidian vault (source.original for a note already there, original_text or original_file to save one); the store keeps their summaries and excerpts as passages (save_passages), each with its heading or locator and the Terms it is about. When a document changes, save its source again (same uri or id) with the new original_text or original_file, which becomes a new note while the old one stays, then save_passages(replace=true) with every passage of the new version and check get_source for records and concepts that came from it. Every record, concept and passage should name its source. Ask before deleting anything. list_terms is the index and recent_changes the log. For "what is X / what do I know about X", answer from get_term (definition, body, relations, sources) and search_text (passages); for totals, counts and comparisons, use SQL as for any datasource. SQL also reads the concept graph and the text: terms, term_relations (walk chains with WITH RECURSIVE), term_sources, passages, passage_terms, and the full-text indexes passages_fts, terms_fts and sources_fts (MATCH '"word"*', ORDER BY bm25(...)), so one query can combine a text search with relations and records. Cite sources (get_source, or join _source_id = sources.id) and give the [[link]] to the original. When an answer is worth keeping, file it back: append it to a concept's body or save_example_query. export_wiki writes the store as Obsidian pages next to the originals.
Search is lexical, not semantic. Search with the words the schema uses; if the user writes in another language, translate entity phrases to the ontology's language first, and try synonyms. Add the user's own words as Term synonyms with update_term so the next search finds them; when a reply carries learn.candidates, that is the update_term call (a column's words go in column_updates).
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_readinessA | Inspect every registered datasource and the personal knowledge store to report SQL connectivity, modeling coverage (Terms, relationships, SQL attributes), record counts, and recommended next steps. Call at the start of a session or after unexpected failures; use list_terms or describe_table to inspect specific ontology objects instead. Opens registered databases read-only and returns per-datasource status summaries. |
| add_datasourceA | Register a relational database by SQLAlchemy URL, verify read-only connectivity, and optionally scan its schema. Use only when the user supplies a URL; never invent credentials, and use scan_datasource instead to re-read an already registered database. Connections are strictly read-only and never modify the target database. Reusing an existing name updates its URL and saved filter while preserving modeled Terms; fails with the connection or driver error if unreachable. |
| scan_datasourceA | Re-read a registered database's tables, columns, declared keys, column profiles (samples, uniqueness, formats, small value sets), and name-inferred joins verified by value containment. Use after schema changes or to refresh stale profiles; use add_datasource for new databases and get_modeling_worklist to inspect unmodeled tables afterwards. Connects read-only to the database, preserves existing Terms, reviewed relationships, and SQL attributes, refreshes unreviewed inferred joins, and returns counts of newly discovered tables and columns. |
| get_modeling_worklistA | Fetch the next batch of unmodeled database tables (or modeled tables with newly scanned columns), including candidate column profiles, foreign keys, linked Terms, and modeling rules. Use while building an ontology over a SQL database, paired with save_table_terms until remaining is 0; use define_entity for personal knowledge entities and describe_table to inspect one table without modeling rules. Returns tables, remaining count, and current_terms for tables with new columns. |
| save_table_termsA | Save business Terms and column mappings for one scanned database table. Use for tables returned by get_modeling_worklist; use update_term to tweak a single existing Term, define_entity for knowledge store tables, and save_concept for prose definitions. Replaces the table's previous Terms (same-named Terms update; unreferenced Terms without SQL attributes are removed; unassigned candidate columns attach to the first Term). Validates atomically so unknown columns, duplicates, or cross-table name clashes save nothing and return every error. New Terms start as draft. |
| list_relationshipsA | List table join relationships with their evidence (declared FK, inferred name/containment scores, or manual), plus multi-role joins, unlinked identifier columns, and ad-hoc query joins not yet recorded. Use to audit the join graph before or during modeling and act with set_relationship; use find_join_path to get the shortest join route between two Terms. Returns grouped relationships, role notes, and review rules. |
| set_relationshipA | Modify one join relationship between two table columns: accept or reject a proposed join, add a missing one, update its role/description/default flag, or delete it permanently. Use after reviewing joins in list_relationships; use find_join_path to inspect active routes instead. Identify the join by relationship_id or by source and target ('table.column'). Only accepted joins enter join paths and survive re-scans; action='delete' removes the record permanently while 'reject' preserves the negative decision. Fails if the columns or relationship do not exist. |
| suggest_sql_attributesA | Mine candidate reusable SQL attributes (measures, filters, dimensions, and join patterns) from executed queries, verified examples, bridge tables, and column profiles, alongside promotion rules. Use after Terms are modeled and persist worthwhile candidates with save_sql_attribute; use get_term to inspect attributes already saved on a Term. Returns candidates and a more_available count. |
| save_sql_attributeA | Create, update, certify, or permanently delete a named SQL expression attached to a Term. Use to persist candidates from suggest_sql_attributes or reusable business metrics; use save_example_query for full question-and-SQL pairs and update_term for Term definitions. Probes the expression read-only against the database before saving and rejects broken SQL without saving. Editing a certified attribute's expression resets it to draft; delete=true removes it permanently. |
| update_termA | Edit metadata, synonyms, column labels, or approval status of one existing Term, or delete it permanently. Use for targeted edits after modeling or to add user synonyms; use save_table_terms to remodel all Terms on a table, save_concept for concept markdown bodies and typed relations, save_glossary for abbreviations, and define_entity(delete=true) to drop knowledge entities. Editing a certified Term's name or description resets it to draft unless status is also passed; delete=true permanently removes the Term, its mappings, SQL attributes, and relations. |
| save_glossaryA | Create, update, or permanently delete glossary entries mapping abbreviations and internal jargon (e.g. MRR to monthly recurring revenue) in either one datasource or global scope. Use for shorthand expansions that feed search_ontology and get_query_context; use update_term or save_table_terms for column-backed business Terms and save_concept for longer explanations. Same-named entries upsert in place; names passed in delete are permanently removed from the chosen scope. |
| define_entityA | Create, extend, or delete a table-backed entity in the personal knowledge store (a Term with typed columns). Use for countable or filterable facts; search first with search_ontology or list_terms to reuse existing entities. Use save_concept for prose definitions and save_table_terms for external SQL databases. Adds new columns without altering existing column types; keys enable upsert in add_records. Pass delete=true to drop the entity (requires force=true if rows exist, permanently deleting all records). Returns the entity schema and table metadata. |
| add_recordsA | Insert or upsert structured records into an existing knowledge entity with source provenance, locators, and supporting quotes. Use after define_entity for countable facts; use edit_records to update or delete existing rows by id, save_concept for prose explanations, and save_passages for searchable document excerpts. Validates the entire batch atomically (normalizing currency/dates and resolving refs) so any invalid record aborts the write and returns all errors. Returns inserted, updated, and skipped ids. |
| edit_recordsA | Update specific fields or permanently delete existing knowledge entity records by integer id. Use after locating row ids with run_sql or get_source; use add_records to insert or upsert new rows and define_entity to alter columns or drop the whole entity. action='update' modifies only the supplied columns and provenance fields; action='delete' is permanent, requires user confirmation, and fails if other records reference any target row. |
| save_conceptA | Create or update a concept Term with a one-sentence definition, markdown wiki body, typed relations, and source provenance. Use for ideas, frameworks, or documenting existing entity Terms; use define_entity and add_records for countable facts, save_passages for document excerpts, and update_term(delete=true) to delete a Term. body replaces existing prose while append_body adds to it; missing relation targets are created as empty stub concepts. Editing a certified concept resets its status to draft. |
| save_passagesA | Store, update, replace, or delete searchable excerpts and section summaries for one source document, linked to Terms and an Obsidian vault original. Use for articles, papers, books, or notes you want searchable via search_text; use add_records for structured facts and save_concept for concept definitions. Identical text from the same source updates in place; replace=true requires source and passages and permanently prunes stale passages; delete_ids permanently removes specified passages. Returns inserted, updated, unchanged, deleted ids, and any stub concepts created. |
| search_textA | Run BM25 full-text, compound-substring, and optional local hybrid vector search across knowledge store passages, Term bodies, and sources. Use when searching inside stored prose or quotes; use search_ontology to search structured schema catalogs across any datasource, and get_source to inspect everything from one source. Strips Korean particles, falls back to any-word matching, and fuses local embeddings via RRF when the semantic extra is installed. Returns ranked snippets, Obsidian [[links]], fts_query, and a SQL example. |
| get_sourceA | Retrieve one knowledge source by id or title substring together with its Obsidian original path and every item derived from it (entity records, concepts, relations, and passages). Use to cite provenance or audit what a document contributed; use search_text to find sources by content and describe_table for physical database tables. Fails if no source matches or multiple titles match ambiguously. |
| list_termsA | List a paginated index of every Term (entities and concepts) in one datasource with one-line definitions, status, synonyms, record/relation counts, and empty-stub flags. Use to browse the catalog or check existing Terms before creating new ones; use search_ontology for keyword search and get_term for one Term's complete details. Returns total count, offset, and paged term summaries. |
| recent_changesA | Return the newest changelog entries across all datasources and the personal knowledge store, recording Terms, records, concepts, relationships, passages, and SQL attributes added, updated, certified, or deleted. Use to review recent session activity or answer 'what changed lately'; use check_readiness for current aggregate counts and get_term for a Term's current state. Returns up to limit entries ordered newest first with timestamps and action details. |
| export_wikiA | Generate an Obsidian-compatible markdown vault for one datasource (defaulting to the knowledge store): one page per Term with synonym aliases, [[links]], and passages, one per source, plus index.md and log.md. Use to browse or inspect the knowledge graph in Obsidian; use export_ontology to serialize the semantic layer as a single portable YAML/JSON file. Writes into AUTO_ONTOLOGY_VAULT/auto-ontology (or ~/.auto-ontology-mcp/wiki/), prunes only previously generated pages, never alters originals, and is strictly one-way (Obsidian edits are not read back). |
| search_ontologyA | Search one datasource's ontology catalog across Terms, mapped columns, SQL attributes, glossary entries, verified examples, sources, unmodeled tables, and (in the knowledge store) record values and top full-text hits. Use as the primary discovery tool when you do not know exact names; use list_terms to browse all Terms, get_term for one known Term, search_text for deep knowledge-store prose search, and search only for ChatGPT connector IDs. Uses lexical scoring by default and blends local embeddings when the semantic extra is installed. |
| get_termA | Retrieve complete business and schema details for one Term: definition, status, synonyms, markdown body, mapped columns with sample values/formats, SQL attributes, join conditions, typed relations, sources, and knowledge record counts. Use to explain 'what is X' or inspect one known Term; use search_ontology when the Term name is unknown, list_terms to browse all Terms, describe_table for raw physical columns, and get_query_context when gathering multi-Term SQL context. Fails with closest Term suggestions if unmatched. |
| describe_tableA | Inspect one physical table's complete catalog metadata: all columns (including unmapped ones), keys, junction flag, attached Terms and attributes, join relationships, and SQL attributes. Use to verify raw table structure or unmapped columns; use get_term for business meaning, get_query_context for multi-Term SQL generation, and get_source for knowledge provenance. Fails with closest table name suggestions if the table does not exist. |
| find_join_pathA | Compute the shortest chain of accepted relationships between two Terms or tables, returning ON conditions, a ready FROM/JOIN clause, fan-out warnings, shared-parent caveats, and alternative join roles (e.g. billing vs delivery city). Use when checking one specific pairwise join; use get_query_context to assemble columns, attributes, and joins for a full multi-Term query, and list_relationships to review unapproved joins. Returns found=false when no accepted path connects them. |
| check_answerableA | Evaluate before writing SQL whether the ontology covers every entity in a user question, returning per-entity coverage (covered, covered_by_value, weak, or not_covered), an overall verdict, and next steps. Call first in the answering workflow and then call get_query_context for covered Terms; do not substitute uncovered metrics. Use search_ontology for ad-hoc exploration instead of question coverage checks. |
| get_query_contextA | Assemble everything needed to write SQL for a set of Terms: qualified tables, mapped columns with sample values/formats, SQL attributes, the connecting join path (with FROM/JOIN SQL and role notes), verified example queries, glossary entries, and dialect rules. Call after check_answerable instead of calling get_term, describe_table, and find_join_path separately; use lookup_values next for exact filter literals. Lists unknown inputs under unresolved with suggestions, and fails if zero Terms resolve. |
| lookup_valuesA | Query live distinct values stored in one column ('table.column') to ground exact literal filters (places, products, statuses) before writing SQL. Use after get_query_context whenever a WHERE filter value is uncertain; use search_ontology to find which table or column holds a concept. Returns matching values with row counts, close spelling suggestions when contains matches nothing, or top values when contains is omitted. |
| validate_sqlA | Validate a single SELECT query without returning rows: enforces the read-only guard, checks table/column names, verifies joins and default roles, flags near-miss literals, percent-vs-fraction scale mismatches, and one-to-many fan-out under aggregations, and runs a database dry run. Always call before run_sql and pass question when percentages appear; use run_sql only after fixing every reported error. Returns ok, errors, warnings, and the draft/certified status of relied-on Terms. |
| run_sqlA | Execute one read-only SELECT query against a registered datasource and return columns, rows, row_count, truncated flag, relied-on Terms (with draft/certified status), and warnings. Call after validate_sql passes; use lookup_values to inspect single-column values instead. Refuses writes, DDL, multiple statements, and uncataloged tables on a read-only connection, and logs the query with question for provenance. |
| save_example_queryA | Store a user-confirmed question and SQL pair so get_query_context surfaces it for similar future questions and suggest_sql_attributes can mine reusable logic from it. Call only after the user confirms an answer is correct; use save_sql_attribute for standalone reusable expressions instead. Validates the SQL against the ontology and database first (saving nothing if validation fails); saving the same question again updates its SQL in place. |
| export_ontologyA | Serialize one datasource's entire semantic layer as a single YAML or JSON document containing tables, relationships, Terms with column mappings, SQL attributes, concepts, typed relations, glossary entries, and example queries. Use for backup, review, version control, or migrating via import_ontology; use export_wiki to render Obsidian markdown pages instead. Does not include structured record rows from the knowledge store. |
| import_ontologyA | Import a YAML or JSON semantic layer document produced by export_ontology into an already scanned datasource, matching tables and columns by name. Prerequisite: register and scan the target datasource first with add_datasource or scan_datasource; use save_table_terms or update_term for incremental single-table edits. Upserts same-named items and replaces each imported table's Terms as in save_table_terms; items with missing tables, columns, or invalid SQL are skipped and listed (partial apply). Recreates missing knowledge entities empty without importing record rows. |
| searchA | Search Terms, tables, and sources across all datasources and return compact {id, title, url} connector records for follow-up with fetch. Intended exclusively for ChatGPT connectors and deep-research clients that require the search/fetch pair; all other MCP clients should use search_ontology (catalog search) or search_text (knowledge-store full-text search) instead. Returns a results list with opaque document ids. |
| fetchA | Retrieve the full text and metadata of one ontology document (a Term, physical table, or knowledge source) using an opaque id returned by search. Intended exclusively as the second step for ChatGPT connectors and deep-research clients; all other MCP clients should call get_term, describe_table, or get_source directly for structured JSON. Fails if the id is unknown or malformed. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| build_ontology | Walk through modeling a datasource end to end. |
| answer_question | Answer a data question through the ontology. |
| remember | Store what I shared (files, images, notes) in the knowledge store. |
| review_ontology | Find gaps and risks in the current ontology. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| guide | How to use this server. |
TDQS
Scored across 35 tools
Tools generally target distinct ontology artifacts and actions, and descriptions explicitly cross-reference alternatives. However, several clusters still require careful reading: search vs search_ontology vs search_text, and save_table_terms vs update_term vs save_concept vs define_entity.
Most tools follow a predictable verb_noun snake_case pattern (e.g. list_terms, save_concept, get_query_context, validate_sql). Minor deviations like recent_changes (noun phrase), search/fetch (generic verbs), and the mix of save_* and define_entity slightly reduce consistency.
35 tools is well above the typical well-scoped range for an MCP server, even given the complex ontology/knowledge/query domain. While many tools earn their place, the surface is heavy and increases selection burden; consolidation of search, export/import, and save variants could help.
The surface covers datasource scanning, modeling, relationships, SQL attributes, glossary, knowledge entities/records/concepts/passages, search, query validation/execution, provenance, changelog, and import/export. Minor gaps exist around datasource lifecycle, such as no explicit remove_datasource or list_datasources tool and no standalone source deletion.