-
Notifications
You must be signed in to change notification settings - Fork 441
Add dbt hosted MCP integration for Analytics #4279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sayapaz
wants to merge
14
commits into
main
Choose a base branch
from
ai_main_6eb768b7ed1e4dc08c3c
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3d06747
Add dbt hosted MCP integration preset for organizations
builderio-bot 10eda3b
Add dbt MCP integration documentation link
builderio-bot b0d875d
Update dbt MCP integration documentation URL
builderio-bot 850ee82
Expose dbt MCP capabilities in analytics data sources
builderio-bot 86942f5
Track unreadable dbt MCP status and preserve setup return path
builderio-bot 8fefa3b
Add shared dbt MCP connection card to analytics
builderio-bot 18857de
Fix dbt data source reconnection and admin controls
builderio-bot c8a2962
Add governed dbt analytics querying guidance
builderio-bot d955346
Enable direct shared dbt metadata connections in analytics
builderio-bot acb2055
Enforce restricted schema access and dbt catalog parity
builderio-bot 668c4e4
Harden BigQuery schema access and paginate dataset searches
builderio-bot 728f690
Harden BigQuery restricted schema identifier scanning
builderio-bot d9cc94c
Fix BigQuery scan handling for nested comment text
builderio-bot 184648e
Keep restricted schema guidance without enforced query blocking
builderio-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@agent-native/core": patch | ||
| --- | ||
|
|
||
| Add a dbt hosted MCP integration preset with organization-scoped manual setup for account-specific endpoints and service-token headers, including parity for source-ejected integration catalogs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- | ||
| name: dbt | ||
| description: >- | ||
| Governed dbt model, lineage, freshness, and Semantic Layer routing for analytics. | ||
| Use when a question depends on dbt models, sources, metrics, or warehouse SQL. | ||
| scope: runtime | ||
| --- | ||
|
|
||
| # dbt | ||
|
|
||
| dbt is authoritative for dbt model semantics, lineage, freshness, and governed metrics. Connected dbt MCP tools are dynamic: find them with `tool-search` when needed rather than assuming they are on the initial tool surface. | ||
|
|
||
| ## Decision Order | ||
|
|
||
| 1. Reuse a current certified query or dashboard when it already answers the request with the right definition, filters, grain, and time range. | ||
| 2. Before guessing a dbt table, grain, join, meaning, freshness, or lineage, use dbt Discovery. Use the exact official tools that fit the question: `get_node_details` for model semantics and relation metadata, `get_lineage` for dependencies, `get_model_health` or `get_model_performance` for health and performance, and `get_all_sources` for declared sources and freshness context. | ||
| 3. Before writing SQL, verify the physical BigQuery relation and columns with `search-bigquery-schema`. dbt metadata describes governed meaning; warehouse schema proves what can be queried now. | ||
| 4. Run direct SQL with the existing `bigquery` action. Never use dbt `execute_sql` or `text_to_sql`. | ||
| 5. If dbt metadata does not establish a grain or relationship, keep it unknown. Do not infer a join or silently turn uncertainty into a metric. | ||
|
|
||
| ## Phase 2: MetricFlow / Semantic Layer | ||
|
|
||
| When Semantic Layer tools are available: | ||
|
|
||
| 1. Call `list_metrics` to find the governed metric. | ||
| 2. Inspect `get_dimensions` and `get_entities`; use `get_dimension_values` when a requested filter value needs validation. | ||
| 3. Call `query_metrics` with the requested dimensions, filters, range, and time grain. | ||
| 4. Call `get_metrics_compiled_sql` only when the user requests provenance or query validation. It is not a default preflight. | ||
|
|
||
| Report the metric name, dimensions, filters, date range and time grain, plus environment or freshness caveats. dbt calls use the shared workspace dbt identity, not a personal warehouse identity. | ||
|
|
||
| ## Restricted Schemas | ||
|
|
||
| `dbt_dev` and `dbt_backup` are testing or archival schemas. Do not discover or query either schema unless the latest end-user request explicitly names it and asks to inspect or query it. Never infer permission from SQL that the agent generated. | ||
|
|
||
| ## Freshness | ||
|
|
||
| A visible dbt health or freshness capability does not mean the data is fresh. Warn that data is stale only when returned dbt source/model metadata explicitly says it is beyond the expected refresh window, and include the observed timestamp or window when available. If freshness is unknown, do not claim freshness; mention that it could not be verified only when freshness materially affects the answer. | ||
|
|
||
| If MetricFlow cannot express the request, fall back to dbt metadata plus the `bigquery` action and label the result as ad hoc SQL. Missing Semantic Layer tools are a capability gap, not evidence that no metrics exist. Use Discovery metadata and BigQuery only when they can answer without inventing semantic definitions. | ||
|
|
||
| ## Failure Semantics | ||
|
|
||
| A dbt connection or tool-list error means capability status is unreadable, not that dbt is disconnected or that no dbt models or metrics exist. Preserve the actual error, try dynamic tool discovery when appropriate, and do not replace a failed dbt lookup with guessed semantics. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Bot review from Codex\n\n#### 🟡 Support dbt multi-cell endpoint hosts\n\n
MCP_LINK_HOSTS.dbtonly recognizes*.getdbt.com, but dbt remote MCP also documents multi-cell endpoints such asACCOUNT_PREFIX.us1.dbt.com. BecausefindMcpIntegrationForText()uses this allowlist for URL-first matching, a bare multi-cell MCP URL will not map to the dbt preset and will not trigger the connection suggestion. Please includedbt.comin the allowlist and add a regression test forhttps://acct.us1.dbt.com/api/ai/v1/mcp/.