dbt MCP Server

dbt MCP Server

A MCP (Model Context Protocol) server for interacting with dbt resources.

dbt-labs

Developer Tools
Visit Server

README

dbt MCP Server

This MCP (Model Context Protocol) server provides MCP tools to interact with dbt in a few different ways.

In its current form, it allows users to:

  • run commands from their local install of the dbt Core or dbt Cloud CLI
  • get information about their models and the transformation configured in a given dbt project
  • interact with the dbt Cloud Semantic Layer gateway, getting the list of metrics, dimensions and directly querying those

Architecture

architecture diagram of the dbt MCP server

Setup

  1. Clone the repository:
git clone https://github.com/dbt-labs/dbt-mcp.git
cd dbt-mcp
  1. Install uv

  2. Install Task

  3. Run task install

  4. Configure environment variables:

cp .env.example .env

Then edit .env with your specific environment variables:

  • DISABLE_DBT_CLI: Set this to true to disable dbt Core and dbt Cloud CLI MCP objects. Otherwise, they are enabled.
  • DISABLE_SEMANTIC_LAYER: Set this to true to disable dbt Semantic Layer MCP objects. Otherwise, they are enabled.
  • DISABLE_DISCOVERY: Set this to true to disable dbt Discovery API MCP objects. Otherwise, they are enabled.
  • DBT_HOST: Your dbt Cloud instance hostname. This will look like an Access URL found here. If you are using Multi-cell, do not include the ACCOUNT_PREFIX here.
  • MULTICELL_ACCOUNT_PREFIX: If you are using Multi-cell, set this to your ACCOUNT_PREFIX. If you are not using Multi-cell, do not set this environment variable. You can learn more here.
  • DBT_ENV_ID: Your dbt environment ID.
  • DBT_TOKEN: Your personal access token or service token. Service token is required when using the Semantic Layer.
  • DBT_PROJECT_DIR: The path to your dbt Project.
  • DBT_PATH: The path to your dbt Core or dbt Cloud CLI executable. You can find your dbt executable by running which dbt.
  • DBT_EXECUTABLE_TYPE: Set this to core if the DBT_PATH environment variable points toward dbt Core. Otherwise, dbt Cloud CLI is assumed

Using with MCP Clients

After going through Setup, you can use your server with an MCP client.

This configuration will be added to the respective client's config file:

{
  "mcpServers": {
    "dbt": {
      "command": "<path-to-this-directory>/.venv/bin/mcp",
      "args": [
        "run",
        "<path-to-this-directory>/src/dbt_mcp/main.py"
      ]
    }
  }
}

Be sure to replace <path-to-this-directory>

If you encounter any problems. You can try running task run to see errors in your terminal

Claude Desktop

Follow these instructions to create the claude_desktop_config.json file and connect.

You can find the Claude Desktop logs at ~/Library/Logs/Claude.

Cursor

  1. Open the Cursor menu and select Settings → Cursor Settings → MCP
  2. Click "Add new global MCP server"
  3. Add the config from above to the provided mcp.json file
  4. Verify your connection is active within the MCP tab

Cursor MCP docs here for reference

VS Code

  1. Open the Settings menu (Command + Comma) and select the correct tab atop the page for your use case

    • Workspace - configures the server in the context of your workspace
    • User - configures the server in the context of your user
  2. Select Features → Chat

  3. Ensure that "Mcp" is Enabled mcp-vscode-settings

  4. Click "Edit in settings.json" under "Mcp > Discovery"

  5. Add your server configuration (dbt) to the provided settings.json file as one of the servers

{
    "mcp": {
        "inputs": [],
        "servers": {
          "dbt": {
            "command": "<path-to-this-directory>/.venv/bin/mcp",
            "args": ["run", "<path-to-this-directory>/src/dbt_mcp/main.py"]
          }
        }
    }
}

After setup you can start, stop, and configure your MCP servers by:

  • Running the MCP: List Servers command from the Command Palette (Control + Command + P) and selecting the server
  • Utlizing the keywords inline within the settings.json file

inline-management

VS Code MCP docs here for reference

Contributing

Read CONTRIBUTING.md for instructions on how to get involved!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python