docs/features/feature-guides/ask-datahub-plugins/dbt.md
import FeatureAvailability from '@site/src/components/FeatureAvailability';
Note: Ask DataHub Plugins is currently in Private Beta. To enable this feature, please reach out to your DataHub customer support representative.
The dbt Cloud Plugin connects Ask DataHub to your dbt Cloud environment via the dbt remote MCP server, giving the AI assistant visibility into job runs, model definitions, test results, and — with the right configuration — the ability to execute SQL queries on behalf of users.
With the dbt Cloud plugin enabled, Ask DataHub can:
Example prompts:
Follow the dbt remote MCP setup guide to enable the remote MCP server for your dbt Cloud project.
You'll need the following from dbt Cloud:
MCP Server URL: Construct the URL using your dbt Cloud host:
https://<YOUR_DBT_HOST_URL>/api/ai/v1/mcp/
For multi-cell accounts, the host URL is in the format ACCOUNT_PREFIX.us1.dbt.com. See dbt's regions documentation for details.
Production Environment ID: Navigate to Orchestration > Environments in dbt Cloud. Copy the environment ID from the URL.
<p align="center"> </p>API Token: Generate a personal access token or service token. The token needs Semantic Layer and Developer permissions.
| Field | Value |
|---|---|
| Name | dbt Cloud |
| Description | A description for the plugin |
| MCP Server URL | https://<YOUR_DBT_HOST_URL>/api/ai/v1/mcp/ |
| Production Environment ID | Your production environment ID from Step 2 |
| Option | How it works | Best for |
|---|---|---|
| Shared API Key | Admin enters a single service token used for all users | Centralized access with one service account |
| User API Key | Each user provides their own personal access token when connecting | Per-user audit trails and access control |
To let Ask DataHub execute SQL queries through dbt, provide the following additional fields:
| Field | Description |
|---|---|
| Development Environment ID | Your dbt Cloud development environment ID (found on the Orchestration > Environments page) |
| User ID | Your dbt Cloud user ID (found in the URL at Settings > Users in dbt Cloud) |
:::caution If using a Shared API Key, the user ID is shared across all users — meaning queries will execute under a single identity. With User API Key auth, each user provides their own user ID when connecting. :::
You can find your dbt Cloud user ID in the URL when navigating to Settings > Users and selecting your profile:
<p align="center"> </p>Each user also needs development credentials configured in dbt Cloud (warehouse connection under their profile) for SQL execution to work.
Navigate to Settings > My AI Settings and find the dbt Cloud plugin. If using User API Key auth, click Connect and enter your dbt Cloud API token and user ID. If using Shared API Key auth, simply toggle the plugin on. See the overview for more details.
<p align="center"> </p>:::info dbt Copilot Credits
Only the text_to_sql tool consumes dbt Copilot credits. Other MCP tools (metadata discovery, semantic layer queries) do not. See dbt's documentation for details.
:::