Skip to main content

MCP environment variables reference

This page is a condensed reference for all environment variables used by the local dbt MCP server. For full detail on each variable (including examples and multi-cell configuration), see Set up local MCP.

Local CLI

These variables are required to use dbt CLI commands through MCP.

VariableRequiredDescription
DBT_PROJECT_DIRRequiredFull path to your dbt project folder (the folder containing dbt_project.yml).
DBT_PATHRequiredFull path to your dbt executable. Find it by running which dbt (macOS/Linux) or where dbt (Windows).
DBT_PROFILES_DIROptionalPath to a custom profiles.yml directory. Defaults to ~/.dbt/.
DBT_CLI_TIMEOUTOptionalSeconds before dbt CLI commands time out. Defaults to 60. Compile runs the whole project, so large projects may need a higher limit to avoid timeouts.
Loading table...

dbt platform

These variables are required for dbt platform features (Semantic Layer, Discovery API, Admin API, SQL execution).

VariableRequiredDescription
DBT_HOSTRequiredYour dbt platform hostname. Accepts both cloud.getdbt.com and https://cloud.getdbt.com. Default: cloud.getdbt.com.

For multi-cell accounts, use the base hostname (for example, us1.dbt.com) and set MULTICELL_ACCOUNT_PREFIX separately (for example, abc123).
MULTICELL_ACCOUNT_PREFIXRequired for multi-cellYour account prefix (for example, abc123 from abc123.us1.dbt.com). Do not include this in DBT_HOST.
DBT_TOKENRequiredA service token or Personal Access Token (PAT).

The execute_sql tool requires a PAT — service tokens do not work for that tool.
DBT_PROD_ENV_IDRequiredYour production environment ID (numeric integer).
DBT_DEV_ENV_IDRequired for execute_sqlYour development environment ID (numeric integer).
DBT_USER_IDRequired for execute_sqlYour numeric user ID.
DBT_ACCOUNT_IDRequired for Admin APIYour numeric account ID.
Loading table...

See Finding your IDs for step-by-step instructions on locating each value.

Tool configuration

dbt MCP has two modes for controlling which tools are available: disable mode (default) and enable mode (allowlist).

Toolsets may grow over time as new capabilities are added. The naming pattern generalizes to DISABLE_{TOOLSET}= and DBT_MCP_ENABLE_{TOOLSET}=, so new toolsets follow the same convention. For the latest list of toolset names, refer to the tables below or the dbt-mcp README.

Which mode should I use?
  • Disable mode: Use when you want most tools available and only need to turn a few off.
  • Enable mode: Use when you want only a specific set of tools available.

Do not mix both modes for the same toolset. For example avoid this pattern:

# ❌ Mixing modes leads to unpredictable behavior
DISABLE_SEMANTIC_LAYER=false
DBT_MCP_ENABLE_SEMANTIC_LAYER=true

Also avoid empty `DBT_MCP_ENABLE_*=` lines as they activate enable mode and will silently disable all other toolsets.

Disable mode (default)

All tools are available by default. To disable a toolset, set any of the following variables to true in your MCP client configuration:

VariableDefaultDescription
DISABLE_DBT_CLIfalseDisable dbt CLI tools.
DISABLE_SEMANTIC_LAYERfalseDisable Semantic Layer tools.
DISABLE_DISCOVERYfalseDisable Discovery API tools.
DISABLE_ADMIN_APIfalseDisable Admin API tools.
DISABLE_SQLtrueSQL tools are disabled by default. Set to false to enable.
DISABLE_DBT_CODEGENtrueCodegen tools are disabled by default. Set to false to enable (requires dbt-codegen package).
DISABLE_LSPfalseDisable LSP/Fusion tools.
DISABLE_MCP_SERVER_METADATAtrueServer metadata tools are disabled by default. Set to false to enable.
DISABLE_TOOLS""Comma-separated list of specific tool names to disable.
Loading table...

Enable mode (allowlist)

If any DBT_MCP_ENABLE_* variable is set, only the explicitly enabled toolsets are active:

VariableDescription
DBT_MCP_ENABLE_DBT_CLISet to true to enable dbt CLI tools.
DBT_MCP_ENABLE_SEMANTIC_LAYERSet to true to enable Semantic Layer tools.
DBT_MCP_ENABLE_DISCOVERYSet to true to enable Discovery API tools.
DBT_MCP_ENABLE_ADMIN_APISet to true to enable Admin API tools.
DBT_MCP_ENABLE_SQLSet to true to enable SQL tools.
DBT_MCP_ENABLE_DBT_CODEGENSet to true to enable codegen tools.
DBT_MCP_ENABLE_LSPSet to true to enable LSP/Fusion tools.
DBT_MCP_ENABLE_TOOLSComma-separated list of specific tool names to enable.
Loading table...

Precedence

When multiple variables are set, they're evaluated in this order (highest priority first):

  1. DBT_MCP_ENABLE_TOOLS (enable specific tools by name)
  2. DISABLE_TOOLS (disable specific tools by name)
  3. Toolset enable (DBT_MCP_ENABLE_*=true)
  4. Toolset disable (DISABLE_*=true)
  5. Default behavior

Logging and debugging

VariableDefaultDescription
DBT_MCP_LOG_LEVELINFOLog level for the MCP server. Options: DEBUG, INFO, WARNING, ERROR, CRITICAL. Set to DEBUG temporarily to diagnose issues.
MCP_TRANSPORTstdioTransport protocol. Set to streamable-http for local debugging only (for example, attaching a Python debugger). See the dbt-mcp CONTRIBUTING guide.
Loading table...

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading