Use when setting up, configuring, or troubleshooting the dbt MCP server for AI tools like Claude Desktop, Claude Code, Cursor, or VS Code.
Install with Tessl CLI
npx tessl i github:dbt-labs/dbt-agent-skills --skill configuring-dbt-mcp-server84
Quality
83%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
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.
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 --> configAsk: "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 |
Ask: "Which MCP client are you using?"
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 |
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 |
uv: https://docs.astral.sh/uv/getting-started/installation/DBT_PROJECT_DIR: Folder containing dbt_project.yml
pwd from project folderC:/Users/name/project)DBT_PATH: Path to dbt executable
which dbtwhere dbt| Use Case | Token Type | Why |
|---|---|---|
| Personal development setup | Personal Access Token (PAT) | Inherits your permissions, works with all APIs including execute_sql |
| Shared team setup | Service Token | Multiple users, controlled permissions, separate from individual accounts |
| Using execute_sql tool | PAT (required) | SQL tools that require x-dbt-user-id need a PAT |
| CI/CD or automation | Service Token | System-level access, not tied to a person |
Notes:
Use service tokens for system-level integrations (CI/CD, automation) rather than user-specific access.
Permission sets for MCP:
Notes:
execute_sql — use PAT instead/accounts/Example: In https://cloud.getdbt.com/settings/accounts/12345/..., the Account ID is 12345
Alternative: Go to Settings → Account Settings and check the URL.
URL pattern: https://cloud.getdbt.com/deploy/<account_id>/projects/<project_id>/environments/<environment_id>
Example: In .../environments/98765, the Environment ID is 98765
/users/ is your User IDExample: In https://cloud.getdbt.com/settings/accounts/12345/users/67891, the User ID is 67891
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}{
"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"
}
}
}
}{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_HOST": "cloud.getdbt.com",
"DBT_TOKEN": "your-token",
"DBT_ACCOUNT_ID": "your-account-id",
"DBT_PROD_ENV_ID": "your-prod-env-id",
"DBT_PROJECT_DIR": "/path/to/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["--env-file", "/path/to/.env", "dbt-mcp"]
}
}
}.env file contents:
DBT_HOST=cloud.getdbt.com
DBT_TOKEN=your-token
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{
"mcpServers": {
"dbt": {
"url": "https://cloud.getdbt.com/api/ai/v1/mcp/",
"headers": {
"Authorization": "Token your-token",
"x-dbt-prod-environment-id": "your-prod-env-id"
}
}
}
}Additional headers for SQL/Fusion tools:
{
"headers": {
"Authorization": "Token your-token",
"x-dbt-prod-environment-id": "your-prod-env-id",
"x-dbt-dev-environment-id": "your-dev-env-id",
"x-dbt-user-id": "your-user-id"
}
}Config location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonRun:
claude mcp add dbt -s user -- uvx dbt-mcpThis 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-mcpThis 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, committed to version control for team sharingFor 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.
servers not mcpServers):{
"servers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/project",
"DBT_PATH": "/path/to/dbt"
}
}
}
}WSL Users: Configure in Remote settings, not local user settings:
/home/user/project, not Windows paths)Recommended: Use .env file
DBT_PROJECT_DIR=/path/to/project
DBT_PATH=/path/to/dbtuvx --env-file .env dbt-mcpAlternative: 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-mcpNo errors = successful configuration.
After setup, ask the AI:
Find full path and use it in config:
# macOS/Linux
which uvx
# Use output like: /opt/homebrew/bin/uvx
# Windows
where uvxUpdate config:
{
"command": "/opt/homebrew/bin/uvx",
"args": ["dbt-mcp"]
}uvx is installed: uvx --versionls $DBT_PROJECT_DIR/dbt_project.yml$DBT_PATH --versionOnly accounts with static subdomains (e.g., abc123.us1.dbt.com) support OAuth. Check your Access URLs in dbt platform settings.
execute_sql: Use personal access token, not service token| Mistake | Fix |
|---|---|
| Using npm/npx instead of uvx | The package is dbt-mcp via uvx, not npm |
| Wrong env var names (DBT_CLOUD_*) | Use DBT_TOKEN, DBT_PROD_ENV_ID, etc. |
Using mcpServers in VS Code | VS Code uses servers key in mcp.json |
| Service token for execute_sql | Use personal access token for SQL tools |
| Windows paths in WSL | Use Linux paths (/home/...) not Windows |
| Local user settings in WSL | Must use Remote settings in VS Code |
Missing uv installation | Install uv first: https://docs.astral.sh/uv/ |
| Variable | Required For | Description |
|---|---|---|
DBT_PROJECT_DIR | CLI commands | Path to folder with dbt_project.yml |
DBT_PATH | CLI commands | Path to dbt executable |
DBT_HOST | Platform access | Default: cloud.getdbt.com |
DBT_TOKEN | Platform (non-OAuth) | Personal or service token |
DBT_ACCOUNT_ID | Admin API | Your dbt account ID |
DBT_PROD_ENV_ID | Platform access | Production environment ID |
DBT_DEV_ENV_ID | SQL/Fusion tools | Development environment ID |
DBT_USER_ID | SQL/Fusion tools | Your dbt user ID |
MULTICELL_ACCOUNT_PREFIX | Multi-cell accounts | Account prefix (exclude from DBT_HOST) |
DBT_CLI_TIMEOUT | CLI commands | Timeout in seconds (default: 60) |
DBT_MCP_LOG_LEVEL | Debugging | DEBUG, INFO, WARNING, ERROR, CRITICAL |
65d2e0b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.