PlugWiki
dbt-mcp logo

dbt MCP Server: Setup for Claude, Cursor and Other Apps

OfficialLocal
GetPyPIdbt-mcpdbt-labs/dbt-mcp

Lets Claude, Cursor and other assistants explore your dbt models, metrics and lineage, query data, and run dbt commands.

This is dbt Labs' own server for dbt Core, dbt Fusion and the dbt platform. Run it on your machine with uvx to work on a local dbt project, with or without a dbt platform account. dbt also offers a hosted remote version for querying and exploring metadata with no install, but not for running dbt commands. The command-line tools can change your models and warehouse objects, so only connect it to an assistant you trust.

Good for

  • Analytics engineers who write and test dbt models with an assistant
  • Data teams who ask questions of governed metrics
  • Platform owners who watch dbt jobs and runs

Works in

12 should work

Tap an app to see how to set it up and any known problems.

Install dbt MCP

Claude Code

  1. 1

    Copy this prompt.

    Add the dbt MCP server to Claude Code. Run this command:
    
    claude mcp add dbt -e DBT_PROJECT_DIR=/path/to/your/dbt/project -e DBT_PATH=/path/to/your/dbt/executable -- uvx dbt-mcp
    
    Ask me for DBT_PROJECT_DIR, DBT_PATH and only put the values in that config, nowhere else.
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires uv, Python 3.12+.

This sets up local dbt commands. Point DBT_PROJECT_DIR at your dbt project and DBT_PATH at your dbt executable. To use dbt platform features, also set DBT_HOST, DBT_TOKEN and DBT_PROD_ENV_ID, as in the repo's .env.example. dbt's docs cover remote setup.

From the project README. Source.

Tools

  • Lists your defined metrics

    Retrieves all metrics defined in the dbt Semantic Layer.

    Try: “What metrics do we have?”

    Read · list_metrics

  • Queries a metric with filters

    Runs a metric query with filtering and grouping options.

    Try: “Show monthly revenue by region for 2025.”

    Read · query_metrics

  • Lists dimensions for metrics

    Gets the dimensions available for chosen metrics.

    Try: “What can I break revenue down by?”

    Read · get_dimensions

  • Lists values of a dimension

    Gets the distinct values of a dimension, optionally for chosen metrics.

    Try: “Which regions exist?”

    Read · get_dimension_values

  • Lists entities for metrics

    Gets the entities for chosen metrics.

    Try: “What entities does the revenue metric use?”

    Read · get_entities

  • Shows the SQL behind a metric

    Returns compiled SQL for metrics without running the query.

    Try: “Show the SQL for monthly revenue.”

    Read · get_metrics_compiled_sql

  • Lists saved metric queries

    Retrieves all saved queries.

    Try: “List the saved queries.”

    Read · list_saved_queries

  • Runs SQL on dbt platform

    Runs SQL on dbt platform infrastructure with Semantic Layer support.

    Try: “Run a query to count orders by status.”

    Read · execute_sql

  • Writes SQL from a plain question

    Generates SQL from natural language using your project context.

    Try: “Write SQL for total sales by month.”

    Read · text_to_sql

  • Lists all models

    Retrieves the name and description of every model.

    Try: “List all models in my project.”

    Read · get_all_models

  • Lists mart models

    Retrieves all mart models.

    Try: “Which mart models do we have?”

    Read · get_mart_models

  • Lists sources and freshness

    Gets all sources with their freshness status.

    Try: “Which sources are stale?”

    Read · get_all_sources

Read from the source code

Permissions

medium risk · 2 things to watch · 5 advisories

Medium risk

The command-line tools can run, build and clone models, which change tables and views in your warehouse, and dbt warns they can modify your data models and sources. Disable the command-line tool group if you only want to read metadata and metrics.

What it can do

Watch out for

  • dbt commands can change your warehouse

    build, run and clone create or replace tables and views, and the SQL tools run what the assistant writes. Run against a development target, not production. raw.githubusercontent.com

  • It can start and cancel platform jobs

    It can trigger, retry and cancel dbt platform job runs. Use a service token with only the permissions you need. raw.githubusercontent.com

Security advisories

Technical details
Turning on read-onlyTurn off tool groups or single tools with environment variables such as DISABLE_TOOLS. See dbt's environment variables reference.
Talks todbt platform (DBT_HOST). docs.getdbt.com
Sign-in and keysEnvironment variables such as DBT_TOKEN in your client config. Local dbt commands use your existing dbt profile.
Scopes
  • dbt platform service token and environment IDs, and the credentials of your local dbt profile

Questions

Is the dbt MCP server official?

Yes. It is published by dbt Labs in the dbt-labs/dbt-mcp repository and documented on docs.getdbt.com.

Do I need a dbt platform account?

Not to run dbt commands on a local project. With an account you also get the Semantic Layer, Discovery API, Admin API and SQL tools.

What is the difference between self-hosted and remote?

Self-hosted runs on your machine with uvx and supports dbt commands, codegen and the Admin API. The remote one is hosted by dbt, needs no install, and is for querying data and exploring metadata. It cannot run dbt platform CLI commands.

What do I need to install?

uv, so you can run uvx dbt-mcp. The package on PyPI needs Python 3.12 or newer.

Can I make it read-only?

You can turn off the dbt command tools, or any single tool, with environment variables such as DISABLE_TOOLS. The metadata and metric tools do not change data.

What does the experimental bundle do?

dbt publishes a dbt-mcp.mcpb file with each release. Apps that support MCP bundles can import it without extra setup.

Information

updated Nov 2, 2026

Publisher
Official
Package
dbt-mcp
Registry
PyPI
Transport
stdio
License
Apache-2.0
Last commit
Oct 30, 2026
Open issues
30

GitHubChangelogIssues

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 2
  1. docs.getdbt.com · docs.getdbt.com
  2. raw.githubusercontent.com · raw.githubusercontent.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.