How to Use the dbt MCP Server

Discover the dbt MCP server, a tool to integrate dbt projects with AI systems. This tutorial covers installation, setup, and how it enables data discovery, querying, and automation for AI workflows.

Ashley Goolam

Ashley Goolam

3 July 2025

How to Use the dbt MCP Server

Are you ready to supercharge your AI workflows with structured data? Let’s dive into the dbt MCP server, a game-changer for connecting your dbt projects to AI systems. In this tutorial, I’ll walk you through what the dbt MCP server is, why it’s awesome, and how to set it up using the updated installation steps. Buckle up for a fun, conversational ride through the world of data and AI!

💡
Want a great API Testing tool that generates beautiful API Documentation?

Want an integrated, All-in-One platform for your Developer Team to work together with maximum productivity?

Apidog delivers all your demands, and replaces Postman at a much more affordable price!
button

What’s dbt All About?

If you’re new to dbt (data build tool), it’s like the Swiss Army knife for data teams. It’s an open-source framework that lets you transform raw data in your data warehouse into clean, reliable datasets for analytics. With dbt, you can:

Think of dbt as the backbone of modern data engineering, making your datasets governed and ready for action.

dbt dev hub official website

Meet the dbt MCP Server

Now, let’s talk about the star of the show: the dbt MCP server. This experimental, open-source server is like a bridge that connects your dbt project to AI systems. MCP stands for Model Context Protocol, a fancy way of saying it’s a standard for AI tools (like Claude Desktop or Cursor) to tap into your dbt project’s metadata, documentation, and semantic layer.

With the dbt MCP server, AI agents and business users can explore your data, run queries, and even execute dbt commands—all through natural language or code. It’s like giving your AI a VIP pass to your data warehouse!

model context protocal

Why You’ll Love the dbt MCP Server

Here’s what makes the dbt MCP server so cool:

How the dbt MCP Server Powers AI Workflows

The dbt MCP server is all about bringing structured, governed data to AI. Here’s how it works its magic:

  1. Universal Data Access: It uses the Model Context Protocol to share your dbt project’s context—models, metrics, and lineage—with any MCP-enabled AI tool. No custom integrations needed!
  2. Smart Data Discovery: AI agents can list models, check dependencies, and grab metadata, making it easy to answer questions like “What’s our customer data like?”
  3. Governed Querying: By tapping into the dbt Semantic Layer, the server ensures AI-generated reports stick to your company’s official metrics, keeping things consistent and trustworthy.
  4. Automation Galore: AI can trigger dbt commands to run models, test data, or build projects, streamlining your data pipelines.
  5. Safe and Scalable: Run it locally or in a sandbox, with permissions to keep sensitive data locked down. It’s flexible for both testing and production.
dbt mcp server architecture

Installing the dbt MCP Server: Step-by-Step

Ready to get the dbt MCP server up and running? Let’s follow the updated installation steps to get you set up smoothly. Don’t worry, I’ll keep it simple and fun!

Prerequisites

Before we start, make sure you have:

Step 1: Clone the Repository

First, grab the dbt MCP server code from GitHub. Open your terminal and run:

git clone https://github.com/dbt-labs/dbt-mcp.git
cd dbt-mcp

This downloads the source code to your local machine and moves you into the project directory.

Step 2: Install Dependencies

With uv and Task installed, set up the required Python packages by running:

task install

This creates a virtual environment and installs all necessary dependencies for the dbt MCP server.

Step 3: Configure Environment Variables

Set up your environment by copying the example configuration file:

cp .env.example .env

Open the .env file in your favorite text editor and fill in these key variables:

You can also enable or disable specific tool groups (e.g., Semantic Layer, Discovery) via these variables. Adjust them based on your needs.

Step 4: Start the dbt MCP Server

Now, let’s fire it up! From the dbt-mcp directory, run:

task start

This launches the dbt MCP server, making it available for connections from MCP-compatible clients like Claude Desktop or Cursor.

Step 5: Connect an MCP-Enabled Client

To connect an MCP client, add this configuration to the client’s config file (replace <path-to-.env-file> with the path to your .env file):

{
  "mcpServers": {
    "dbt-mcp": {
      "command": "uvx",
      "args": ["--env-file", "<path-to-.env-file>", "dbt-mcp"]
    }
  }
}
using the dbt mcp server in claude
  1. Open Settings (Command + ,) and select the appropriate tab (Workspace or User).
  2. For WSL users, use the Remote tab via the Command Palette (F1) or Settings editor.
  3. Enable “Mcp” under Features → Chat.
enable mcp in vs code

4. Click “Edit in settings.json” under “Mcp > Discovery” and add:

{
  "mcp": {
    "inputs": [],
    "servers": {
      "dbt": {
        "command": "uvx",
        "args": ["--env-file", "<path-to-.env-file>", "dbt-mcp"]
      }
    }
  }
}

You can manage servers via the Command Palette (Control + Command + P) with the “MCP: List Servers” command.

Troubleshooting Tips

Available Tools

The dbt MCP server supports powerful tools, including:

Note: Be very cautious, as some commands (e.g., run, build) can modify your data models or warehouse objects. So, proceed with caution!

Wrapping Up

And there you have it! The dbt MCP server is your ticket to bringing structured, governed data into AI workflows. By connecting your dbt project to AI agents, you’re unlocking a world of data discovery, querying, and automation—all while keeping things secure and scalable. Whether you’re a data engineer or an AI enthusiast, this server is a powerful tool to make your data shine.

💡
Want a great API Testing tool that generates beautiful API Documentation?

Want an integrated, All-in-One platform for your Developer Team to work together with maximum productivity?

Apidog delivers all your demands, and replaces Postman at a much more affordable price!
button

Explore more

AI-Powered Documentation Solutions for Modern Development

AI-Powered Documentation Solutions for Modern Development

Delve into the world of AI-powered documentation: discover top tools, key benefits, and how each tool empowers modern teams to create, manage, and publish documentation faster than ever.

4 July 2025

Cypher Alpha: What's the Free Mysterious OpenRouter API?

Cypher Alpha: What's the Free Mysterious OpenRouter API?

Learn to harness OpenRouter’s free Cypher Alpha AI model with Apidog for efficient API testing. This guide covers setup, examples, and benefits for developers.

2 July 2025

How to Find the API of a Website with AI

How to Find the API of a Website with AI

Discover how to find website APIs using Hyperbrowser’s AI or Developer Tools. This guide covers setup, scanning with AI, and manual methods for sites like retouched.ai!

2 July 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs