ktx CLI
A context layer for data agents: semantic layer, company wiki and MCP so the agent writes correct warehouse queries
- 1,625 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Connects to databases with credentials
- Sends schema and samples to the LLM provider
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/ktxDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Connects to databases with credentials
- Sends schema and samples to the LLM provider
This is third-party code. Review the repository files before installing.
What it does
ktx studies your warehouse: samples tables, captures metadata and query patterns, and detects joinable columns. From dbt, MetricFlow, LookML, Looker, Metabase, Sigma, Notion and Google Drive it builds a semantic layer with approved metrics and a local wiki, flagging contradictions for human review. The agent reaches it through CLI and MCP with full-text and semantic search and fetches metrics declaratively instead of rewriting SQL. It runs locally and read-only.
Who it is for. For analysts and data engineers who want agents to compute metrics by approved definitions.
Good fit when
- An agent in Claude Code or Codex must answer questions from warehouse data
- Metric knowledge is scattered across dbt, Looker and wikis
- The agent re-explores the schema every time and mixes up metric definitions
Not a fit when
- You have no SQL warehouse
- You need a single ad-hoc query; psql or a notebook will do
Example request
What was revenue by region last quarter using the approved revenue metric?Limitations
Needs an LLM provider key (Anthropic, Vertex AI, AI Gateway) or local Claude Code or Codex sign-in, plus an embeddings model. Schema and samples go to the chosen LLM provider. Initial context ingest can take a long time. The Anthropic API is not reachable from Russia without a VPN.
How to disable. Stop the ktx MCP server, remove the integration from agent settings and run npm uninstall -g @kaelio/ktx.
FAQ
Does ktx send schema or results to a hosted service?
No, it runs locally. Only what goes to your configured LLM provider leaves the machine.
Which databases are supported?
PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, SQLite, DuckDB, Amazon Athena and MongoDB.
Discussion
No questions or reviews yet.
Related
CLI toolsdbt MCP
dbt-mcp
The official MCP server from dbt Labs: the Semantic Layer, project metadata, dbt commands and SQL against the warehouse from an agent
A desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use
dbt Charts
dbt-charts
Declarative YAML on top of SQL for dashboards: you describe how to show data, agents write YAML, people audit. The dbt-charts package and the dct CLI, beta
Official Tableau MCP server: the agent finds data sources, sends queries to them and opens dashboards and Pulse metrics
A CLI and MCP server that extracts structured knowledge from documents: graphs, hypergraphs, and fact search with sources
A Python library for typed, versioned datasets over S3, GCS, and Azure, with a datachain skill install command that teaches Claude Code, Cursor, and Codex your
README in short
The README explains why agents fail at data tasks and compares ktx with a plain agent and a classic semantic layer. Quick start is a global npm install, ktx setup and ktx status, or letting the agent install it via the skill. It lists core commands and project layout: ktx.yaml, semantic-layer, wiki and a local .ktx folder for secrets. Apache-2.0 licensed.
README badge
Original SKILL.md
--- name: ktx description: Installs and configures ktx, the open-source context layer for data agents — runs ktx setup non-interactively with hidden CLI flags, configures database connections and embeddings, installs agent integration, and verifies readiness. Use when the user asks an agent to add ktx to a project, connect data sources, install agent rules, ingest schema, or troubleshoot a local ktx install. --- # ktx Install and configure **ktx**, the open-source context layer for data agents. Use this skill when a user wants an agent to add **ktx** to a project, connect data sources, build initial context, install agent integration, or troubleshoot a local **ktx** setup. ## Operating rules - Act autonomously when the user asks you to install or configure **ktx**. The non-interactive scripted flow below is the canonical path — bare `ktx setup` is interactive (clack prompts) and an agent cannot drive it. - Setup's non-interactive flags are intentionally hidden from `--help`. Use the flags listed below; verify uncommon flags against the docs at `https://docs.kaelio.com/ktx/` or this skill — not against `--help` output. - Ask only for values you cannot infer: project directory, connection targets, credentials, account identifiers, and source selections.