DEV.co
MCP Servers · Kaelio

ktx

ktx is a TypeScript-based context layer that helps AI agents (Claude Code, Codex, etc.) query data warehouses accurately by automatically learning your company's metric definitions, business knowledge, and data relationships. It ingests schemas, documentation, and BI tools to build a searchable semantic layer that agents use to write correct SQL without reinventing metrics each time.

Source: GitHub — github.com/Kaelio/ktx
1.5k
GitHub stars
87
Forks
TypeScript
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryKaelio/ktx
OwnerKaelio
Primary languageTypeScript
LicenseApache-2.0 — OSI-approved
Stars1.5k
Forks87
Open issues31
Latest releasev0.16.0 (2026-07-03)
Last updated2026-07-07
Sourcehttps://github.com/Kaelio/ktx

What ktx is

ktx is a local-first Node.js CLI and MCP server that ingests SQL warehouse metadata, dbt/MetricFlow semantic layers, and wiki content through connectors and context builders, then exposes a combined full-text and semantic search surface to LLM agents via CLI and MCP tools. It builds a join graph to resolve chasm and fan traps, compiles read-only SQL, and supports PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, SQLite, DuckDB, Athena, and MongoDB.

Quickstart

Get the ktx source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/Kaelio/ktx.gitcd ktx# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

AI-Driven Data Exploration with Approved Metrics

Enable Claude Code, Codex, or Cursor to query warehouses using canonical metric definitions instead of inventing SQL. ktx automatically learns approved metrics from dbt, Looker, or MetricFlow and serves them to agents.

Consolidating Fragmented Business Knowledge

Absorb scattered documentation from Notion, wikis, dbt, Looker, and Metabase into a single searchable context. Agents access unified knowledge; humans review and flag contradictions.

Reducing Agent Hallucination on Data Tasks

Replace free-form warehouse exploration with structured, read-only access to pre-validated tables and relationships. Agents resolve joins declaratively using ktx's join graph instead of guessing foreign keys.

Implementation considerations

  • Requires Node.js and global npm installation; `ktx setup` initializes local project with ktx.yaml, semantic-layer/, wiki/, and .ktx/ directories. Store .ktx/ locally and commit only ktx.yaml and semantic-layer/ to version control.
  • Must configure LLM backend (Anthropic API, Google Vertex, Claude Code session, or Codex SDK) and database connections before building context. No SaaS signup required; all processing is local.
  • Ingest sources (dbt, Looker, MetricFlow, Notion, Google Drive) are optional; basic ingestion requires warehouse connection and optional metadata sources. Incomplete ingestion still produces usable context.
  • MCP server runs on-demand via `ktx mcp start`; agent client (Claude Code, Codex, Cursor) must be configured to communicate with the local MCP daemon. Requires agent SDK integration.
  • Join graph resolution and contradiction flagging depend on schema quality and metadata completeness; sparse schemas or undocumented relationships may limit semantic layer effectiveness.

When to avoid it — and what to weigh

  • No SQL Warehouse — ktx sits on top of a SQL data warehouse. If you query data via APIs, files, or non-SQL sources, ktx is not applicable.
  • One-Off Ad Hoc Queries — If you need a single query answered, direct SQL access or a notebook is simpler. ktx's value accrues when agents run repeated analytical tasks.
  • Manual Semantic Layer Maintenance Acceptable — ktx automates metric learning and contradiction detection. If your team prefers full control and manual curation, a lightweight YAML semantic layer may suffice.
  • No Approved Metric Definitions Established — ktx ingests existing metric sources (dbt, Looker, MetricFlow). If you have no canonical metric definitions, ktx requires significant upfront schema and business knowledge input.

License & commercial use

ktx is licensed under Apache License 2.0 (Apache-2.0), an OSI-approved permissive license. Permits commercial use, modification, and distribution with attribution and liability disclaimer.

Apache 2.0 is a permissive OSI license that explicitly permits commercial use, modification, and distribution. No additional licensing fees or restrictions from ktx itself. Users are responsible for compliance with dependencies and their own LLM provider agreements (e.g., Anthropic, Google). Review your LLM provider's terms for any usage constraints.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

ktx runs locally; no schema or query results are sent to hosted services (only to configured LLM provider as instructed by user). Database connections are read-only by design—no write access. Connection secrets stored in local .ktx/ directory (git-ignored). Users must secure their LLM API keys and database credentials in their environment. Ingestion of external sources (Notion, Google Drive, dbt Cloud) introduces trust dependencies on those integrations. No formal security audit data provided; requires review for production use.

Alternatives to consider

dbt Semantic Layer / MetricFlow

Mature metric definition layer for dbt projects. Requires manual maintenance; does not auto-ingest wiki or BI tool knowledge. Does not include agent-specific MCP runtime.

Langchain / LlamaIndex Loaders + Custom RAG

General-purpose LLM context frameworks. Require custom ingestion and search logic. No built-in join graph resolution, metric curation, or contradiction detection.

Looker / Metabase Semantic Layers

BI-tool-native semantic layers. Limited to single-source metric definitions; do not absorb wiki or dbt knowledge. Do not expose MCP tools for agent integration.

Software development agency

Build on ktx with DEV.co software developers

ktx automates semantic layer building and agent integration. Start with `npm install -g @kaelio/ktx` and `ktx setup` to enable Claude Code, Codex, and other agents to query your warehouse accurately.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

ktx FAQ

Does ktx send my data to a hosted service?
No. ktx runs entirely locally. Only data you explicitly send to your configured LLM provider (Anthropic, Google, etc.) leaves your machine. No ktx SaaS backend.
Which agents are supported?
Claude Code, Codex, Cursor, and OpenCode are confirmed via MCP. CLI integration available for any scripting workflow. Other agents require MCP support.
Is my warehouse safe?
Yes. All database connections are read-only. ktx never writes to your warehouse, modifies schema, or executes DML/DDL. Requires read-only credentials.
Can ktx work without dbt or Looker?
Yes. ktx can ingest raw warehouse metadata and build context from schema introspection and manual wiki documentation. Semantic layer YAML can be written by hand if needed.

Custom software development services

Need help beyond evaluating ktx? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and mcp servers integrations — and maintain them long-term.

Ready to Connect Your Data Warehouse to AI Agents?

ktx automates semantic layer building and agent integration. Start with `npm install -g @kaelio/ktx` and `ktx setup` to enable Claude Code, Codex, and other agents to query your warehouse accurately.