Integration · dbt

Transformation and Semantic Layer as MCP.

dbt is the data transformation layer of the modern stack. The official dbt-labs/dbt-mcp exposes the dbt CLI plus the Semantic Layer to AI agents, in either local or remote configuration.

Two flavors. Local via uvx-installed dbt-mcp gives full CLI access (run, build, test, compile) and works against dbt Core, Fusion, and Platform projects. Remote HTTP variant is hosted on the dbt platform and is read-only Discovery plus Semantic Layer; ideal for data consumption and BI use cases. Tools cover dbt commands, manifest discovery, model and column lineage (via dbt-lsp), Semantic Layer text-to-SQL, and SQL execution. Apache-2.0.

Official MCPdbt-labs/dbt-mcp, Apache-2.0, local (uvx) plus remote (HTTP) variants.

What you can do via MCP

Example prompts the agent runs.

  • Build the dim_customers model and run all downstream tests.

    Calls dbt build with the model selector, runs the schema and data tests on every downstream model, returns a summary of passes and failures with the failing assertions surfaced.

  • Show me the column-level lineage for the revenue field in fct_orders.

    Pulls column-level lineage via dbt-lsp, returns the upstream sources and the transformation steps so the analyst can audit how revenue is computed.

  • What models depend on stg_orders? Run only those downstream of my recent changes.

    Resolves the dependency graph, intersects with the changed files in the working tree, runs only the downstream subset; useful for fast feedback loops on local changes.

  • Generate a staging model for the source table raw.stripe.charges.

    Inspects the source table schema, generates a stg_stripe__charges.sql model with the right column casts, type hints, and a default schema.yml entry. The analyst reviews and commits.

  • Use the Semantic Layer to query monthly revenue by product line for the last 6 months.

    Calls Semantic Layer text-to-SQL with the metric and dimensions, returns the result rows plus the SQL the layer compiled so the analyst can verify the metric definition.

dbt · MCP

Semantic Layer query via the dbt MCP. The agent invokes the metric; the Semantic Layer compiles the SQL; dbt executes against the warehouse.

dbt MCP
docs
# dbt MCP, called via the agent runtime
mcp.dbt.semantic_layer_query({
  metrics: ["revenue_usd"],
  group_by: ["product_line", "metric_time__month"],
  where: "metric_time__month >= '2025-11-01'",
  order_by: ["metric_time__month DESC", "revenue_usd DESC"]
})

# Returns the result rows plus the compiled SQL for verification.
One command sample showing how the agent talks to dbt. The MCP exposes the platform's primitives as tools; the agent translates the prompt into the right call.

MCP integration

dbt MCP server.

Server
Local: uvx dbt-mcp. Remote: HTTP endpoint hosted on dbt platform.
Auth
Local: dbt profile credentials. Remote: dbt platform service token.
Hosting
Local (uvx-installed) for full CLI access; remote (dbt platform managed) for read-only Discovery plus Semantic Layer.
  • dbt run, build, test, compile (local variant; full CLI surface)
  • Manifest discovery, model and column lineage (local plus remote via dbt-lsp)
  • Semantic Layer text-to-SQL with compiled SQL returned for audit
  • SQL execution against the warehouse with dbt's connection management
  • Apache-2.0 license; local server provides best dev experience, remote ideal for BI consumption

dbt-mcp repo

Visual demonstration

What this looks like in practice.

dbt· Lineage4 stages · 6 edges
Sources
Staging
Models
Exposures
  • source

    stripe.charges

    raw

  • source

    stripe.customers

    raw

  • transform

    stg_stripe__charges

    staging

  • transform

    stg_stripe__customers

    staging

  • model

    dim_customers

    marts.core

  • model

    fct_orders

    marts.finance

  • exposure

    revenue_dashboard

    Hex

Edges flow left to right. Sources are amber, transforms blue, models violet, exposures green.
Lineage returned by the dbt MCP. Sources to staging to models to exposures, edges left-to-right. The Hex exposure is the downstream consumer of fct_orders.
dbt· QuerySemantic Layer
1-- Semantic Layer query
2-- "Monthly revenue by product line for the last 6 months."
3
4SELECT
5 metric_time__month,
6 product_line,
7 revenue_usd
8FROM {{ semantic_layer.metrics(
9 metrics=['revenue_usd'],
10 group_by=['product_line', 'metric_time__month'],
11 where="metric_time__month >= '2025-11-01'"
12) }}
13ORDER BY metric_time__month DESC, revenue_usd DESC;
36 rows
The compiled SQL the Semantic Layer returned for the monthly-revenue-by-product-line question. The metric definition lives in the dbt project; the layer re-renders the SQL consistently across consumers.

CLI alternative

dbt CLI directly for non-MCP workflows.

The dbt CLI is the canonical operational surface for dbt projects. For AI-driven workflows the dbt-mcp is the primary interface; the CLI fills in for CI/CD pipelines, scheduled jobs, and any operational task the agent runtime is not the right place for. Apache-2.0; either path is valid.

Pairs with these skills

The PM data and analytics skill suite.

This integration pairs with the forthcoming data-warehouse-experimentation, product-analytics-setup skills. The skill landing pages and SKILL.md sources land in subsequent dispatches; cross-link hyperlinks are added when the skill pages ship.