Basic information
About dbt MCP Server
dbt bridges data build tool resources and natural language, enabling top BI software features, metadata discovery, and data transformation.
dbt is a MCP server in the Analytics Data category listed in the AddMCP.net directory, published by dbt-labs. It exposes 3 tools, including Discovery:, SQL:, Codegen:. Supported transport: stdio. Runtime: Python. License: Apache-2.0. The repository has 587 GitHub stars. Source code is hosted on github.com. Related topics: analytics-data, data-analytics, data-engineering, dbt, developer-tools.
Setup
{
"mcpServers": {
"dbt-mcp": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
}
}
}
{
"mcpServers": {
"dbt-mcp": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
}
}
}
{
"servers": {
"dbt-mcp": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
}
}
}
dbt MCP Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"dbt-mcp": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
}
}
}
dbt MCP Server tools
- Discovery: — `get_all_models`, `get_lineage`, `get_node_details`, `get_model_health` and `get_all_sources` explore project metadata. Several older detail tools are deprecated in favor of `get_node_details`.
- SQL: — `execute_sql` and `text_to_sql`. These are disabled by default on self-hosted; `execute_sql` needs a personal access token, and `text_to_sql` is the only tool that consumes dbt Copilot actions.
- Codegen: — `generate_source`, `generate_model_yaml` and `generate_staging_model` (off by default; requires the dbt-codegen package).
Overview
What is dbt?
The dbt MCP server is the official Model Context Protocol server from dbt Labs that gives AI agents context and tools for your dbt project across dbt Core, dbt Fusion and the dbt platform: lineage, model metadata, Semantic Layer metrics, dbt CLI commands and job management.
It comes in two forms. The self-hosted server runs on your machine with uvx dbt-mcp and suits development work such as authoring models, tests and docs. The remote server is hosted by dbt at https://YOUR_DBT_HOST_URL/api/ai/v1/mcp and suits consumption work such as querying metrics, exploring metadata and viewing lineage, with no install.
How to use dbt?
Self-hosted prerequisites: install uv, and have a local dbt project if you want CLI tools. You don't need to clone the dbt-mcp repository. For dbt platform features, you need your access URL (for example abc123.us1.dbt.com) and either OAuth or a token.
Key environment variables: DBT_PROJECT_DIR (folder containing dbt_project.yml) and DBT_PATH (full path to your dbt executable; find it with which dbt) for CLI use; DBT_HOST, DBT_TOKEN, DBT_PROD_ENV_ID and, for the Admin API or PAT auth, DBT_ACCOUNT_ID for the platform.
Claude Desktop
The quickest route is the dbt-mcp.mcpb bundle: download it from the latest GitHub release, double-click it to open in Claude Desktop, enter your dbt platform host and enable the server. For a manual setup, open Settings > Developer > Edit Config and add:
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/your/dbt/executable",
"DBT_HOST": "YOUR-ACCESS-URL"
}
}
}
}
Omit DBT_HOST for CLI-only use, or omit the two CLI variables for platform-only use. To use the remote server, add a custom connector under Chat > Customize > Connectors with your MCP URL and complete the OAuth flow.
Claude Code
Connect to the remote server:
claude mcp add --transport http dbt https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/
For token-based auth, use a project .mcp.json with headers:
{
"mcpServers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/",
"headers": {
"Authorization": "Token YOUR_DBT_ACCESS_TOKEN",
"x-dbt-prod-environment-id": "DBT_PROD_ENV_ID"
}
}
}
}
Cursor and VS Code
dbt publishes integration guides for both. The self-hosted uvx dbt-mcp block above works as the mcpServers entry in Cursor's mcp.json; in VS Code, the same command and env go under servers in .vscode/mcp.json.
Key features of dbt
- Official, open-source server from dbt Labs (Apache-2.0)
- Works with dbt Core, dbt Fusion and the dbt platform
- Self-hosted via
uvx dbt-mcp, or remote over HTTP with OAuth or token headers - Lineage and model health from the Discovery API, including column-level lineage
- Semantic Layer queries for metrics, dimensions and saved queries
- dbt CLI commands such as
build,run,testandcompile(self-hosted only) - Admin API tools to list, trigger, cancel and retry job runs
- Fine-grained control with
DISABLE_*variables orx-dbt-disable-toolsheaders
dbt tools
Tools are grouped into toolsets that you can turn on or off:
- Discovery:
get_all_models,get_lineage,get_node_details,get_model_healthandget_all_sourcesexplore project metadata. Several older detail tools are deprecated in favor ofget_node_details. - Semantic Layer:
list_metrics,get_dimensions,query_metricsandget_metrics_compiled_sql. - SQL:
execute_sqlandtext_to_sql. These are disabled by default on self-hosted;execute_sqlneeds a personal access token, andtext_to_sqlis the only tool that consumes dbt Copilot actions. - dbt CLI:
build,compile,run,test,show,parse,listanddocs. These can modify your models and warehouse objects. - Admin API:
list_jobs,trigger_job_run,get_job_run_error,retry_job_runandcancel_job_run. - Codegen:
generate_source,generate_model_yamlandgenerate_staging_model(off by default; requires the dbt-codegen package). - dbt LSP and docs:
get_column_lineage,fusion.compile_sql, andsearch_product_docsfor docs.getdbt.com.
Use cases of dbt
- Impact analysis: "What models are downstream of stg_orders, and which dashboards depend on them?"
- Metric questions: "What is the total revenue for the last 30 days?" answered through the Semantic Layer.
- Debugging jobs: "Why did last night's production job fail? Show the error and retry it."
- Development: "Generate a staging model and YAML for the raw.payments source, then run its tests."
- Model health checks: "Which mart models have failing tests or stale sources?"
- Docs lookups: "Search the dbt docs for how incremental models handle schema changes."
Frequently asked questions
1 Is the dbt MCP server official?
Yes. It is built by dbt Labs in the dbt-labs/dbt-mcp repository and documented at docs.getdbt.com.
2 Is dbt MCP free?
The self-hosted server is open source under Apache-2.0. The remote server is available on all dbt platform plans, but the tools you get depend on the APIs your plan includes, and text_to_sql uses your dbt Copilot action allotment.
3 Do I need a dbt platform account?
No. With only DBT_PROJECT_DIR and DBT_PATH, the self-hosted server works with a local dbt Core or Fusion project. Platform features such as the Semantic Layer, Discovery and Admin API need a dbt platform account.
4 Which token does the dbt MCP server need?
A personal access token or service token from the dbt platform, sent as DBT_TOKEN or an Authorization: Token ... header. execute_sql requires a personal access token. OAuth is an alternative for accounts with static subdomains.
5 Does it work with Claude Code, Cursor and VS Code?
Yes. dbt documents Claude Code (claude mcp add --transport http dbt ...), Claude Desktop, Cursor and VS Code.
6 Can the agent change my data?
The dbt CLI tools can run models, builds and tests that modify data models and warehouse objects. dbt advises enabling them only for clients you trust; you can turn them off with DISABLE_DBT_CLI=true.
7 Does the remote server run dbt commands?
No. The remote dbt MCP server does not support CLI commands such as dbt run, dbt build or dbt test. Use the self-hosted server for those.
8 Does dbt MCP store my data?
dbt states the MCP server stores no production data or job results. It reads from the dbt platform in real time, so retention follows your platform policy.
Videos
Tutorials, guides, and showcases related to dbt MCP Server. The player loads when you press play.
Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In