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.
What this skill does
# 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
```mermaid
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
1. **Install `uv`**: https://docs.astral.sh/uv/getting-started/installation/
2. **Have a dbt project** (for CLI commands)
3. **Find paths:**
- `DBT_PROJECT_DIR`: Folder containing `dbt_project.yml`
- macOS/Linux: `pwd` from project folder
- Windows: Full path with forward slashes (e.g., `C:/Users/name/project`)
- `DBT_PATH`: Path to dbt executable
- macOS/Linux: `which dbt`
- Windows: `where dbt`
### Remote Server
1. **dbt Cloud account** with AI features enabled
2. **Production environment ID** (from Orchestration page)
3. **Personal access token** or service token
See [How to Find Your Credentials](references/finding-credentials.md) 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 `.env` files, ensure they are added to `.gitignore` to prevent accidental commits
- Recommend users rotate tokens regularly and use the minimum required permission set
## Configuration Templates
### Local Server - CLI Only
```json
{
"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)
```json
{
"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)
```json
{
"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
```json
{
"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
```json
{
"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:**
```json
{
"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
1. Click **Claude menu** in system menu bar (not in-app)
2. Select **Settings...**
3. Go to **Developer** tab
4. Click **Edit Config**
5. Add the JSON configuration
6. Save and restart Claude Desktop
7. **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:
```bash
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:
```bash
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 — neverRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.