Official dbt server: run dbt Core/Cloud CLI commands, discover project metadata and models, and query the semantic layer.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add dbt --env ENV_FILE_PATH='<ENV_FILE_PATH>' -- uvx --env-file '<path-to-.env-file>' dbt-mcp~/.codex/config.toml
[mcp_servers.dbt]
command = "uvx"
args = ["--env-file", "<path-to-.env-file>", "dbt-mcp"]
env = { ENV_FILE_PATH = "<ENV_FILE_PATH>" }
# codex mcp add dbt --env ENV_FILE_PATH='<ENV_FILE_PATH>' -- uvx --env-file '<path-to-.env-file>' dbt-mcp~/.cursor/mcp.json
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
],
"env": {
"ENV_FILE_PATH": "<ENV_FILE_PATH>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"dbt": {
"type": "stdio",
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
],
"env": {
"ENV_FILE_PATH": "<ENV_FILE_PATH>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
],
"env": {
"ENV_FILE_PATH": "<ENV_FILE_PATH>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
],
"env": {
"ENV_FILE_PATH": "<ENV_FILE_PATH>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"dbt": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
],
"env": {
"ENV_FILE_PATH": "<ENV_FILE_PATH>"
}
}
}
}需要的环境变量
ENV_FILE_PATH
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。