dbt-cloud-migrate
Audits dbt Core projects for migration blockers and generates actionable guidance for migrating to dbt Cloud, including auto-fixing deprecated syntax.
README
dbt-cloud-migrate
A CLI tool and MCP server that audits dbt Core projects and generates actionable guidance for migrating to dbt Cloud. Designed to work alongside the official dbt MCP server.
How it fits with the dbt MCP server
| Tool | Role |
|---|---|
dbt MCP server (uvx dbt-mcp) |
Runs dbt commands (compile, build, test, show), queries the Semantic Layer, Discovery API, and Admin API |
| dbt-cloud-migrate (this tool) | Audits your project for migration blockers: profiles config, structure issues, deprecated syntax |
The typical workflow is:
- Run
check_projectorcheck_deprecationsto find migration issues - Run
fix_deprecationsto auto-fix safe changes - Use the dbt MCP server's
compileorbuildtools to confirm the project still works
What it checks
- Profiles migration — analyzes
profiles.yml, maps adapter types to dbt Cloud connection types, flags hardcoded credentials, and generates recommendedDBT_ENV_SECRET_environment variable mappings - Project structure — checks model layer organization (staging/intermediate/marts), naming conventions (
stg_,int_,fct_,dim_), source YAML definitions, documentation coverage, primary key test coverage, and.gitignoresettings - Deprecated syntax — detects renamed
dbt_project.ymlkeys, legacytests:YAML keys, deprecateddbt_utilsmacros,env_var()calls without defaults, hardcodedtarget.namereferences, hardcoded 3-part database references, and unpinned packages
Each issue includes a severity level (ERROR, WARNING, INFO) and a concrete fix recommendation.
Installation
Requires Python 3.10+.
git clone <repo>
cd dbt-refactoring-tool
python3 -m venv .venv
.venv/bin/pip install -e .
MCP Server Setup
Prerequisites
Install uv for the dbt MCP server:
curl -LsSf https://astral.sh/uv/install.sh | sh
Claude Code — add both servers
# Official dbt MCP server
claude mcp add dbt -s user -- uvx dbt-mcp
# Migration audit server (this tool)
claude mcp add dbt-cloud-migrate -s user -- dbt-cloud-migrate-mcp
Set your project path for the dbt MCP server — edit ~/.claude.json and add env vars:
{
"mcpServers": {
"dbt": {
"type": "stdio",
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/dbt"
}
},
"dbt-cloud-migrate": {
"type": "stdio",
"command": "dbt-cloud-migrate-mcp"
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": ["dbt-mcp"],
"env": {
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/dbt"
}
},
"dbt-cloud-migrate": {
"command": "dbt-cloud-migrate-mcp"
}
}
}
Available MCP tools
dbt-cloud-migrate tools (this server):
| Tool | Description |
|---|---|
check_project |
Run all migration checks and return a full JSON report |
check_profiles |
Analyze profiles.yml and generate Cloud connection guidance |
check_structure |
Audit model organization, naming, sources, docs, and tests |
check_deprecations |
Scan for deprecated syntax and configuration |
fix_deprecations |
Auto-fix deprecated keys and tests: → data_tests:. Supports dry_run: true |
dbt MCP server tools (complement these with):
| Tool | Description |
|---|---|
dbt_compile |
Compile models to validate SQL after fixes |
dbt_build |
Run and test models end-to-end |
dbt_show |
Preview model output |
list_metrics |
Query the Semantic Layer |
CLI Usage
Run all checks
dbt-cloud-migrate check /path/to/your/dbt/project
Run from your project root:
cd ~/projects/my_dbt_project
dbt-cloud-migrate check .
Output formats
# Rich terminal output (default)
dbt-cloud-migrate check . --output rich
# JSON — useful for CI or piping to other tools
dbt-cloud-migrate check . --output json
# Compact summary table
dbt-cloud-migrate check . --output summary
Run specific checks only
dbt-cloud-migrate check . --only profiles
dbt-cloud-migrate check . --only deprecations
dbt-cloud-migrate check . --only profiles,deprecations
Available check names: profiles, structure, deprecations
Profiles-only command
dbt-cloud-migrate profiles /path/to/project
Auto-fix deprecated syntax
Fix renamed dbt_project.yml keys and tests: → data_tests: in schema YAML files:
# Preview changes without modifying files
dbt-cloud-migrate fix . --dry-run
# Apply fixes
dbt-cloud-migrate fix .
After fixing, validate with the dbt MCP server or CLI:
dbt compile
Version
dbt-cloud-migrate version
Checks reference
Profiles migration
- Adapter → dbt Cloud connection type mapping (Snowflake, BigQuery, Databricks, Redshift, Postgres, and more)
- Hardcoded sensitive fields (
password,token,private_key, etc.) that should useenv_var() - Recommended
DBT_ENV_SECRET_variable names per adapter - Multiple targets → separate dbt Cloud Environments guidance
profiles.ymlcommitted to the project directory (security risk)
Project structure
profiles.ymlinside the project repo- Missing or incomplete
.gitignore(target/,dbt_packages/,profiles.yml,logs/) - Missing
dbt_project.ymlor required keys (name,version,profile) - SQL models in the root
models/directory (not organized into layers) - Missing standard layer folders (
staging/,intermediate/,marts/) - Naming convention violations (
stg_in staging,int_in intermediate,fct_/dim_in marts) - No source YAML files in
models/staging/ - Models with no schema YAML entry or empty
description - Primary key columns (
id,*_id,*_key,*_pk) missingunique+not_nulltests
Deprecated syntax
- Renamed
dbt_project.ymlkeys:source-paths→model-paths,data-paths→seed-paths,modules-path→packages-install-path config-version: 2no longer required (dbt 1.5+)- Legacy
tests:key in schema YAML (should bedata_tests:in dbt 1.8+) version: 2in schema YAML files (no longer required in dbt 1.5+)- Unpinned Hub packages (no
version) and unpinned Git packages (norevision) - Deprecated
dbt_utilsmacros moved to dbt core (dbt_utils.surrogate_key,dbt_utils.current_timestamp, type macros, date macros) env_var()calls without a default value (will fail in Cloud if variable is unset){{ target.name }}usage (recommend environment variable approach in Cloud)- Hardcoded 3-part
database.schema.tablereferences in SQL (should useref()orsource())
Exit codes
0— all checks passed1— one or more ERROR or WARNING issues found
This makes dbt-cloud-migrate check suitable for use in CI pipelines.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。