dbt-labs/dbt-mcp

A MCP (Model Context Protocol) server for interacting with dbt.

What it solves

AI assistants often lack direct access to the data transformation projects they are asked to help with. This server bridges that gap by giving AI agents a structured set of tools to interact with dbt projects—whether they run on dbt Core, dbt Fusion, or dbt Platform. Instead of guessing or working from outdated context, an agent can query models, run dbt commands, inspect lineage, and even manage jobs, so its assistance is grounded in the real project state.

How it works

It is a Model Context Protocol (MCP) server. MCP is a standard way for AI agents to discover and call tools. The server bundles many pre-built tools into logical groups: SQL execution and text-to-SQL, Semantic Layer metric queries, Discovery API calls for models and lineage, dbt CLI commands (build, run, test, etc.), Admin API actions (list jobs, trigger runs), code generation helpers, column-level lineage, product documentation search, and even server metadata. An agent—such as Claude or Cursor—can connect to this server over MCP and call any of these tools with the right arguments.

Who it’s for

Developers and data teams who use dbt and want to supercharge their workflow with AI assistants. It is useful for anyone who wants an agent to answer questions about models, run dbt jobs, generate boilerplate code, or understand data lineage. It also suits developers building custom agents, as the project includes example code for getting started.

Highlights

  • SQL tools: execute SQL on dbt Platform infrastructure and convert natural language to SQL using project context.
  • Semantic Layer tools: list metrics, query metrics with filters, get dimension values, and compile metric SQL.
  • Discovery tools: retrieve all models, sources, exposures, macros, lineage graphs, and model performance details.
  • dbt CLI tools: run, build, test, compile, and more—directly from the agent.
  • Admin API tools: list and trigger job runs, cancel jobs, retrieve artifacts, and manage jobs.
  • Code generation: generate YAML model files, source YAML, and staging model SQL automatically.
  • Column-level lineage via dbt Fusion or locally with dbt-lsp.
  • Product docs search: fetch official dbt documentation pages directly.

Related

  • Project
  • Project
  • Project
  • Project
  • Project