dbt MCP Server

dbt Labs' server for running dbt commands, querying metrics and reading project metadata

Official · dbt Labs Python Local · stdio Data and analyticsDatabasesDeveloper tools

81 popularity score ★ 617 ↓ 76k/mo

Connect your client

Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs DBT_HOST. Replace each <NAME> with your value.

Claude CodeTerminal
claude mcp add dbt -e DBT_HOST=<DBT_HOST> -- uvx dbt-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "dbt": {
      "command": "uvx",
      "args": [
        "dbt-mcp"
      ],
      "env": {
        "DBT_HOST": "<DBT_HOST>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "dbt": {
      "command": "uvx",
      "args": [
        "dbt-mcp"
      ],
      "env": {
        "DBT_HOST": "<DBT_HOST>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "dbt": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "dbt-mcp"
      ],
      "env": {
        "DBT_HOST": "<DBT_HOST>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.dbt]
command = "uvx"
args = ["dbt-mcp"]

[mcp_servers.dbt.env]
DBT_HOST = "<DBT_HOST>"
Gemini CLITerminal
gemini mcp add --scope user -e DBT_HOST=<DBT_HOST> dbt uvx -- dbt-mcp

Settings 12

DBT_HOST Required: dbt platform access URL hostname (e.g. abc123.us1.dbt.com); turns on OAuth sign-in and the platform tools. For CLI-only use, set DBT_PROJECT_DIR and DBT_PATH instead.
DBT_PROJECT_DIR Optional: Absolute path to the folder holding dbt_project.yml; needed for the CLI tools.
DBT_PATH Optional: Absolute path to the dbt executable; defaults to dbt on the PATH.
DBT_TOKEN Optional: Personal access or service token, instead of OAuth; execute_sql needs a personal token.
DBT_PROD_ENV_ID Optional: Production environment ID, for Discovery and Semantic Layer tools with a token.
DBT_ACCOUNT_ID Optional: Account ID, for Admin API tools and personal-token sign-in.
DBT_DEV_ENV_ID Optional: Development environment ID, for execute_sql.
DBT_USER_ID Optional: dbt platform user ID, for execute_sql.
DBT_CLI_TIMEOUT Optional: Seconds before a dbt command times out; default 60.
DISABLE_DBT_CODEGEN Optional: Set to false to enable the Codegen tools, off by default.
DISABLE_TOOLS Optional: Comma-separated tool names to hide.
DISABLE_DBT_CLI Optional: Set to true to turn off the dbt CLI tools.

What it does

dbt Labs publishes this server so an MCP client can work with a dbt project. Run locally with uvx, it can call the dbt executable on your machine (build, run, test, compile, show and others) against a project folder, and, when connected to a dbt platform account, read project metadata through the Discovery API, query metrics through the Semantic Layer, run or generate SQL, and list, start, retry or cancel jobs through the Administrative API. It also searches and fetches pages from docs.getdbt.com.

Toolsets switch themselves off when their settings are missing rather than failing: with only DBT_PROJECT_DIR and DBT_PATH it offers the CLI tools; with DBT_HOST it signs in to dbt platform by OAuth and adds the platform tools. Each toolset can also be turned off with a DISABLE_* setting, or single tools with DISABLE_TOOLS.

The settings file at v2.7.0 shows defaults the README does not list: the Codegen tools (DISABLE_DBT_CODEGEN) and the server-metadata tools (DISABLE_MCP_SERVER_METADATA) are off unless enabled, DBT_PATH falls back to plain "dbt" on the PATH, CLI commands time out after 60 seconds (DBT_CLI_TIMEOUT), and Semantic Layer responses are cut at 16,000 characters (DBT_MCP_SL_MAX_RESPONSE_CHARS). By default it also loads interactive result views from a dbt-owned CDN, which DISABLE_MCP_APPS turns off.

dbt also runs a hosted version on dbt platform for reading metrics, metadata and lineage without installing anything; it lacks the CLI and Codegen tools.

What it needs

RuntimePython

uv (the launch command is uvx). For the CLI tools: a local dbt project and a dbt executable (dbt v1, dbt v2/Fusion or the dbt platform CLI). For Semantic Layer, Discovery, Admin API and SQL tools: a dbt platform account; OAuth needs a Starter, Enterprise or Enterprise+ account with a static subdomain, otherwise a token. Local column lineage needs the dbt VS Code extension.

Limits

Platform tools need a dbt platform account, and which ones work depends on the plan's API access. execute_sql works only with a personal access token, not a service token. text_to_sql uses dbt Copilot actions and stops when the allotment runs out. CLI commands time out after 60 seconds by default. The hosted server has no CLI or Codegen tools. search is alpha and not generally available; eleven Discovery tools are deprecated in favour of get_node_details and get_lineage. The MCP bundle (dbt-mcp.mcpb) is marked experimental.

Who it suits

Suits analytics engineers who already use dbt and want an assistant to build, test and inspect their project, and teams on dbt platform who want metrics, lineage and job status in chat. It runs dbt commands that change warehouse objects, so it suits people who trust their client with that; for read-only metric and metadata questions without a local install, dbt's hosted server is the narrower choice. Not for people without a dbt project: it works on nothing else.

Tools 60 of 62

execute_sql
Runs SQL on dbt platform infrastructure, with Semantic Layer support
text_to_sql
Turns a plain-language question into SQL using project context
get_dimension_values
Lists distinct values of a dimension, optionally for given metrics
get_dimensions
Lists the dimensions available for chosen metrics
get_entities
Lists the entities available for chosen metrics
get_metrics_compiled_sql
Shows the SQL a metric query compiles to, without running it
list_metrics
Lists every metric defined in the Semantic Layer
list_saved_queries
Lists the saved queries in the Semantic Layer
query_metrics
Runs a metric query with filters, grouping and ordering
get_all_macros
Lists macros, optionally per package or just package names
get_all_models
Lists every model with its description
get_all_sources
Lists sources and their freshness, optionally by source name
get_exposures
Lists exposures such as downstream dashboards and apps
get_lineage
Returns a lineage graph limited by type, depth and direction
get_mart_models
Lists the mart models
get_model_health
Reports a model's last run status, test results and source freshness
get_model_performance
Shows a model's run history, optionally with test results
get_node_details
Returns full details of any resource: model, source, test, seed, macro and more
get_related_models
Finds models similar to a given one by semantic search
search
Alpha search across project resources; not generally available
get_model_details
Deprecated; replaced by get_node_details
get_model_parents
Deprecated; replaced by get_lineage
get_model_children
Deprecated; replaced by get_lineage
get_source_details
Deprecated; replaced by get_node_details
get_exposure_details
Deprecated; replaced by get_node_details
get_macro_details
Deprecated; replaced by get_node_details
get_seed_details
Deprecated; replaced by get_node_details
get_semantic_model_details
Deprecated; replaced by get_node_details
get_snapshot_details
Deprecated; replaced by get_node_details
get_test_details
Deprecated; replaced by get_node_details
build
Runs dbt build: models, tests, snapshots and seeds in dependency order
clone
Runs dbt clone to copy selected nodes from a saved state into the target schema
compile
Runs dbt compile to render models and tests into SQL
docs
Runs dbt docs to generate project documentation
get_lineage_dev
Reads lineage from the local manifest.json
get_node_details_dev
Reads node details from the local manifest.json
list
Runs dbt list to list project resources by type or selector
parse
Runs dbt parse to check project files
run
Runs dbt run to build models in the warehouse
show
Runs dbt show to execute SQL and return rows
test
Runs dbt test against models and data
cancel_job_run
Cancels a job run in progress
get_job_details
Shows a job's triggers, schedule and commands
get_job_run_artifacts
Downloads one artifact from a job run, with optional jq filter
get_job_run_details
Shows a run's status, timing, steps and artifacts
get_job_run_error
Shows the errors or warnings of a job run
list_job_run_artifacts
Lists the artifacts a job run produced
list_jobs
Lists jobs, optionally by project or environment
list_jobs_runs
Lists job runs, filtered by job or status
list_projects
Lists the projects in the dbt platform account
retry_job_run
Retries a failed job run
trigger_job_run
Starts a job run, optionally overriding branch or schema
generate_model_yaml
Writes model YAML with columns, optionally inheriting descriptions
generate_source
Writes source YAML by inspecting warehouse schemas
generate_staging_model
Writes staging model SQL for a source table
fusion.compile_sql
Compiles SQL in project context through dbt platform
fusion.get_column_lineage
Traces column-level lineage through dbt platform
get_column_lineage
Traces column-level lineage locally through the dbt VS Code extension's language server
search_product_docs
Searches docs.getdbt.com and returns matching page titles and links
get_product_doc_pages
Fetches whole docs.getdbt.com pages as Markdown

Similar servers