Run dbt MCP server locally
This quickstart walks you through connecting dbt MCP server to your local dbt project. This setup gives you dbt CLI tools (run, build, test, compile, and more) inside your AI assistant. If you'd like to connect to dbt platform with the CLI, see the OAuth quickstart.
You don't need to clone the dbt-mcp repository. Install uv and run uvx dbt-mcp — it fetches and runs dbt-mcp for you.
Prerequisites
- Install uv
- A local dbt project (the folder containing your
dbt_project.ymlfile) - dbt installed locally (, dbt Fusion engine, or dbt CLI)
For the full list of environment variables and how to enable or disable toolsets, see the Environment variables reference.
Step 1: Find your paths
You need two values before configuring your MCP client:
DBT_PROJECT_DIR— the full path to your dbt project folder (wheredbt_project.ymllives). For example, if your project name isjaffle_shop, the path should be/Users/yourname/dbt-projects/jaffle_shop.DBT_PATH— the full path to your dbt executable.
- macOS/Linux
- Windows
# Find DBT_PATH
which dbt
# Example output: /opt/homebrew/bin/dbt
# Find DBT_PROJECT_DIR — run from inside your project folder
pwd
# Example output: /Users/yourname/projects/my_dbt_project
# Find DBT_PATH
where dbt
# Example output: C:\Python39\Scripts\dbt.exe
# Find DBT_PROJECT_DIR — run from inside your project folder
cd
# Example output: C:\Users\yourname\projects\my_dbt_project
Note: Use forward slashes in your configuration: C:/Python39/Scripts/dbt.exe
Step 2: Add to your MCP client
Replace the paths below with the values from Step 1:
- Claude Desktop
- Claude Code
- Cursor
- VS Code
- In Claude Desktop, go to Settings → Developer tab → Edit Config.
- Paste the following configuration, replacing the paths with your actual values:
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/your/dbt/executable"
}
}
}
}
- Save and restart Claude Desktop.
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Run this command, replacing the paths with your actual values:
claude mcp add dbt \
-e DBT_PROJECT_DIR=/path/to/your/dbt/project \
-e DBT_PATH=/path/to/your/dbt/executable \
-- uvx dbt-mcp
Click the link below with Cursor open to auto-configure:
After clicking:
- Update
DBT_PROJECT_DIRwith the full path to your dbt project. - Update
DBT_PATHwith the full path to your dbt executable (from Step 1). - Save the configuration.
- Open Settings → Features → Chat and ensure MCP is enabled.
- Open the Command Palette (
Ctrl/Cmd + Shift + P) and select MCP: Open User Configuration. - Add the following configuration to
mcp.json, replacing the paths with your actual values:
"servers", not "mcpServers"{
"servers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/your/dbt/executable"
}
}
}
}
- Save the file.
Step 3: Test your setup
Ask your AI assistant to run a dbt command (for example, "Run dbt compile on my project" or "List all models in my project"). If dbt MCP is working, the assistant will execute the command against your local project.
What's available
With CLI-only setup, your AI assistant can use:
dbt run,dbt build,dbt test,dbt compile,dbt list,dbt parse,dbt show- Model lineage and node details from your local project
- Codegen tools (when enabled — see Environment variables reference)
Platform features like Semantic Layer, Discovery API, and metadata queries require a dbt platform account. To add them, see Connect to dbt platform.
Troubleshooting
For all troubleshooting topics, see MCP troubleshooting.
Next steps
- Add dbt platform features: see Connect to dbt platform
- Configure toolsets or disable specific tools: see the Environment variables reference
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.