Integrate Claude with dbt MCP
Claude is an AI assistant from Anthropic with two primary interfaces:
- Claude Desktop: A GUI with MCP support for file access and commands, plus basic coding features.
- Claude Code: A terminal/IDE tool for development.
Both interfaces can connect to either:
- Local dbt MCP server (runs on your machine, supports CLI commands like
dbt run) - Remote dbt MCP server (HTTP, no install, consumption-focused).
Prerequisites
- You use Claude for AI or agentic work
- For OAuth (local or remote), use your access URL with a static subdomain.
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.
Claude Desktop
Claude Desktop reads MCP servers from claude_desktop_config.json. Open it from Settings → Developer → Edit Config.
Set up with local dbt MCP server
For a fast first install, you can download the prebuilt .mcpb file; for more control, edit the JSON directly.
You don't need to clone the dbt-mcp repository — for local setups, install uv and run uvx dbt-mcp (or use the configs later in this page). Only clone the repository if you want to contribute to dbt MCP.
Quick install with the .mcpb file
- 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 config with Claude Desktop
Use advanced configuration when you want to define the dbt MCP server yourself in Claude's configuration file — the same JSON where Claude stores every MCP server, under mcpServers, with fields like command, args, and env. See the MCP install pattern for the underlying convention.
To open the configuration file and add or replace the dbt MCP server entry:
-
From Claude, go to Settings…
-
In the Settings window, select the Developer tab.
-
Click Edit Config and open the file in a text editor.
-
Add your server configuration under
mcpServers. Choose the option that fits your use case: -
Save the file and restart Claude Desktop. You'll see an MCP server indicator in the bottom-right corner of the conversation input box.
For more configuration options (env vars, service tokens, tool-access controls), refer to Set up local MCP.
Set up with remote dbt MCP server
The remote dbt MCP server runs in dbt platform — no uvx or local install needed. Claude Desktop connects to it over HTTP.
Remote MCP OAuth is available for Enterprise and Enterprise+ accounts. Contact your account manager to join the private beta.
-
From Claude Desktop, go to Settings → Developer → Edit Config to open
claude_desktop_config.json. -
Get your MCP URL:
You can copy your full MCP URL from Account settings → Access URLs → MCP Endpoint URL in dbt platform, and paste it directly into your AI tool.
-
Add a
dbtentry undermcpServers, using the tab that matches your auth method:- OAuth (remote)
- Token-based
OAuth is in private beta for Enterprise and Enterprise+ accounts.
Before you connect
- Your MCP client must support OAuth for HTTP-based MCP servers. If it doesn't, use token-based authentication instead.
- On first connect, your client opens a browser for sign-in. dbt then shows a consent screen with the scopes (the specific permissions the client is allowed to use) it's requesting — see Scopes and consent for what each scope means.
- Most modern MCP clients self-register on first connect via dynamic registration (RFC 7591). Clients that don't support it need an admin to register them in Account settings → Integrations → App integrations. See Manual registration.
For the full flow, sessions, and limitations, refer to OAuth (remote MCP).
Add the following to
claude_desktop_config.json. Claude Desktop opens a browser for sign-in and consent the first time the server connects.{
"mcpServers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/"
}
}
}Replace
YOUR_DBT_HOST_URLwith your hostname (for example,abc123.us1.dbt.com). You can find the URL in dbt platform under Account settings → Access URLs → MCP Endpoint URL.Use token-based auth when your client doesn't yet support OAuth for HTTP MCP servers, or when you need a shared/CI setup.
{
"mcpServers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/",
"headers": {
"Authorization": "Token YOUR_DBT_ACCESS_TOKEN",
"x-dbt-prod-environment-id": "DBT_PROD_ENV_ID",
"x-dbt-user-id": "DBT_USER_ID",
"x-dbt-dev-environment-id": "DBT_DEV_ENV_ID"
}
}
}
}For token-based remote MCP, set these headers in your client's MCP config:
Authorization(required) —Token YOUR_DBT_ACCESS_TOKENorBearer YOUR_DBT_ACCESS_TOKEN. Use a personal access token (PAT) or a service token with at least Semantic Layer, Metadata, and Developer permissions.x-dbt-prod-environment-id(required) — your dbt platform production environment ID. Find it on the Orchestration page.x-dbt-dev-environment-id— required forexecute_sqland Fusion tools.x-dbt-user-id— required forexecute_sql. Refer to Find your user ID.
Use numeric IDs, not full URLsHeaders like
x-dbt-prod-environment-id,x-dbt-dev-environment-id, andx-dbt-user-idexpect numeric IDs (for example,54321), not full URLs copied from your browser. The host in theurlfield, on the other hand, must includehttps://.execute_sqldoes not work with service tokens — you must use a PAT. For the complete list of headers (including tool-disable options) and the full table, refer to Set up remote MCP. -
Save the file and restart Claude Desktop. Ask Claude a data question to confirm the server is connected.
Claude Code
Claude Code reads MCP servers from .mcp.json at the root of your project (the repository root for your workspace). If you already configured the dbt MCP server for another client, you can reuse the same JSON shape here — you don't need a second, separate registration.
Set up with local dbt MCP server
You don't need to clone the dbt-mcp repository — for local setups, install uv and run uvx dbt-mcp (or use the configs later in this page). Only clone the repository if you want to contribute to dbt MCP.
-
Follow Set up local MCP to choose your auth pattern:
- OAuth with the dbt platform
- CLI only
- Environment variables (including an
.envfile with--env-file)
-
Create
.mcp.jsonat the project root and add adbtentry under the top-levelmcpServerskey. Pick the option that fits your use case:
claude mcp addThe Claude Code CLI can register MCP servers with claude mcp add, but it typically writes to the user-level config (~/.claude.json) rather than the project's .mcp.json. For dbt MCP, we recommend committing .mcp.json to your repository so the setup is project-scoped and easier to share.
Set up with remote dbt MCP server
Claude Code can connect to the remote dbt MCP server over HTTP — same JSON shape as Claude Desktop, lives in .mcp.json instead of claude_desktop_config.json.
Remote MCP OAuth is available for Enterprise and Enterprise+ accounts. Contact your account manager to join the private beta.
-
Open
.mcp.jsonat the root of your project (create it if it doesn't exist). -
Get your MCP URL:
You can copy your full MCP URL from Account settings → Access URLs → MCP Endpoint URL in dbt platform, and paste it directly into your AI tool.
-
Add the
dbtentry to.mcp.jsonusing the tab that matches your auth method:- OAuth (remote)
- Token-based
OAuth is in private beta for Enterprise and Enterprise+ accounts.
Before you connect
- Your MCP client must support OAuth for HTTP-based MCP servers. If it doesn't, use token-based authentication instead.
- On first connect, your client opens a browser for sign-in. dbt then shows a consent screen with the scopes (the specific permissions the client is allowed to use) it's requesting — see Scopes and consent for what each scope means.
- Most modern MCP clients self-register on first connect via dynamic registration (RFC 7591). Clients that don't support it need an admin to register them in Account settings → Integrations → App integrations. See Manual registration.
For the full flow, sessions, and limitations, refer to OAuth (remote MCP).
Add the following to
.mcp.jsonat your project root. On first connect, Claude Code opens a browser for sign-in and consent.{
"mcpServers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/"
}
}
}Replace
YOUR_DBT_HOST_URLwith your hostname (for example,abc123.us1.dbt.com). You can find the URL in dbt platform under Account settings → Access URLs → MCP Endpoint URL.You can also register the same server from the CLI:
claude mcp add --transport http dbt https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/{
"mcpServers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/",
"headers": {
"Authorization": "Token YOUR_DBT_ACCESS_TOKEN",
"x-dbt-prod-environment-id": "DBT_PROD_ENV_ID",
"x-dbt-user-id": "DBT_USER_ID",
"x-dbt-dev-environment-id": "DBT_DEV_ENV_ID"
}
}
}
}For token-based remote MCP, set these headers in your client's MCP config:
Authorization(required) —Token YOUR_DBT_ACCESS_TOKENorBearer YOUR_DBT_ACCESS_TOKEN. Use a personal access token (PAT) or a service token with at least Semantic Layer, Metadata, and Developer permissions.x-dbt-prod-environment-id(required) — your dbt platform production environment ID. Find it on the Orchestration page.x-dbt-dev-environment-id— required forexecute_sqland Fusion tools.x-dbt-user-id— required forexecute_sql. Refer to Find your user ID.
Use numeric IDs, not full URLsHeaders like
x-dbt-prod-environment-id,x-dbt-dev-environment-id, andx-dbt-user-idexpect numeric IDs (for example,54321), not full URLs copied from your browser. The host in theurlfield, on the other hand, must includehttps://.execute_sqldoes not work with service tokens — you must use a PAT. For the complete list of headers (including tool-disable options) and the full table, refer to Set up remote MCP. -
Save the file. Claude Code picks up
.mcp.jsonon startup — ask it a data question to confirm the connection.
Troubleshooting
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.