MCP Directory

dbt MCP Server

Give AI agents context of your dbt project — run dbt CLI, query the Semantic Layer, explore lineage, and manage jobs.

Unverified
stdio (local)
API key
Python

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
uvx dbt-mcp

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "dbt-mcp-server": {
      "command": "uvx",
      "args": [
        "dbt-mcp"
      ],
      "env": {
        "DBT_HOST": "cloud.getdbt.com",
        "DBT_PROD_ENV_ID": "your-production-environment-id",
        "DBT_DEV_ENV_ID": "your-development-environment-id",
        "DBT_USER_ID": "your-user-id",
        "DBT_TOKEN": "your-service-token-or-pat",
        "DBT_PROJECT_DIR": "/path/to/your/dbt/project",
        "DBT_PATH": "/path/to/your/dbt/executable"
      }
    }
  }
}

Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • uv / uvx installed (for the local stdio server)
  • Python 3.12 or 3.13 (3.12 <= version < 3.14)
  • For dbt Platform features: a dbt Platform account, host (DBT_HOST), a service token or Personal Access Token (DBT_TOKEN), and the relevant environment IDs
  • For local dbt CLI tools: a dbt project directory (DBT_PROJECT_DIR) and a dbt executable path (DBT_PATH)

About dbt MCP Server

Official dbt Labs MCP server that exposes dbt Core, dbt Fusion, and dbt Platform capabilities to AI agents. Connect it to Claude, Cursor, or VS Code to let an agent understand your project's models, sources, metrics, and lineage; run and compile dbt; query the Semantic Layer; and operate Platform jobs. Runs locally over stdio via uvx dbt-mcp, or as a remote HTTP server hosted on the dbt Platform. Tool groups are toggled with DISABLE_/DBT_MCP_ENABLE_ environment variables.

Tools & capabilities (60)

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 distinct values for a dimension; option to scope to specific metrics.

get_dimensions

Gets dimensions for specified metrics.

get_entities

Gets entities for specified metrics.

get_metrics_compiled_sql

Returns compiled SQL for metrics without executing the query.

list_metrics

Retrieves all defined Semantic Layer metrics.

list_saved_queries

Retrieves all saved queries.

query_metrics

Executes metric queries with filtering and grouping options.

get_all_macros

Retrieves macros; option to filter by package or return package names only.

get_all_models

Retrieves name and description of all models.

get_all_sources

Gets all sources with freshness status; option to filter by source name.

get_exposure_details

Gets exposure details including owner, parents, and freshness status.

get_exposures

Gets all exposures (downstream dashboards, apps, or analyses).

get_lineage

Gets full lineage graph (ancestors and descendants) with type and depth filtering.

get_macro_details

Gets details for a specific macro.

get_mart_models

Retrieves all mart models.

get_model_children

Gets downstream dependents of a model.

get_model_details

Gets model details including compiled SQL, columns, and schema.

get_model_health

Gets health signals: run status, test results, and upstream source freshness.

get_model_parents

Gets upstream dependencies of a model.

get_model_performance

Gets execution history for a model; option to include test results.

get_related_models

Finds similar models using semantic search.

get_seed_details

Gets details for a specific seed.

get_semantic_model_details

Gets details for a specific semantic model.

get_snapshot_details

Gets details for a specific snapshot.

get_source_details

Gets source details including columns and freshness.

get_test_details

Gets details for a specific test.

search

[Alpha] Searches for resources across the dbt project (not generally available).

build

Executes models, tests, snapshots, and seeds in DAG order.

clone

Clones selected nodes from the specified state to the target schema(s).

compile

Generates executable SQL from models/tests/analyses; useful for validating Jinja logic.

docs

Generates documentation for the dbt project.

get_lineage_dev

Retrieves lineage from local manifest.json with type and depth filtering.

get_node_details_dev

Retrieves node details from local manifest.json (models, seeds, snapshots, sources).

list

Lists resources in the dbt project by type with selector support.

parse

Parses and validates project files for syntax correctness.

run

Executes models to materialize them in the database.

show

Executes SQL against the database and returns results.

test

Runs tests to validate data and model integrity.

cancel_job_run

Cancels a running job.

get_job_details

Gets job configuration including triggers, schedule, and dbt commands.

get_job_run_details

Gets run details including status, timing, steps, and artifacts.

get_job_run_error

Gets error and/or warning details for a job run; option to include or show warnings only.

list_job_run_artifacts

Lists available artifacts from a job run.

list_jobs

Lists jobs in a dbt Platform account; option to filter by project or environment.

list_jobs_runs

Lists job runs; option to filter by job, status, or order by field.

list_projects

Lists all projects in the dbt Platform account.

retry_job_run

Retries a failed job run.

trigger_job_run

Triggers a job run; option to override git branch, schema, or other settings.

generate_model_yaml

Generates model YAML with columns; option to inherit upstream descriptions.

generate_source

Generates source YAML by introspecting database schemas; option to include columns.

generate_staging_model

Generates staging model SQL from a source table.

fusion.compile_sql

Compiles SQL in project context via dbt Platform (Fusion engine).

fusion.get_column_lineage

Traces column-level lineage via dbt Platform (Fusion engine).

get_column_lineage

Traces column-level lineage locally (requires dbt-lsp via the dbt Labs VS Code extension).

get_product_doc_pages

Fetches 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 a query; returns titles, URLs, and descriptions ranked by relevance.

get_mcp_server_branch

Returns the current git branch of the running dbt MCP server.

get_mcp_server_version

Returns the current version of the dbt MCP server.

What this server can do

dbt MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Ask an AI agent questions about your dbt project's models, sources, and lineage using the Discovery API
  • Query business metrics in natural language through the dbt Semantic Layer and return governed results
  • Run, build, compile, and test dbt models directly from your AI client via the dbt CLI tools
  • Inspect model health, run history, and source freshness to debug pipeline issues
  • Operate dbt Platform jobs — trigger, retry, cancel, and inspect runs and artifacts via the Admin API
  • Generate boilerplate source and staging YAML/SQL with the Codegen tools
  • Trace column-level lineage across the project using the Fusion LSP tools

Security notes

Enabling the dbt CLI tools lets the client run dbt commands (build, run, clone, etc.) that can modify your data models, sources, and warehouse objects — only enable them for clients you trust. The dbt Platform tools require a service token or Personal Access Token (DBT_TOKEN); the execute_sql tool specifically requires a PAT plus dev environment and user IDs. Store tokens via environment variables or an env file rather than committing them. SQL, Codegen, and server-metadata tool groups are disabled by default and must be explicitly enabled.

dbt MCP Server FAQ

How do I install and run the dbt MCP server?

Install uv, then run it via `uvx dbt-mcp` — no need to clone the repo unless you are contributing. Configure it in your MCP client (Claude, Cursor, VS Code) as a stdio server with the appropriate environment variables.

Does it work with dbt Core or only dbt Platform?

Both. It works with dbt Core, dbt Fusion, and the dbt Platform. Local dbt CLI tools need DBT_PROJECT_DIR and DBT_PATH, while Semantic Layer, Discovery, and Admin API tools require dbt Platform credentials (DBT_HOST and DBT_TOKEN).

Is there a hosted/remote option?

Yes. In addition to the local stdio server, dbt offers a remote HTTP MCP server hosted on the dbt Platform that connects over a URL with token-based or OAuth authentication, so no local installation is required.

How do I control which tools are exposed?

Tool groups are toggled with environment variables. Use DISABLE_* flags (e.g. DISABLE_DBT_CLI) to turn groups off, or DBT_MCP_ENABLE_* flags as an allowlist. SQL, Codegen, and server-metadata tools are disabled by default.

Is this the same as the `dbt-mcp` package on npm?

No. dbt Labs publishes this server on PyPI and runs it with `uvx dbt-mcp`. The unrelated `dbt-mcp` package on npm is a different project and is not the dbt Labs server.

Alternatives to dbt MCP Server

Compare all alternatives →

Official MCP server providing persistent, file-backed knowledge-graph memory across sessions.

Verified
stdio (local)
No auth
TypeScript
9 tools
Updated 5 months agoRepo

Structured step-by-step reasoning tool for breaking problems into revisable thought sequences.

Verified
stdio (local)
No auth
TypeScript
1 tool
Updated 6 months agoRepo

Fully managed remote server for AWS docs, blogs, What's-New and Well-Architected guidance — no key.

Verified
HTTP (remote)
No auth
Hosted
6 tools
Updated 5 months agoRepo