dbt-mcp: Instructions file for Claude Code

CLAUDE.md

dbt-mcp CLAUDE.md is an instructions file for Claude Code from dbt-labs/dbt-mcp. It costs 1,894 tokens per session, scanned A, original, Apache-2.0.

Project instructions for dbt-mcp, a server that lets AI assistants use dbt tools. dbt is software for building and managing data transformations, while MCP is a standard way for AI assistants to call tools.

In plain words
What is it for?
Use them when adding or changing dbt-mcp tools, tool groups, configuration, or interactive tool interfaces. They help keep new tools connected to the server's architecture and tests.
Why use it?
They explain where the server's tools, configuration, prompts, and tests live. They also describe the project rules for defining, naming, grouping, and registering tools.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is dbt-labs/dbt-mcp's own configuration. It tells Claude Code how to work on dbt-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dbt-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dbt-labs/dbt-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dbt-labs/dbt-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/dbt-labs/dbt-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dbt-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dbt-labs/dbt-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/dbt-labs/dbt-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dbt-labs/dbt-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/dbt-labs/dbt-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dbt-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dbt-labs/dbt-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/dbt-labs/dbt-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,894 This file is loaded in full into every session.
When invoked 1,894 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01894 $0.01894
Opus 5.5 $0.00758 $0.00758
Sonnet 5.5 $0.00379 $0.00379
Haiku 4.5 $0.00189 $0.00189

Measured 3d ago against content hash b4edbc061946, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dbt-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

Project Overview

dbt-mcp is an MCP (Model Context Protocol) server that exposes dbt functionality as tools to AI assistants. Built on FastMCP from the mcp SDK.

Key Paths

  • Entry point: src/dbt_mcp/main.py
  • Server: src/dbt_mcp/mcp/server.py (DbtMCP class, create_dbt_mcp())
  • Tool infra: src/dbt_mcp/tools/ (definitions, registration, injection, toolsets, tool_names)
  • Tool categories: discovery/, semantic_layer/, dbt_cli/, dbt_codegen/, dbt_admin/, lsp/, mcp_server_metadata/
  • Prompts (tool descriptions): src/dbt_mcp/prompts/
  • Config: src/dbt_mcp/config/
  • Tests: tests/unit/, tests/integration/

Tool Architecture

Tools follow a consistent pattern:

  1. @dbt_mcp_tool defines metadata and requires an explicit access declaration: target argument annotations, top-level requirements=(AccountTarget(requires=…),) or a host policy enum. Use requirements=(AccessPolicy.LOCAL,) for local execution and requirements=() for public tools. Hosts implement enforcement; shared declarations contain semantic permissions and preserve host policies without interpreting them.
  2. ToolName enum in tools/tool_names.py — every tool needs an entry
  3. Toolset mapping in tools/toolsets.py — maps tools to categories
  4. Context injection builds the framework callable; the declared input contract and host bindings determine the model schema
    • Declare Annotated[..., ProjectTarget(...)] and EnvironmentTarget(...) on the canonical tool arguments. Keep a required Field(...) default for selectors; context adapters pass these arguments through, but bodies read resolved context/config and leave selectors unused. The model sees the declared non-nullable type or no parameter when bound. Adaptation preserves the canonical metadata. JobTarget/RunTarget describe ordinary IDs used by the body whose owning project/environment the host resolves. Resource-specific job/run tools require only their JobTarget/RunTarget permission; AccountTarget is reserved for genuinely account-wide operations. Listing visibility must not add an account-wide runtime requirement. Hosts check owners only for supplied IDs and leave requiredness to input validation.
    • Discovery and semantic-layer tools declare ProjectTarget(requires=..., environment=EnvironmentRole.PRODUCTION). The host resolves production alongside the project before authorization; no environment-ID argument is needed. Job listing declares AccessPolicy.JOBS_LISTING; hosts authorize the configured project/environment scope or account fallback. Tool bodies consume the configuration supplied by their context mapper.
    • adapt_with_mappers(context=build_context, project_id=resolved_project) injects parameters by name. Mapper inputs form the framework signature, shared inputs must agree, and each mapper runs once per invocation. Canonical input types/defaults define the model contract independently of mapper omission support. Target annotations remain on caller-visible inputs. All injection is explicit by parameter name; type-based and positional mapper APIs have been removed.
    • Context mappers explicitly declare the selectors and ordinary arguments they need. Hosts resolve and authorize those inputs, then build the final context. Framework context can supply request authorization while adapters choose the visible selector inputs. Ordinary mapper inputs also reach the body unchanged. project_id=HIDE removes a model input without supplying a value; dependent mappers must allow omission. Zero-argument value mappers hide and inject known values; compose them after context adaptation so context builders receive the selected values. FastMCP generates and validates the resulting callable with extra inputs forbidden. Discovery contexts construct fetchers with resolved config.
    • Discovery and semantic-layer tools have one canonical implementation and one registration entry point. Project-aware providers resolve either the configured environment or an explicit project. The local server uses one registry and projects schemas per credential selection: a unique project/configured environment hides the selector; multiple projects expose the tool's declared selector. Invocation rejects supplied bound selectors. Optional job filters use nullable JobTarget arguments alongside AccessPolicy.RUNS_LISTING; hosts check the owner when supplied and the account when omitted. Shared listing policies are implemented by hosts alongside AccessPolicy.LOCAL. list_jobs accepts an optional project filter that overrides the configured environment. Without an explicit filter, it uses the configured environment (including staging), then the configured project, then account-wide listing. Optional local selectors retain their defaults when hidden and permit omission in multi-project mode; required selectors remain required.
  5. register_tools() in tools/register.py — precedence-based enablement (individual > toolset > default)

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +7 tokens per session b4edbc061946
  2. 6d ago Changed · +63 tokens per session 972bf37e3287
  3. 23d ago Changed · +69 tokens per session 03d90fae2a40
  4. 25d ago Changed · +5 lines · +592 tokens per session 163db2e975d8
  5. 28d ago Changed · +7 lines · +277 tokens per session 22d64a16fba6
  6. 2mo ago First seen · 71 lines · 886 tokens per session scan A 7c28bb09803e

Subscribe to this mod's changes

dbt-mcp CLAUDE.md is an instructions file published in the GitHub repository dbt-labs/dbt-mcp (616 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,894 tokens to every session, about $0.0076 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

dbt-mcp CLAUDE.md compared with instructions from other repositories

dbt-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dbt-mcp CLAUDE.mddbt-labs/dbt-mcpInstructions file616yesterdayApache-2.0A1,894Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode