Integrate Claude with dbt MCP
Claude is an AI assistant from Anthropic with two primary interfaces:
- Claude for desktop: A GUI with MCP support for file access and commands as well as basic coding features
- Claude Code: A terminal/IDE tool for development
Claude Desktop
Only accounts with static subdomains (for example, abc123 in abc123.us1.dbt.com) can use OAuth with MCP servers. Follow these instructions to find your account subdomain. If your account does not have a subdomain, contact support for more information.
To configure Claude Desktop to use the dbt MCP server:
- Go to the latest dbt MCP release and download the
dbt-mcp.mcpbfile. - Double-click the downloaded file to open it in Claude Desktop.
- Configure the dbt Platform Host. You can find this in your dbt platform account by navigating to Account settings and copying the Access URL.
- Enable the server in Claude Desktop.
- Ask Claude a data-related question and see dbt MCP in action!
Advanced configuration with Claude Desktop
To add advanced configurations:
-
Go to the Claude settings and select Settings….
-
In the Settings window, navigate to the Developer tab in the left sidebar. This section contains options for configuring MCP servers and other developer features.
-
Click the Edit Config button and open the configuration file with a text editor.
-
Add your server configuration based on your use case. Choose the correct JSON structure from the following options:
-
Save the file. Upon a successful restart of Claude Desktop, you'll see an MCP server indicator in the bottom-right corner of the conversation input box.
For debugging, you can find the Claude desktop logs at ~/Library/Logs/Claude for Mac or %APPDATA%\Claude\logs for Windows.
Claude Code
You can set up Claude Code with both the local and remote dbt-mcp server. We recommend using the local dbt-mcp for more developer-focused workloads. See the About MCP page for more more information about local and remote server features.
Set up with local dbt MCP server
Prerequisites:
- Complete the local MCP setup.
- Know your configuration method (OAuth or environment variables)
In your Claude Code set up, run one of these commands based on your use case. Be sure to update the commands for your specific needs:
- CLI only
- OAuth with dbt platform
For dbt Core or Fusion only (no dbt platform account):
claude mcp add dbt \
-e DBT_PROJECT_DIR=/path/to/your/dbt/project \
-e DBT_PATH=/path/to/your/dbt/executable \
-- uvx dbt-mcp
For OAuth authentication (requires static subdomain). Find your static subdomain here:
claude mcp add dbt \
-e DBT_HOST=your-host-with-subdomain \
-e DBT_PROJECT_DIR=/path/to/your/dbt/project \
-e DBT_PATH=/path/to/your/dbt/executable \
-- uvx dbt-mcp
Replacing your-host-with-subdomain, path/to/your/dbt/project, and path/to/your/dbt/executable with your actual static subdomain, project path, and dbt executable path.
For example, if your static subdomain is abc123.us1.dbt.com, your command would look like this:
claude mcp add dbt \
-e DBT_HOST=abc123.us1.dbt.com \ ## this is the static subdomain
-e DBT_PROJECT_DIR=/path/to/your/dbt/project \
-e DBT_PATH=/path/to/your/dbt/executable \
-- uvx dbt-mcp
Using an .env file
If you prefer to manage environment variables in a separate file, you can use the --env-file parameter from uvx:
claude mcp add dbt -- uvx --env-file <path-to-.env-file> dbt-mcp
Replace <path-to-.env-file> with the full path to your .env file.
Troubleshooting
- Claude desktop may return errors such as
Error: spawn uvx ENOENTorCould not connect to MCP server dbt-mcp. Try replacing the command and environment variables file path with the full path. Foruvx, find the full path touvxby runningwhich uvxon Unix systems and placing this full path in the JSON. For instance:"command": "/the/full/path/to/uvx".
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.