
mammothgrowth/dbt-cli-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
DBT CLI MCP 서버
개요
Dbt CLI 도구를 감싸는 모델 Context Protocol (MCP) 서버는 표준화 된 MCP 도구를 통해 dbt 프로젝트와 상호 작용하는 AI 코딩 에이전트를 가능하게합니다. - MCP 도구를 통해 dbt 명령을 실행 - 모든 주요 dbt 작업 (런, 테스트, 컴파일 등)에 대한 지원 - 직접 상호 작용을위한 명령 줄 인터페이스 - dbt 프로젝트의 환경 변수 관리 - 구성 가능한 dbt 실행 가능한 경로 - 유연한 profile.yml 위치 구성 - Python 3.10 이상 - Python 환경 관리용 uv 도구 - dbt CLI 설치 패키지는 dbt와 직접 상호 작용을 위한 명령행 인터페이스를 제공합니다: --dbt-path: dbt executable 경로 (기본값: "dbt") --env-file: 환경 파일 경로 (기본값: ".env") --log-level: Logging Level (기본값: "INFO") --profiles-dir: 프로파일을 포함하는 디렉토리 경로.
개요(AI 번역)
Dbt CLI 도구를 감싸는 모델 Context Protocol (MCP) 서버는 표준화 된 MCP 도구를 통해 dbt 프로젝트와 상호 작용하는 AI 코딩 에이전트를 가능하게합니다.
특징
- MCP 도구를 통해 dbt 명령 실행
- 모든 주요 dbt 작업 지원 (런, 테스트, 컴파일 등)
- 직접적인 상호 작용을 위한 명령 선 공용영역
- dbt 프로젝트의 환경변수 관리
- Configurable dbt 실행 가능한 경로
- Flexible profiles.yml 위치 설정
설치
# 필수품
- Python 3.10 이상
uvPython 환경 관리 도구- dbt CLI 설치
설정
사용법
명령 선 공용영역
패키지는 dbt와 직접 상호 작용을 위한 명령행 인터페이스를 제공합니다:
모듈을 직접 사용할 수 있습니다:
명령 선 선택권
--dbt-path: dbt 실행 가능한 경로 (기본값: “dbt”)--env-file: 환경 파일 경로 (과태: “.env”)--log-level: 로깅 레벨 (과태: “INFO”)--profiles-dir: profile.yml 파일 포함 디렉토리 경로 (기본값은 project-dir 지정하지 않는 경우)
환경 변수
서버는 환경 변수를 사용하여 구성될 수 있습니다:
DBT_PATH: dbt 실행 가능한 경로
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
DBT CLI MCP Server
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.
Features
- Execute dbt commands through MCP tools
- Support for all major dbt operations (run, test, compile, etc.)
- Command-line interface for direct interaction
- Environment variable management for dbt projects
- Configurable dbt executable path
- Flexible profiles.yml location configuration
Installation
Prerequisites
- Python 3.10 or higher
uvtool for Python environment management- dbt CLI installed
Setup
# Clone the repository with submodules
git clone --recurse-submodules https://github.com/yourusername/dbt-cli-mcp.git
cd dbt-cli-mcp
# If you already cloned without --recurse-submodules, initialize the submodule
# git submodule update --init
# Create and activate a virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
uv pip install -e .
# For development, install development dependencies
uv pip install -e ".[dev]"
Usage
Command Line Interface
The package provides a command-line interface for direct interaction with dbt:
# Run dbt models
dbt-mcp run --models customers --project-dir /path/to/project
# Run dbt models with a custom profiles directory
dbt-mcp run --models customers --project-dir /path/to/project --profiles-dir /path/to/profiles
# List dbt resources
dbt-mcp ls --resource-type model --output-format json
# Run dbt tests
dbt-mcp test --project-dir /path/to/project
# Get help
dbt-mcp --help
dbt-mcp run --help
You can also use the module directly:
python -m src.cli run --models customers --project-dir /path/to/project
Command Line Options
--dbt-path: Path to dbt executable (default: “dbt”)--env-file: Path to environment file (default: “.env”)--log-level: Logging level (default: “INFO”)--profiles-dir: Path to directory containing profiles.yml file (defaults to project-dir if not specified)
Environment Variables
The server can also be configured using environment variables:
DBT_PATH: Path to dbt executableENV_FILE: Path to environment fileLOG_LEVEL: Logging levelDBT_PROFILES_DIR: Path to directory containing profiles.yml file
Using with MCP Clients
To use the server with an MCP client like Claude for Desktop, add it to the client’s configuration:
{
"mcpServers": {
"dbt": {
"command": "uv",
"args": ["--directory", "/path/to/dbt-cli-mcp", "run", "src/server.py"],
"env": {
"DBT_PATH": "/absolute/path/to/dbt",
"ENV_FILE": ".env"
// You can also set DBT_PROFILES_DIR here for a server-wide default
}
}
}
}
⚠️ IMPORTANT: Absolute Project Path Required ⚠️
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →설정
{
"mcpServers": {
"dbt": {
"command": "uv",
"args": ["--directory", "/path/to/dbt-cli-mcp", "run", "src/server.py"],
"env": {
"DBT_PATH": "/absolute/path/to/dbt",
"ENV_FILE": ".env"
// You can also set DBT_PROFILES_DIR here for a server-wide default
}
}
}
}