Skip to main content

Use MCP servers with the dbt Wizard CLI Beta

The Model Context Protocol (MCP) connects dbt Wizard to external tools and context. Add an MCP server and dbt Wizard can call its tools mid-session — query the dbt MCP server for governed project metadata, open a pull request through the GitHub MCP server, or pull in any other MCP-compatible service.

Share your feedback!

We'd love to hear how dbt Wizard is working for you. Share your feedback by either running the /feedback slash command in your interactive terminal session or by going to the #dbt-wizard channel in the dbt Community Slack.

Thanks so much for your help in improving dbt Wizard and dbt data development!

For background on MCP itself, refer to the Model Context Protocol introduction. For the dbt-maintained server specifically, refer to the dbt MCP server.

Why use an MCP server

dbt Wizard natively understands your dbt project. An MCP server extends that reach to the other tools and systems your work depends on, so you can do more without leaving your session. Each server you add gives dbt Wizard a new set of tools it can call on your behalf. For example:

  • dbt MCP server for governed access to your models, metrics, and lineage.
  • GitHub server to read and review pull requests.
  • Data warehouse server, or another server, to pull in context that lives outside dbt.

The dbt Wizard CLI lets you add, remove, authenticate, and customize MCP servers, including per-tool approvals, through the config.toml file.

MCP servers are a CLI feature

You can configure MCP servers only in the dbt Wizard CLI. You can't add your own MCP servers in the dbt platform (Studio IDE and the home app), but dbt Wizard includes built-in dbt tools, such as dbt Agent skills and product documentation fetching through the dbt MCP server.

Supported MCP server types

dbt Wizard supports two transports:

TypeDescription
STDIO server (standard input/output, a server that runs as a program on your own computer, instead of one you connect to over the internet)Runs as a local process that dbt Wizard starts with a command (for example, npx or uvx). Supports environment variables.
Streamable HTTP serverA server you reach at a URL. Supports bearer-token and OAuth authentication.
Server instructions

For either transport, dbt Wizard reads the instructions field the server returns during initialization and uses it as cross-tool guidance.

Add an MCP server

Use the wizard mcp add command, or edit ~/.dbt/wizard/config.toml directly. Either one will write to the same [mcp_servers.NAME] configuration.

wizard mcp add SERVER_NAME --env VAR1=value1 -- COMMAND ARGS

Where:

  • SERVER_NAME is a name you choose for the server (for example, filesystem).
  • --env VAR1=value1 is optional and repeatable, and applies only to STDIO servers.
  • Everything after -- is the command dbt Wizard runs to launch the server, so the space after -- is intentional.

For example, add a filesystem MCP server that runs locally through npx. This server needs no environment variables, so omit --env:

wizard mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/my-project

To connect the dbt MCP server, use the streamable HTTP form below — refer to dbt MCP server under Examples.

Configuration keys

These keys can be set under an [mcp_servers.NAME] block in config.toml.

KeyApplies toDescription
commandSTDIOThe command that launches the server (for example, uvx or npx).
argsSTDIOArray of arguments passed to command.
envSTDIOTable of environment variables set when launching the server.
env_varsSTDIONames of existing environment variables to pass through to the server.
urlHTTPThe server endpoint for a streamable HTTP server.
bearer_token_env_varHTTPName of the environment variable to read a bearer token from. Sent as Authorization: Bearer TOKEN.
http_headersHTTPTable of static HTTP headers to send with each request.
env_http_headersHTTPHTTP headers whose values are read from environment variables.
scopesHTTPArray of OAuth scopes to request during login. Overrides the scopes the server advertises.
oauth.client_idHTTPOAuth client identifier presented during authorization and token exchange.
oauth_resourceHTTPOAuth resource parameter to include in login requests (RFC 8707).
enabledBothWhether the server is active. Defaults to true.
requiredBothWhen true, wizard exec errors if this server fails to initialize.
enabled_toolsBothAllowlist of tool names to expose from the server.
disabled_toolsBothBlocklist of tool names to hide from the server.
default_tools_approval_modeBothDefault approval mode for this server's tools: prompt (ask before each call) or auto/approve (run without asking, which behave the same).
startup_timeout_secBothHow long to wait for the server to start and list its tools.
tool_timeout_secBothHow long to wait for an individual tool call.

Set per-tool approvals with a [mcp_servers.NAME.tools.TOOL_NAME] block and an approval_mode of auto, prompt, or approve:

[mcp_servers.github.tools.create_pull_request]
approval_mode = "approve"

Authenticate a server

If a streamable HTTP server uses OAuth, you must authenticate from the CLI before dbt Wizard can use it. Run:

wizard mcp login SERVER_NAME
wizard mcp logout SERVER_NAME

To request specific scopes at login, pass the --scopes CLI flag with a comma-separated list. This requests the same scopes as the scopes key in config.toml, but only for that login:

wizard mcp login SERVER_NAME --scopes read,write

For servers that use a static token, set bearer_token_env_var to the name of an environment variable holding the token, and export that variable before starting wizard.

Manage MCP servers (CLI)

Manage your configured servers through the dbt Wizard CLI, or by editing config.toml directly. The CLI provides these commands:

CommandWhat it does
wizard mcp listList configured MCP servers. Add --json for machine-readable output.
wizard mcp get NAMEShow the configuration for one server.
wizard mcp add NAME ...Add a STDIO or streamable HTTP server.
wizard mcp remove NAMERemove a server's configuration.
wizard mcp login NAMEAuthenticate with an OAuth server.
wizard mcp logout NAMESign out of an OAuth server.

Approvals and tool permissions

MCP tool calls follow the same approval and sandboxing rules as the rest of dbt Wizard. Set enabled_tools and disabled_tools in config.toml to control which tools a server exposes (there's no dedicated CLI flag). That way, dbt Wizard calls only the tools you intend.

Examples

The following examples show common scenarios for adding an MCP server and how to configure them.

dbt MCP server

The dbt MCP server gives dbt Wizard governed access to your project's models, metrics, lineage, freshness, and platform APIs. You can connect it two ways:

Runs on your machine through uvx and works with or without a dbt platform account — the best fit for development:

wizard mcp add dbt -- uvx dbt-mcp

The local server reads its connection settings (such as DBT_HOST, DBT_TOKEN, and DBT_PROJECT_DIR) from environment variables, typically a .env file in your dbt project root. You don't need a URL. For setup, refer to Run dbt locally and Set up local MCP.

Then prompt dbt Wizard:

Use the dbt MCP server to find the most recent failed run for the
nightly job and summarize the error.

GitHub MCP server for pull request review

Connect a GitHub MCP server so dbt Wizard can read a pull request and post review comments:

~/.dbt/wizard/config.toml
[mcp_servers.github]
url = "https://api.githubcopilot.com/mcp/"
# This is the NAME of an environment variable, not the token itself.
# Keep your real token out of this file.
bearer_token_env_var = "GITHUB_MCP_TOKEN"

Then set that environment variable to your actual token before starting dbt Wizard:

export GITHUB_MCP_TOKEN="your-real-token-here"

At runtime, dbt Wizard reads the token from the environment and sends it as Authorization: Bearer <the token>. Store only the variable name in config.toml to keep the secret out of your committed config.

Review the dbt model changes in PR #482 — check for missing tests on
new columns and confirm downstream refs still resolve.

Was this page helpful?

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

0
Loading