configuring-dbt-mcp-server
Generates MCP server configuration JSON, resolves authentication setup, and validates server connectivity for dbt. Use when setting up, configuring, or troubleshooting the dbt MCP server for AI tools like Claude Desktop, Claude Code, Cursor, or VS Code.
- 0
- Installs
- —
- Rating
- —
- Success rate
- 4
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 2f4b949b0bf1003a… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Configure dbt MCP Server
Overview
The dbt MCP server connects AI tools to dbt's CLI, Semantic Layer, Discovery API, and Admin API. This skill guides users through setup with the correct configuration for their use case.
Decision Flow
flowchart TB
start([User wants dbt MCP]) --> q1{Local or Remote?}
q1 -->|dev workflows,<br>CLI access needed| local[Local Server<br>uvx dbt-mcp]
q1 -->|consumption only,<br>no local install| remote[Remote Server<br>HTTP endpoint]
local --> q2{Which client?}
remote --> q2
q2 --> claude_desktop[Claude Desktop]
q2 --> claude_code[Claude Code]
q2 --> cursor[Cursor]
q2 --> vscode[VS Code]
claude_desktop --> config[Generate config<br>+ test setup]
claude_code --> config
cursor --> config
vscode --> config
Questions to Ask
1. Server Type
Ask: "Do you want to use the local or remote dbt MCP server?"
| Local Server | Remote Server |
|---|---|
Runs on your machine via uvx | Connects via HTTP to dbt platform |
| Required for development (authoring models, tests, docs) but can also connect to the dbt platform for consumption (querying metrics, exploring metadata) | Best for consumption (querying metrics, exploring metadata) |
| Supports dbt CLI commands (run, build, test, show) | No CLI commands (run, build, test) |
| Works without a dbt platform account but can also connect to the dbt platform for development (authoring models, tests, docs) | Requires dbt platform account |
| No credit consumption | Consumes dbt Copilot credits |
2. MCP Client
Ask: "Which MCP client are you using?"
- Claude Desktop
- Claude Code (CLI)
- Cursor
- VS Code
3. Use Case (Local Server Only)
Ask: "What's your use case?"
| CLI Only | Platform Only | Platform + CLI |
|---|---|---|
| dbt Core/Fusion users | dbt Cloud without local project | Full access to both |
| No platform account needed | OAuth or token auth | Requires paths + credentials |
4. Tools to Enable
Ask: "Which tools do you want enabled?" (show defaults)
| Tool Category | Default | Environment Variable |
|---|---|---|
| dbt CLI (run, build, test, compile) | Enabled | DISABLE_DBT_CLI=true to disable |
| Semantic Layer (metrics, dimensions) | Enabled | DISABLE_SEMANTIC_LAYER=true to disable |
| Discovery API (models, lineage) | Enabled | DISABLE_DISCOVERY=true to disable |
| Admin API (jobs, runs) | Enabled | DISABLE_ADMIN_API=true to disable |
| SQL (text_to_sql, execute_sql) | Disabled | DISABLE_SQL=false to enable |
| Codegen (generate models/sources) | Disabled | DISABLE_DBT_CODEGEN=false to enable |
Prerequisites
Local Server
- Install
uv: https://docs.astral.sh/uv/getting-started/installation/ - Have a dbt project (for CLI commands)
- Find paths:
DBT_PROJECT_DIR: Folder containingdbt_project.yml- macOS/Linux:
pwdfrom project folder - Windows: Full path with forward slashes (e.g.,
C:/Users/name/project)
- macOS/Linux:
DBT_PATH: Path to dbt executable- macOS/Linux:
which dbt - Windows:
where dbt
- macOS/Linux:
Remote Server
- dbt Cloud account with AI features enabled
- Production environment ID (from Orchestration page)
- Personal access token or service token
See How to Find Your Credentials for detailed guidance on obtaining tokens and IDs.
Credential Security
- Always use environment variable references (e.g.,
${DBT_TOKEN}) instead of literal token values in configuration files that may be committed to version control - Never log, display, or echo token values in terminal output
- When using
.envfiles, ensure they are added to.gitignoreto prevent accidental commits - Recommend users rotate tokens regularly and use the minimum required permission set
Configuration Templates
Local Server - CLI Only
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}
Local Server - Platform + CLI (OAuth)
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_HOST": "https://your-subdomain.us1.dbt.com",
"DBT_PROJECT_DIR": "/path/to/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}
Local Server - Platform + CLI (Token Auth)
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_HOST": "cloud.getdbt.com",
"DBT_TOKEN": "${DBT_TOKEN}",
"DBT_ACCOUNT_ID": "${DBT_ACCOUNT_ID}",
"DBT_PROD_ENV_ID": "${DBT_PROD_ENV_ID}",
"DBT_PROJECT_DIR": "/path/to/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}
Local Server - Using .env File
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["--env-file", "/path/to/.env", "dbt-mcp"]
}
}
}
.env file contents:
DBT_HOST=cloud.getdbt.com
DBT_TOKEN=<set-via-env-or-secret-manager>
DBT_ACCOUNT_ID=<your-account-id>
DBT_PROD_ENV_ID=<your-prod-env-id>
DBT_DEV_ENV_ID=<your-dev-env-id>
DBT_USER_ID=<your-user-id>
DBT_PROJECT_DIR=/path/to/project
DBT_PATH=/path/to/dbt
Remote Server
{
"mcpServers": {
"dbt": {
"url": "https://cloud.getdbt.com/api/ai/v1/mcp/",
"headers": {
"Authorization": "Token ${DBT_TOKEN}",
"x-dbt-prod-environment-id": "${DBT_PROD_ENV_ID}"
}
}
}
}
Additional headers for SQL/Fusion tools:
{
"headers": {
"Authorization": "Token ${DBT_TOKEN}",
"x-dbt-prod-environment-id": "${DBT_PROD_ENV_ID}",
"x-dbt-dev-environment-id": "${DBT_DEV_ENV_ID}",
"x-dbt-user-id": "${DBT_USER_ID}"
}
}
Client-Specific Setup
Claude Desktop
- Click Claude menu in system menu bar (not in-app)
- Select Settings...
- Go to Developer tab
- Click Edit Config
- Add the JSON configuration
- Save and restart Claude Desktop
- Verify: Look for MCP server indicator in bottom-right of input box
Config location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Claude Code (CLI)
Run:
claude mcp add dbt -s user -- uvx dbt-mcp
This adds the server to your user scope/config (on this system: ~/.claude.json).
For a project-specific setup, run:
claude mcp add dbt -s project -- uvx dbt-mcp
This adds the server to .mcp.json in your project root.
Alternatively, you can use the manual configuration below.
Manual configuration:
Edit ~/.claude.json (user scope) or create .mcp.json (project scope) in your project root:
~/.claude.json: Global across all projects.mcp.json: Project-specific, can be committed to version control for team sharing. If using token auth, use environment variable references — never commit literal tokens.
For project-specific dbt setups, use .mcp.json so your team shares the same configuration.
Once the config is created, make sure to add the JSON configuration under the mcpServers key.
Cursor
- Open Cursor menu → Settings → Cursor Settings → MCP
- Add the JSON configuration
- Update paths and credentials
- Save
VS Code
- Open Command Palette (Cmd/Ctrl + Shift + P)
- Run "MCP: Open User Configuration" (or Workspace for project-specific)
- Add the JSON configuration (note: VS Code uses
serversnotmcpServers):
{
"servers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}
- Open Settings → Features → Chat → Enable MCP
- Verify: Run "MCP: List Servers" from Command Palette
WSL Users: Configure in Remote settings, not local user settings:
- Run "Preferences: Open Remote Settings" from Command Palette
- Use full Linux paths (e.g.,
/home/user/project, not Windows paths)
Verification Steps
Test Local Server Config
Recommended: Use .env file
- Create a .env file in your project root directory and add minimum environment variables for the CLI tools:
DBT_PROJECT_DIR=/path/to/project
DBT_PATH=/path/to/dbt
- Test the server:
uvx --env-file .env dbt-mcp
Alternative: Environment variables
# Temporary test (variables only last for this session)
export DBT_PROJECT_DIR=/path/to/project
export DBT_PATH=/path/to/dbt
uvx dbt-mcp
No errors = successful configuration.
Verify in Client
After setup, ask the AI:
- "What dbt tools do you have access to?"
- "List my dbt metrics" (if Semantic Layer enabled)
- "Show my dbt models" (if Discovery enabled)
See Troubleshooting for common issues and fixes.
See Environment Variable Reference for the full list of supported variables.
Files
4- SKILL.md
67e5edc81410.2 KB - references/environment-variables.md
9184114502871 B - references/finding-credentials.md
07ebffe9c52.7 KB - references/troubleshooting.md
3bdaf933311.4 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from dbt-labs/dbt-agent-skills8
Creates unit test YAML definitions that mock upstream model inputs and validate expected outputs. Use when adding unit tests for a dbt model or practicing test-driven development (TDD) in dbt.
Writes and executes SQL queries against the data warehouse using dbt's Semantic Layer or ad-hoc SQL to answer business questions. Use when a user asks about analytics, metrics, KPIs, or data (e.g., "What were total sales last quarter?", "Show me top customers by revenue"). NOT for validating, testin
Use when creating or modifying dbt Semantic Layer components — semantic models, metrics, dimensions, entities, measures, or time spines. Covers MetricFlow configuration, metric types (simple, derived, cumulative, ratio, conversion), and validation for both latest and legacy YAML specs.
Generates a Mermaid flowchart diagram of dbt model lineage using MCP tools, manifest.json, or direct code parsing as fallbacks. Use when visualizing dbt model lineage and dependencies as a Mermaid diagram in markdown format.
Retrieves and searches dbt documentation pages in LLM-friendly markdown format. Use when fetching dbt documentation, looking up dbt features, or answering questions about dbt Cloud, dbt Core, or the dbt Semantic Layer.
Audits dbt documentation coverage and drafts missing model/column descriptions in the project's own house style, one folder at a time, for human review. Use when documenting undocumented models, backfilling missing YAML descriptions, auditing doc coverage, or keeping schema YAML in sync with model S
Use when a user needs help triaging dbt-core to dbt v2 migration errors. Runs dbt-autofix first, then classifies remaining errors into actionable categories (auto-fixable, guided fixes, needs input, blocked).
Use when migrating a dbt project from one data platform or data warehouse to another (e.g., Snowflake to Databricks, Databricks to Snowflake) using dbt Fusion's real-time compilation to identify and fix SQL dialect differences.
Related backend skillsscan passed
Configure input and output validation with .input() and .output() using Zod, Yup, Superstruct, ArkType, Valibot, Effect, or custom validator functions. Chain multiple .input() calls to merge object schemas. Standard Schema protocol support. Output validation returns INTERNAL_SERVER_ERROR on failure.
Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
Query live GPU inventory, submit an authenticated Itô fixed-rate RFQ, inspect RFQ or procurement status, revoke device credentials, and run explicitly gated node qualification through the separately installed canonical CLI. Use when a user asks to find H100/H200 capacity, request a fixed compute rat
Guide for upgrading Stripe API versions, webhook endpoints, server-side SDKs, Stripe.js, and mobile SDKs
Operates Amazon MSK Provisioned clusters (Standard and Express brokers). Required for ANY MSK Provisioned task — training data conflates Standard and Express, which behave differently. Covers performance, consumer lag, storage, traffic shaping; sizing Standard vs Express; Kafka client tuning; CloudW
Designs and improves fuzzing harnesses for C/C++ and Rust. Covers mapping raw bytes onto a target API, generating structured inputs, avoiding non-determinism and false crashes, and deciding what to fuzz together. Use when writing a first LLVMFuzzerTestOneInput or fuzz_target! harness, when a campaig