MCP.so
登录

DBT CLI MCP Server

@MammothGrowth

关于 DBT CLI MCP Server

DBT CLI MCP Server

基本信息

分类

数据与分析

许可证

MIT

运行时

python

传输方式

stdio

发布者

MammothGrowth

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "dbt-cli-mcp": {
      "command": "uv",
      "args": [
        "venv"
      ]
    }
  }
}

工具

8

Run dbt models (requires absolute `project_dir`)

Run dbt tests (requires absolute `project_dir`)

List dbt resources (requires absolute `project_dir`)

Compile dbt models (requires absolute `project_dir`)

Debug dbt project setup (requires absolute `project_dir`)

Install dbt package dependencies (requires absolute `project_dir`)

Load CSV files as seed data (requires absolute `project_dir`)

Preview model results (requires absolute `project_dir`)

概览

What is DBT CLI MCP Server?

The DBT CLI MCP Server is a Model Context Protocol (MCP) server that wraps the dbt CLI tool, enabling AI coding agents to interact with dbt projects through standardized MCP tools.

How to use DBT CLI MCP Server?

Install with Python 3.10+, uv, and dbt CLI. Clone the repository, create a virtual environment, and install dependencies. Use the command-line interface directly or configure the server in an MCP client (e.g., Claude for Desktop) using the provided JSON configuration. All tools require the absolute path to the dbt project directory.

Key features of DBT CLI MCP Server

  • Execute dbt commands through MCP tools
  • Supports run, test, compile, ls, debug, deps, seed, show
  • Configurable dbt executable path and profiles directory
  • Environment variable management for dbt projects
  • Command-line interface for direct interaction
  • Integration tests against a real dbt project

Use cases of DBT CLI MCP Server

  • AI agents running dbt models automatically
  • Debugging dbt project setup via MCP client
  • Previewing model results with dbt_show
  • Installing dbt package dependencies

FAQ from DBT CLI MCP Server

What is the most critical requirement when using the DBT CLI MCP tools?

You must specify the full absolute path to your dbt project directory with the project_dir parameter. Relative paths will not work.

How are dbt profiles handled?

The server automatically sets DBT_PROFILES_DIR to the absolute path specified in project_dir. The project directory must contain a valid dbt_project.yml and a profiles.yml file that matches the profile referenced in the project.

What are the prerequisites for installation?

Python 3.10 or higher, the uv tool for Python environment management, and the dbt CLI installed on your system.

How do I configure the server for an MCP client like Claude for Desktop?

Add an entry to the client's configuration with the uv command, pointing to the server script, and optionally set environment variables like DBT_PATH or ENV_FILE.

Can I override the default dbt executable path?

Yes, via the --dbt-path command-line option or the DBT_PATH environment variable. The default is dbt.

评论

数据与分析 分类下的更多 MCP 服务器