Every time a developer changes a dbt model, there’s a question no one can easily answer before merging: is this safe to ship? Your dbt tests tell you if the code compiles. They don’t tell you if the model you just refactored has been failing tests for the past week, whether it feeds a dashboard your CEO looks at every morning, or whether there’s already an open incident on it that your data team is investigating. Elementary’s code review automatically answers all of that. The moment a pull request touches your dbt models, a structured comment appears with everything your team needs to make a confident merge decision, without leaving the PR.Documentation Index
Fetch the complete documentation index at: https://elementary-devin-1774320697-fabric-cloud-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.

Why it matters
Data quality issues are exponentially cheaper to catch before merge than after. But today, most teams have no visibility into data health at review time. Reviewers check the SQL, not the data. By the time a broken model hits production, it’s already in dashboards, downstream models, and stakeholder reports. Elementary closes that gap by bringing live data quality context directly into the code review workflow.What you get on every PR
- Test history: pass/fail counts for each changed model over the last 7 days, so reviewers know if they’re touching something that’s already fragile
- Active incidents: any open data quality issues on those models right now, before the change lands on top of them
- Downstream blast radius: exactly which models, pipelines, and dashboards depend on what’s changing, two levels deep
- Health summary: a plain-language signal on whether it’s safe to merge, powered by Claude
How it works
The review is powered by Claude connected to the Elementary MCP server. When a PR is opened or updated:- A CI job detects which models changed using
git diff - Claude queries Elementary for live data quality context on those exact models
- A structured Markdown summary is posted as a comment on the PR or MR
Setup
Prerequisites
- An Elementary Cloud account with the MCP server enabled
- An Anthropic API key
GitHub Actions
Step 1 — Add the workflow file Create.github/workflows/elementary-review.yml in your dbt repository:
| Secret | Description |
|---|---|
ANTHROPIC_API_KEY | Your Anthropic API key |
ELEMENTARY_API_KEY | Your Elementary Cloud API key |
Optional: customize the action
Optional: customize the action
| Input | Default | Description |
|---|---|---|
models-path | models/ | Path to your dbt models directory |
diff-filter | ACMR | File changes to include: A=Added, C=Copied, M=Modified, R=Renamed |
claude-model | claude-haiku-4-5-latest | Claude model to use. Switch to claude-sonnet-4-latest for deeper analysis on complex changes |
base-ref | PR base branch | Branch to diff against |
mcp-config-path | (auto-generated) | Path to a custom MCP config file. Only needed for self-hosted Elementary setups |
GitLab CI
Step 1 — Add the include to your.gitlab-ci.yml
| Variable | Masked | Description |
|---|---|---|
ANTHROPIC_API_KEY | Yes | Your Anthropic API key |
ELEMENTARY_API_KEY | Yes | Your Elementary Cloud API key |
GITLAB_API_TOKEN | Yes | Optional. Project Access Token with api scope. Set this if you cannot enable CI/CD job token API access in project settings. |
CI_JOB_TOKEN(default): GitLab’s built-in job token, available automatically in every pipeline. Requires a project admin to enable Settings > CI/CD > Token Access > Allow CI/CD job tokens to access this project’s API.GITLAB_API_TOKEN(alternative): If this variable is set, it takes priority overCI_JOB_TOKEN. Use a Project Access Token withapiscope. This works without any admin settings change and is the easier option if you don’t have project admin access.

Troubleshooting
No comment appears after the job runs Make sure bothcontents: read and pull-requests: write are set under permissions in the workflow. An explicit permissions block sets any unlisted scope to none, so omitting contents: read causes the checkout step to fail before Elementary runs.
git diff returns no changed models
Make sure fetch-depth: 0 is set on the checkout step. Without full git history the runner cannot compare branches and the diff will be empty.
The comment says the MCP server is unreachable
Verify ELEMENTARY_API_KEY is correctly set and the MCP server is enabled for your account. See the MCP setup guide.

