# Dbt Core Mcp

> dbt Core MCP Server: Interact with dbt projects via Model Context Protocol

- **Type:** MCP server
- **Install:** `agentstack add mcp-niclasolofsson-dbt-core-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [NiclasOlofsson](https://agentstack.voostack.com/s/niclasolofsson)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [NiclasOlofsson](https://github.com/NiclasOlofsson)
- **Source:** https://github.com/NiclasOlofsson/dbt-core-mcp

## Install

```sh
agentstack add mcp-niclasolofsson-dbt-core-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# dbt Core MCP Server

[](https://insiders.vscode.dev/redirect/mcp/install?name=dbtcore&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22dbt-core-mcp%22%5D%7D)
[](https://insiders.vscode.dev/redirect/mcp/install?name=dbtcore&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22dbt-core-mcp%22%5D%7D&quality=insiders)
&nbsp;&nbsp;&nbsp;&nbsp;[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://docs.getdbt.com/)

Meet your new dbt pair programmer - the one who actually understands your environment, respects your workflow, and does the heavy lifting.

## Why This Changes Everything

If you've tried other dbt tools with Copilot (dbt power user, datamate, etc.), you know the pain:
- They don't respect your Python environment
- They can't see your actual project structure
- They fail when adapters are missing from THEIR environment
- You end up doing the work yourself anyway

**dbt-core-mcp is different.** It's not just another plugin - it's a true pair programming partner that:

- **Zero dbt Dependencies**: Our server needs NO dbt-core, NO adapters - works with YOUR environment
- **Stays in Flow**: Keep the conversation going with Copilot while it handles dbt commands, runs tests, and analyzes impact
- **Respects Your Environment**: Detects and uses YOUR exact dbt version, YOUR adapter, YOUR Python setup (uv, poetry, venv, conda)
- **Actually Helps**: Instead of generic suggestions, you get real work done - "run my changes and test downstream" actually does it
- **Knows Your Project**: Full access to your models, lineage, sources, and compiled SQL - no guessing, no manual lookups

&nbsp;  
>&nbsp;  
>**Before dbt-core-mcp**  
>You: *"Copilot, help me understand what depends on stg_orders"*  
>Copilot: *"You should check the manifest.json or run dbt list..."*  
>You: *Switches to terminal, runs commands, copies output back...*
>
>**With dbt-core-mcp**  
>You: *"What depends on stg_orders?"*  
>Copilot: *Shows full lineage, impact analysis, and affected models instantly*  
>You: *"Run my changes and test everything downstream"*  
>Copilot: *Does it. Reports results. You focus on the next step.*  
>&nbsp;

**This is pair programming the way it should be** - you focus on the logic, Copilot handles the execution. No context switching, no terminal juggling, just flow.

## What You Get (Features & Benefits)

- **🔥 Zero dbt Dependencies**: Server has NO dbt-core, NO adapters - ultimate environment respect
- **Natural Language Control**: Just talk - "run my changes and test downstream" actually works
- **Bridge Execution**: Automatically detects YOUR environment and runs dbt with YOUR versions
- **Works with ANY Adapter**: duckdb, snowflake, postgres, bigquery, databricks - if you have it, we work with it
- **Smart Selection**: Automatic change detection - run only what changed, or changed + downstream
- **Full Project Awareness**: Lineage analysis, impact assessment, compiled SQL - instant access to everything
- **Peek Inside CTEs**: Query individual CTEs inside any model to see intermediate results, debug transformations, and design realistic fixtures
- **True Pair Programming**: Stay in conversation with Copilot while it executes dbt commands and reports results
- **Schema Change Detection**: Automatically detects column changes and recommends downstream updates
- **No Configuration Needed**: Works with your existing dbt setup - any adapter, any database, any version
- **Concurrency Safe**: Detects and waits for existing dbt processes to prevent conflicts

This server provides tools to interact with dbt projects via the Model Context Protocol, enabling AI assistants to:
- Query dbt project metadata and configuration
- Get detailed model and source information with full manifest metadata
- Execute SQL queries with Jinja templating support ({{ ref() }}, {{ source() }})
- Inspect models, sources, and tests
- Access dbt documentation and lineage

### Natural Language, Powerful Results

Just talk to Copilot naturally - no need to memorize commands or syntax:

>&nbsp;  
>**Explore your project**  
>You: *"What models do we have in this project?"*  
>Copilot: *Shows all models with materialization types and tags*
>
>**Understand dependencies**  
>You: *"Show me what the customers model depends on"*  
>Copilot: *Displays full lineage with upstream sources and models*
>
>**Run smart builds**  
>You: *"Run only the models I changed and test everything downstream"*  
>Copilot: *Executes dbt with smart selection, runs tests, reports results*  
>&nbsp;

## Get It Running (2 Minutes)

*If you don't have Python installed, get it at [python.org/downloads](https://www.python.org/downloads/) - you'll need Python 3.9 or higher.*

*Don't have `uv` yet? Install it with: `pip install uv` or see [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/)*

### Option 1: One-Click Install (Easiest)

Click the badge for your VS Code version:

[](https://insiders.vscode.dev/redirect/mcp/install?name=dbtcore&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22dbt-core-mcp%22%5D%7D)
[](https://insiders.vscode.dev/redirect/mcp/install?name=dbtcore&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22dbt-core-mcp%22%5D%7D&quality=insiders)

That's it! The server will automatically start when you open a dbt project.

### Option 2: Manual Configuration

Add this to your `.vscode/mcp.json` file in your dbt project workspace:

```json
{
  "servers": {
    "dbt-core": {
      "command": "uvx",
      "args": ["dbt-core-mcp"]
    }
  }
}
```

Or if you prefer `pipx`:

```json
{
  "servers": {
    "dbt-core": {
      "command": "pipx",
      "args": ["run", "dbt-core-mcp"]
    }
  }
}
```

The server will automatically use your workspace directory as the dbt project location.

### Option 3: Bleeding Edge (Latest from GitHub)

For the impatient who want the latest features immediately:

**With `uvx`:**
```json
{
  "servers": {
    "dbt-core": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/NiclasOlofsson/dbt-core-mcp.git",
        "dbt-core-mcp"
      ]
    }
  }
}
```

**With `pipx`:**
```json
{
  "servers": {
    "dbt-core": {
      "command": "pipx",
      "args": [
        "run",
        "--no-cache",
        "--spec",
        "git+https://github.com/NiclasOlofsson/dbt-core-mcp.git",
        "dbt-core-mcp"
      ]
    }
  }
}
```

**Getting Updates:**
When using git installation, `uvx` and `pipx` cache the downloaded code. To get the latest changes:

```bash
# For uvx users
uv cache clean dbt-core-mcp

# For pipx users (--no-cache prevents caching)
# Already configured in the pipx setup above
```

After cleaning the cache, restart VS Code or your MCP client to pick up the latest version.

### Optional Configuration

#### Command Timeout

By default, dbt commands have no timeout (they can run as long as needed). For complex models that take a long time to compile, you can set a timeout or explicitly disable it:

```json
{
  "servers": {
    "dbt-core": {
      "command": "uvx",
      "args": [
        "dbt-core-mcp",
        "--dbt-command-timeout", "300"  // 5 minutes, or use 0 for no timeout (default)
      ]
    }
  }
}
```

#### Project Directory

The server automatically detects your dbt project from the workspace root. If your dbt project is in a subdirectory or you need to specify a different location, use `--project-dir` with either a relative or absolute path:

```json
{
  "servers": {
    "dbt-core": {
      "command": "uvx",
      "args": [
        "dbt-core-mcp",
        "--project-dir", "path/to/dbt/project"  // relative or absolute path
      ]
    }
  }
}
```

## Requirements

**For the MCP Server:**
- Python 3.9 or higher
- NO dbt-core required, NO adapters required - just install `dbt-core-mcp`

**For Your dbt Project:**
- dbt Core 1.9.0 or higher
- Any dbt adapter (dbt-duckdb, dbt-postgres, dbt-snowflake, dbt-databricks, etc.)

The server automatically detects and uses YOUR project's dbt installation via bridge execution.

## Limitations

- **Python models**: Not currently supported. Only SQL-based dbt models are supported at this time.
- **dbt Version**: Requires dbt Core 1.9.0 or higher

## Available Tools

**Don't worry about memorizing these** - you don't need to know tool names or parameters. Just talk naturally to Copilot and it figures out what to use. This reference is here for the curious who want to understand what's happening under the hood.

**Pro tip:** Focus on the conversational examples (You: / Copilot:) - they show how to actually use these tools in practice.

### Project Information

#### `get_project_info`
Get basic information about your dbt project including name, version, adapter type, and resource counts. By default, also runs `dbt debug` to validate your environment and test the database connection.

>&nbsp;  
>You: *"What dbt version is this project using?"*  
>Copilot: *Shows project info with dbt version, adapter type, and connection status*
>
>You: *"How many models and sources are in this project?"*  
>Copilot: *Displays counts and project overview with diagnostics*
>
>You: *"Is my database connection working?"*  
>Copilot: *Shows connection test results from dbt debug*
>
>You: *"Check my dbt setup"*  
>Copilot: *Runs full environment validation and reports any issues*  
>&nbsp;

**Parameters:**
- `run_debug`: Run `dbt debug` to validate environment and test connection (default: True)

**Returns:** Project metadata plus diagnostic results including:
- Database connection status (ok/failed/unknown)
- Environment validation output
- System and dependency checks

**Note:** Set `run_debug=False` to skip diagnostics and get only basic project info (faster for repeated queries).

### Resource Discovery (Unified Tools)

**One tool, all resource types** - these unified tools work across models, sources, seeds, snapshots, and tests. No need for separate tools for each type.

#### `list_resources`
List all resources in your project, or filter by type (models, sources, seeds, snapshots, tests).

>&nbsp;  
>You: *"Show me all resources in this project"*  
>Copilot: *Lists all models, sources, seeds, snapshots, and tests*
>
>You: *"What models do we have?"*  
>Copilot: *Filters to show only models with their materialization types*
>
>You: *"List all data sources"*  
>Copilot: *Shows configured sources with schemas and descriptions*
>
>You: *"Show me the seeds"*  
>Copilot: *Displays CSV seed files available in the project*
>
>You: *"Which models are materialized as tables?"*  
>Copilot: *Filters models by materialization type*  
>&nbsp;

**Parameters:**
- `resource_type`: Optional filter - `"model"`, `"source"`, `"seed"`, `"snapshot"`, `"test"`, or `None` for all

**Returns:** Consistent structure for all types with common fields (name, description, tags) plus type-specific details (materialization, source_name, etc.)

#### `get_resource_info`
Get detailed information about any resource - works for models, sources, seeds, snapshots, and tests.

>&nbsp;  
>You: *"Show me details about the customers model"*  
>Copilot: *Displays full model metadata, config, column information, and compiled SQL*
>
>You: *"What's in the raw_customers source?"*  
>Copilot: *Shows source schema, columns, and freshness configuration*
>
>You: *"Describe the country_codes seed"*  
>Copilot: *Returns seed configuration and column definitions*
>
>You: *"What columns does the orders model have?"*  
>Copilot: *Shows column names, types, and descriptions from database*
>
>You: *"Show me the compiled SQL for customers"*  
>Copilot: *Returns model info with compiled SQL (all Jinja resolved)*
>
>You: *"Tell me about the customer_snapshot"*  
>Copilot: *Displays snapshot configuration and SCD tracking setup*  
>&nbsp;

**Parameters:**
- `name`: Resource name (e.g., "customers", "jaffle_shop.raw_orders")
- `resource_type`: Optional - auto-detects if not specified
- `include_database_schema`: Include actual column types from database (default: true)
- `include_compiled_sql`: Include compiled SQL with Jinja resolved (default: true, models only)

**Auto-detection:** Just provide the name - the tool automatically finds it whether it's a model, source, seed, snapshot, or test. For sources, use `"source_name.table_name"` format or just the table name.

**Compiled SQL:** For models, automatically includes compiled SQL with all `{{ ref() }}` and `{{ source() }}` resolved to actual table names. Will trigger `dbt compile` if not already compiled. Set `include_compiled_sql=False` to skip compilation.

### Lineage & Impact Analysis (Unified Tools)

**Understand relationships across all resource types** - analyze dependencies and impact for models, sources, seeds, snapshots, and tests.

#### `get_lineage`
Trace dependency relationships for any resource - shows what it depends on (upstream) and what depends on it (downstream).

>&nbsp;  
>You: *"Show me the lineage for the customers model"*  
>Copilot: *Displays full dependency tree with upstream sources and downstream models*
>
>You: *"What does stg_orders depend on?"*  
>Copilot: *Shows upstream dependencies (sources and parent models)*
>
>You: *"What's downstream from the raw_customers source?"*  
>Copilot: *Shows all models that use this source*
>
>You: *"Where does the revenue model get its data from?"*  
>Copilot: *Displays upstream lineage with all source data*
>
>You: *"Show me everything that uses the country_codes seed"*  
>Copilot: *Lists all downstream models that reference this seed*  
>&nbsp;

**Parameters:**
- `name`: Resource name (works for models, sources, seeds, snapshots, tests)
- `direction`: `"upstream"` (sources), `"downstream"` (dependents), or `"both"` (default)
- `depth`: Maximum levels to traverse (None for unlimited, 1 for immediate, etc.)
- `resource_type`: Optional - auto-detects if not specified

**Returns:** Dependency tree with statistics (upstream_count, downstream_count, total_dependencies)

**Use cases:**
- Understand data flow and relationships
- Explore where resources get their data
- See what depends on specific resources
- Impact analysis before making changes

#### `analyze_impact`
Analyze the blast radius of changing any resource - shows all downstream dependencies that would be affected.

>&nbsp;  
>You: *"What's the impact of changing the stg_customers model?"*  
>Copilot: *Shows all downstream models, tests, and affected resources*
>
>You: *"If I modify the raw_orders source, what needs to run?"*  
>Copilot: *Lists impacted models grouped by distance with recommended commands*
>
>You: *"What breaks if I change the country_codes seed?"*  
>Copilot: *Shows total impact count and affected resources*
>
>You: *"How many models depend on this snapshot?"*  
>Copilot: *Displays impact statistics and dependency count*  
>&nbsp;

**Parameters:**
- `name`: Resource name (works for models, sources, seeds, snapshots, tests)
- `resource_type`: Optional - auto-detects if not specified

**Returns:**
- Affected resources grouped by distance from the changed resource
- Count of affected tests and other resources
- Total impact statistics
- Context-aware recommended dbt commands (e.g., `dbt run -s stg_customers+`)
- Impact level message (No/Low/Medium/High)

**Use cases:**
- Before refactoring: understand blast radius
- Planning incremental rollouts
- Estimating rebuild time after changes
- Risk assessment for modifications

#### `get_column_lineage`
Trace column-level lineage through SQL transformations - see exactly how columns flow through CTEs, joins, aggregations, and transformations.

>&nbsp;  
>You: *"Show me where the revenue column comes from"*  
>Copilot: *Traces upstream through CTEs showing each transformation step*
>
>You: *"How does customer_id flow through the customers model?"*  
>Copilot: *Shows CTE chain: final → customer_agg → orders → stg_orders*
>
>You: *"What columns use customer_id downstream?"*  
>Copilot: *Displays all downstream models

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [NiclasOlofsson](https://github.com/NiclasOlofsson)
- **Source:** [NiclasOlofsson/dbt-core-mcp](https://github.com/NiclasOlofsson/dbt-core-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-niclasolofsson-dbt-core-mcp
- Seller: https://agentstack.voostack.com/s/niclasolofsson
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
