SuperAPI AI Directory

dbt-mcp

🎖️ 🐍 🏠 ☁️ - dbt integration: dbt Core and Cloud CLI, project metadata discovery, model information and semantic layer queries.

Open website

About this tool

dbt-mcp is an MCP (Model Context Protocol) server for interacting with dbt. Through this server, you can provide AI agents with project context from dbt Core, dbt Fusion, and dbt Platform.

Purpose

Connect the dbt MCP server to agent products such as Claude and Cursor, enabling agents to work with dbt project context. Its architecture is officially described as allowing agents to connect to a variety of tools. If you want to build your own agent, the repository provides examples in the examples directory.

Main Capabilities

The project provides multiple groups of tools by category.

SQL and semantic layer tools (dbt Platform): execute_sql executes SQL on dbt Platform infrastructure, with semantic layer support; text_to_sql generates SQL from natural language using project context; get_dimension_values gets the distinct values of a dimension, optionally scoped to a specific metric; get_dimensions gets the dimensions of a specified metric; get_entities gets the entities of a specified metric; get_metrics_compiled_sql returns the compiled SQL of a metric without executing the query; list_metrics gets all defined metrics; list_saved_queries gets all saved queries; query_metrics executes metric queries with filtering and grouping options.

Discovery API tools: get_all_macros gets macros, optionally filtered by package or returning only package names; get_all_models gets the names and descriptions of all models; get_all_sources gets all sources and their freshness status, optionally filtered by source name; get_exposures gets all exposures (downstream dashboards, applications, or analyses); get_lineage gets a bounded lineage graph, with support for filtering by type, depth, and direction; get_mart_models gets all mart models; get_model_health gets health signals, including run status, test results, and upstream source freshness; get_model_performance gets model execution history, optionally including test results; get_node_details gets the full details of any dbt resourcetype (model, source, exposure, test, seed, snapshot, macro, semantic_model); get_related_models uses semantic search to find similar models; search is an Alpha feature that searches resources within a dbt project (not yet generally available). Some older tools are deprecated and it is recommended to use get_node_details or get_lineage instead, such as get_exposure_details, get_macro_details, get_model_children, get_model_details, get_model_parents, get_seed_details, get_semantic_model_details, get_snapshot_details, get_source_details, get_test_details.

dbt commands executed through MCP: build executes models, tests, snapshots, and seeds in DAG order; clone clones selected nodes from a specified state to a target schema; compile generates executable SQL from models/tests/analyses, which can be used to validate Jinja logic; docs generates documentation for a dbt project; get_lineage_dev gets lineage from the local manifest.json, with support for filtering by type and depth; get_node_details_dev gets node details from the local manifest.json; list lists dbt project resources by type, with selector support; parse parses and validates project file syntax; run executes models so they are materialized in the database; show executes SQL against the database and returns results; test runs tests to validate data and model integrity. Official note: allowing clients to use dbt commands through MCP tools may modify your data models, sources, and data warehouse objects; proceed only if you trust the client and understand the potential impact.

Administrative API tools: cancel_job_run cancels a running job; get_job_details gets job configuration, including triggers, schedules, and dbt commands; get_job_run_artifacts downloads specific artifacts from a job run; large artifactswill return a prompt message and require retrying with jq_filter, supporting jq filtering for targeted extraction; get_job_run_details retrieves run details, including status, time, steps, and artifacts; get_job_run_error retrieves error and/or warning details for a job run, optionally including or showing only warnings; list_job_run_artifacts lists the available artifacts in a job run; list_jobs lists the jobs in a dbt Platform account, filterable by project or environment; list_jobs_runs lists job runs, filterable by job or status, or sortable by field; list_projects lists all projects in a dbt Platform account; retry_job_run retries a failed job run; trigger_job_run triggers a job run, with optional overrides for the git branch, schema, or other settings.

Code generation tools: generate_model_yaml generates model YAML with columns, optionally inheriting upstream descriptions; generate_source generates source YAML by introspecting the database schema, optionally including columns; generate_staging_model generates staging model SQL from a source table.

Fusion engine tools: fusion.compile_sql compiles SQL in the project context through dbt Platform; fusion.get_column_lineage traces column-level lineage through dbt Platform; get_column_lineage traces column-level lineage locally (requires the dbt-lsp provided by dbt Labs VSCE).

dbt documentation tools: get_product_doc_pages retrieves the full Markdown content of one or more docs.getdbt.com pages by path or URL; search_product_docs searches docs.getdbt.com for pages matching the query, returning titles, URLs, and descriptions by relevance, and get_product_doc_pages can be used to retrieve the full content.

MCP server metadata tools: get_mcp_server_branch returns the current git branch of the running dbt MCP server; get_mcp_server_version returns the current version.

Usage

The official release of the experimental Model Context Protocol Bundle (dbt-mcp.mcpb) allows clients that support MCPB to import the server without additional setup: download the bundle from the latest release artifacts, and install or inspect it according to Anthropic's mcpb CLI documentation. Dependencies are pinned to specific versions and are not automatically updated; only automated PRs for security-related dependency updates are submitted.

Applicable scenarios and limitations

It is suitable for providing AI agents with dbt project context, querying the semantic layer, discovering project metadata, and more. Note that executing dbt commands through MCP tools may modify data models, sources, and data warehouse objects; search is Alpha and not generally available; some tools are deprecated; the official materials do not specify specific pricing, fees, or platform limitations, and no relevant information is currently available.