Skip to main content

Connect dbt MCP server to dbt platform

This quickstart uses the local MCP server: it runs on your machine using uvx dbt-mcp, connects to your dbt platform for Semantic Layer, Discovery, and SQL, and optionally runs local dbt.

For self-hosted CLI only (with or without a dbt platform account), see Run self-hosted dbt or Run self-hosted dbt Wizard.

To configure or disable specific tools, see the Environment variables reference.

Prerequisites​

Step 1: Choose your auth method and configure​

MCP OAuth is available in public beta for Starter, Enterprise, and Enterprise+ accounts.

OAuth is the fastest setup for dbt platform accounts, no tokens to copy or manage. A browser window opens to authenticate the first time you connect.

For OAuth without a self-hosted installation, use the remote MCP server. Remote MCP OAuth is available in public beta for Starter, Enterprise, and Enterprise+ accounts. If your client does not support OAuth or you need token-based access, use token-based authentication.

Static subdomains required

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.

Find your Access URL​

  1. Log in to your dbt platform account.
  2. Go to Account settings and copy your Access URL (for example, abc123.us1.dbt.com).
Multi-cell and DBT_HOST format
  • The DBT_HOST field accepts both abc123.us1.dbt.com and https://abc123.us1.dbt.com.

  • If your Access URL is abc123.us1.dbt.com, split it into two variables:

Add the config to your MCP client​

Option A: Quick install (recommended)

  1. Go to the latest dbt MCP release and download dbt-mcp.mcpb.
  2. Double-click the file to open it in Claude Desktop.
  3. Enter your Access URL as the dbt platform Host.
  4. Enable the server.

Option B: Manual config

  1. In Claude Desktop, go to Settings → Developer tab → Edit Config.
  2. Paste the following configuration, replacing YOUR-ACCESS-URL with your Access URL:
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_HOST": "YOUR-ACCESS-URL"
}
}
}
}
  1. Save and restart Claude Desktop.

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Optional: Add self-hosted dbt CLI commands​

To also run dbt platform CLI commands (dbt run, dbt build, dbt test, and more), add these two variables to your env block:

"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/your/dbt/executable"

Find DBT_PATH by running which dbt (macOS/Linux) or where dbt (Windows). DBT_PROJECT_DIR is the folder containing your dbt_project.yml.

Step 2: Authenticate​

The first time you connect, dbt MCP opens a browser window to complete OAuth. After signing in, your session is saved and future connections are automatic.

If authentication doesn't start, close your client and run:

  • macOS/Linux: rm -f ~/.dbt/mcp.yml ~/.dbt/mcp.lock
  • Windows: Remove-Item -Force $env:USERPROFILE\.dbt\mcp.yml, $env:USERPROFILE\.dbt\mcp.lock

Then restart your client.

Step 3: Test your setup​

Ask your AI assistant a data-related question (for example, "What models are in my dbt project?" or "What metrics are defined in my Semantic Layer?"). If dbt MCP is working, the response will use your dbt metadata.

What's available​

With the platform setup, your AI assistant can use:

  • Semantic Layer queries
  • Metadata Discovery (model lineage, test results, source freshness)
  • Admin API (trigger jobs, list runs, get artifacts)
  • SQL execution and text-to-SQL (requires a PAT)
  • All dbt commands if you added DBT_PROJECT_DIR and DBT_PATH

For the complete tool list, see Available tools.

Looking for self-hosted dbt CLI only?

If you only need to run dbt commands locally (with or without a dbt platform account), see Run self-hosted dbt.

Troubleshooting​

Can't find the uvx executable
OAuth login not initiating
Server not starting
execute_sql tool not working
Toolset unavailable or showing as disabled
Pasting full URLs instead of IDs
Multi-cell or static subdomain account connection issues

For all troubleshooting topics, see dbt MCP FAQs and troubleshooting.

Next steps​

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading