# dbt-mcp

> dbt-mcp is an open-source MCP server for databases. MCP server giving AI agents access to dbt projects, models, lineage and jobs. It is available on CLI, API and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted
- **Repository:** https://github.com/dbt-labs/dbt-mcp
- **GitHub stars:** 626
- **License:** Apache-2.0
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

Connects AI assistants to a dbt project so they can read models, tests, lineage and documentation directly rather than guessing from raw files. It covers dbt Core, dbt Fusion and dbt Platform, so the same client setup can work across local and cloud workflows.

The server is organized into toolsets: querying through the Semantic Layer, discovery of models and sources, running dbt CLI commands, pulling job run details from the Admin API, generating YAML and staging SQL, and searching the official dbt documentation. Several CLI tools can change warehouse objects, so the README advises enabling them only for clients you trust.

It suits analytics engineers and data teams who already use dbt and want an assistant that understands their project structure, debugging failed runs or drafting model code against it.

## Features

- **Semantic Layer querying:** Lists metrics and dimensions and runs metric queries, including compiled SQL previews without execution.
- **Model and lineage discovery:** Retrieves model details, bounded lineage graphs and health signals such as run status and test results.
- **dbt CLI execution:** Runs build, test, compile, run and parse commands from the agent, with a warning about warehouse impact.
- **Job run diagnostics:** Lists dbt Platform jobs and runs, fetches errors, and downloads run artifacts with jq filtering.
- **Code generation helpers:** Generates model YAML, source definitions and staging model SQL from database schemas.
- **Product documentation search:** Searches docs.getdbt.com and fetches full page content for agents to reference.

## Good for

- Debugging a failed dbt Platform job by pulling its error details and run artifacts
- Tracing which downstream dashboards and models depend on a given model before changing it
- Generating staging models and source YAML for newly loaded warehouse tables
- Answering business questions by querying defined metrics through the Semantic Layer
- Checking model freshness and test results before publishing data

## Tools

From the tool list in its README, going by the names, 3 of 15 tools change data; 5 names don't say. From the server's own tool labels and tool names; not verified by us.

- `execute_sql` (name suggests: changes): Executes SQL on dbt Platform infrastructure with Semantic Layer support.
- `text_to_sql`: Generates SQL from natural language using project context.
- `query_metrics` (name suggests: reads): Executes metric queries with filtering and grouping options.
- `list_metrics` (name suggests: reads): Retrieves all defined metrics.
- `get_lineage` (name suggests: reads): Gets a bounded lineage graph with type, depth, and direction filtering.
- `get_model_health` (name suggests: reads): Gets health signals: run status, test results, and upstream source freshness.
- `build`: Executes models, tests, snapshots, and seeds in DAG order.
- `run` (name suggests: changes): Executes models to materialize them in the database.
- `test`: Runs tests to validate data and model integrity.
- `list_jobs_runs` (name suggests: reads): Lists job runs; option to filter by job, status, or order by field.
- `get_job_run_error` (name suggests: reads): Gets error and/or warning details for a job run.
- `trigger_job_run` (name suggests: changes): Triggers a job run; option to override git branch, schema, or other settings.
- `generate_staging_model`: Generates staging model SQL from a source table.
- `generate_source`: Generates source YAML by introspecting database schemas.
- `search_product_docs` (name suggests: reads): Searches docs.getdbt.com for pages matching a query.

## FAQ

### Which dbt products does dbt-mcp work with?

The README says it works with dbt Core, dbt Fusion and dbt Platform.

### How do I install dbt-mcp?

An experimental MCP Bundle (dbt-mcp.mcpb) is attached to each release for MCPB-aware clients, and it is commonly connected to clients such as Claude or Cursor.

### Can the agent modify my data?

Yes. The dbt CLI tools such as build, run and test can change models and warehouse objects, so the README recommends enabling them only for trusted clients.

### Is dbt-mcp free?

Yes. dbt-mcp is open source, so you can use and self-host it for free.

### What are the best alternatives to dbt-mcp?

The closest alternatives to dbt-mcp are dbt-docs-mcp, Dbt, mcp-databricks-server, Databricks MCP Server and Metabase Ai Assistant.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [dbt-docs-mcp](https://ai-powered.com/mcp/dbt-docs-mcp): dbt-docs-mcp is an open-source MCP server for data quality.
- [Dbt](https://ai-powered.com/mcp/dbt): Dbt is an open-source MCP server for databases.
- [mcp-databricks-server](https://ai-powered.com/mcp/mcp-databricks-server): mcp-databricks-server is an open-source MCP server for databases.
- [Databricks MCP Server](https://ai-powered.com/mcp/databricks-mcp-server): Databricks MCP Server is an open-source MCP server for databases.
- [Metabase Ai Assistant](https://ai-powered.com/mcp/metabase-ai-assistant): Metabase Ai Assistant is an open-source MCP server for analytics and data.
- [Dbatools MCP Server](https://ai-powered.com/mcp/dbatools-mcp-server): Dbatools MCP Server is an open-source MCP server for databases.
- [db-mcp (SQLite MCP Server)](https://ai-powered.com/mcp/db-mcp-sqlite-mcp-server): db-mcp (SQLite MCP Server) is an open-source MCP server for databases.
- [db-mcp-server](https://ai-powered.com/mcp/db-mcp-server-2): db-mcp-server is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/dbt-mcp
