Skip to main content

The silent dbt MCP configurator for VS Code โ€” sets up dbt-mcp with a secure, minimal configuration

Project description

๐Ÿคซ dbt-mshhcp-setup

The simple and silent dbt MCP configurator for VS Code.

Sets up the dbt MCP server in your VS Code workspace without touching your existing environment. A step-by-step wizard asks for confirmation at every stage โ€” it never modifies anything without your explicit approval.

This project doesn't reinvent the wheel, nor is it full of innovations and glitz. It just does what it needs to do without any fuss.

What it does

Generates a .vscode/mcp.json file that connects GitHub Copilot (and other MCP clients in VS Code) to your local dbt project via the dbt-mcp server. The configuration is minimal and secure by design:

  • Only dbt CLI tools are enabled (DBT_MCP_ENABLE_DBT_CLI=true) โ€” dbt run, build, test, compile, list, parse, show, and lineage queries.
  • All platform features are disabled โ€” Semantic Layer, Discovery API, Admin API, SQL execution, Codegen, and LSP stay off. This is achieved via dbt's enable-mode allowlist: setting any DBT_MCP_ENABLE_* variable activates allowlist mode, so only explicitly enabled toolsets are available โ€” including any new ones added in future dbt-mcp versions.
  • Existing configs are never silently overwritten โ€” if mcp.json already exists, the wizard shows the current servers and asks whether to add a new one.

Requirements

Requirement Notes
Python 3.10+ Included with most systems
uv The wizard installs it automatically if missing
A local dbt project Folder containing dbt_project.yml
dbt installed locally Either in a .venv or on PATH
VS Code With GitHub Copilot or another MCP client

Supported platforms: Ubuntu 24.04, Windows 11, Windows 11 (WSL 2).

Quick start

No clone required. Run directly with uvx:

uvx dbt-mshhcp-setup

The wizard walks you through 6 steps:

  โ”Œโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  d  โ”œโ”€โ”ค  b  โ”œโ”€โ”ค  t  โ”‚   ๐Ÿคซ  shhh...
  โ””โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”˜
  dbt-mshhcp-setup ยท v0.1.0
  The silent dbt MCP configurator

[1/6] Checking prerequisites...
  โœ“ uv 0.7.x found

[2/6] Target workspace
  ? Path to your VS Code workspace: /home/you/my-repo
  โœ“ .vscode directory found

[3/6] Checking existing configuration...
  โœ“ No existing mcp.json โ€” ready to configure

[4/6] Configure server(s)
  --- Server 1 ---
  ? Server name (e.g. dbt-databricks): dbt-databricks
  ? Path to dbt project (folder containing dbt_project.yml): /home/you/my-repo/dbt_project
  โœ“ dbt project found.
  Environment loading method:
    1) direnv
    2) --env-file  (recommended by dbt)
    3) None  (direct uvx)
  ? Select [3]: 2
  ? Absolute path to .env file: /home/you/my-repo/dbt_project/.env
  โ„น Auto-detected DBT_PATH: /home/you/my-repo/dbt_project/.venv/bin/dbt
  ? DBT_PATH [/home/you/my-repo/dbt_project/.venv/bin/dbt]:
  ? DBT_CLI_TIMEOUT (seconds) [180]:
  โœ“ Server 'dbt-databricks' configured.

  ? Add another server? [y/N]: n

[5/6] Review

  Configuration preview (1 server(s)):

  {
    "servers": {
      "dbt-databricks": {
        "command": "uvx",
        "args": ["--env-file", "/home/you/my-repo/dbt_project/.env", "dbt-mcp"],
        "env": {
          "DBT_PROJECT_DIR": "/home/you/my-repo/dbt_project",
          "DBT_PATH": "/home/you/my-repo/dbt_project/.venv/bin/dbt",
          "DBT_CLI_TIMEOUT": "180",
          "DBT_MCP_ENABLE_DBT_CLI": "true"
        }
      }
    }
  }

  โ„น Only dbt CLI tools are enabled (DBT_MCP_ENABLE_DBT_CLI=true).
     All platform features (Semantic Layer, Discovery, Admin API, etc.) are disabled.

  ? Write to /home/you/my-repo/.vscode/mcp.json? [Y/n]: Y
  โœ“ Written to /home/you/my-repo/.vscode/mcp.json

[6/6] Smoke test
  Validating paths and checking uvx can resolve dbt-mcp...
  โœ“ All paths valid.
  โœ“ uvx can resolve dbt-mcp.

โœ“ All done! Restart VS Code to activate the MCP server(s).

How it works

flowchart TD
    START([uvx dbt-mshhcp-setup]) --> S1

    subgraph S1 ["[1/6] Prerequisites"]
        UV{uv installed?}
        UV -- Yes --> UV_OK([โœ“ continue])
        UV -- No --> UV_PROMPT{Install uv now?}
        UV_PROMPT -- No --> E1([Exit])
        UV_PROMPT -- Yes --> UV_INSTALL[Run installer]
        UV_INSTALL --> UV_CHECK{Installed OK?}
        UV_CHECK -- No --> E2([Exit])
        UV_CHECK -- Yes --> UV_OK
    end

    S1 --> S2

    subgraph S2 ["[2/6] Target workspace"]
        WS[Prompt workspace path]
        WS --> WS_DIR{Directory exists?}
        WS_DIR -- No --> WS
        WS_DIR -- Yes --> VSCODE{.vscode/ exists?}
        VSCODE -- Yes --> VSCODE_OK([โœ“ continue])
        VSCODE -- No --> VSCODE_CREATE{Create .vscode/?}
        VSCODE_CREATE -- No --> E3([Exit])
        VSCODE_CREATE -- Yes --> MKDIR[mkdir .vscode/]
        MKDIR --> VSCODE_OK
    end

    S2 --> S3

    subgraph S3 ["[3/6] Existing configuration"]
        MCP{mcp.json exists?}
        MCP -- No --> MCP_FRESH([โœ“ fresh config])
        MCP -- Yes --> MCP_SHOW[Show existing servers]
        MCP_SHOW --> MCP_ADD{Add a new server?}
        MCP_ADD -- No --> E4([Exit โ€” no changes])
        MCP_ADD -- Yes --> MCP_FRESH
    end

    S3 --> S4

    subgraph S4 ["[4/6] Configure server(s)"]
        NAME[Prompt server name]
        NAME --> NAME_OK{Valid & unique?}
        NAME_OK -- No --> NAME
        NAME_OK -- Yes --> PROJ[Prompt dbt project path]
        PROJ --> PROJ_OK{"dbt_project.yml\nfound?"}
        PROJ_OK -- No --> PROJ
        PROJ_OK -- Yes --> ENV[Prompt env loading mode]
        ENV --> ENV_CHOICE{Mode?}
        ENV_CHOICE -- direnv --> DIRENV[Prompt direnv exec path]
        ENV_CHOICE -- env-file --> ENVFILE[Prompt .env file path]
        ENV_CHOICE -- direct --> DBTPATH
        DIRENV --> DBTPATH[Auto-detect DBT_PATH]
        ENVFILE --> DBTPATH
        DBTPATH --> DBTPATH_CONFIRM[Confirm / override path]
        DBTPATH_CONFIRM --> TIMEOUT[Prompt timeout]
        TIMEOUT --> ANOTHER{Add another server?}
        ANOTHER -- Yes --> NAME
        ANOTHER -- No --> S4_DONE([โœ“ servers collected])
    end

    S4 --> S5

    subgraph S5 ["[5/6] Review & write"]
        PREVIEW[Show JSON preview]
        PREVIEW --> SEC_NOTE["โ„น DBT_MCP_ENABLE_DBT_CLI=true\nAll platform features disabled"]
        SEC_NOTE --> WRITE_Q{Write mcp.json?}
        WRITE_Q -- No --> E5([Exit โ€” no changes])
        WRITE_Q -- Yes --> WRITE[Write .vscode/mcp.json]
        WRITE --> S5_DONE([โœ“ written])
    end

    S5 --> S6

    subgraph S6 ["[6/6] Smoke test"]
        TEST_PATHS[Validate all paths exist]
        TEST_PATHS --> UVX_AVAIL{uvx in PATH?}
        UVX_AVAIL -- No --> WARNS
        UVX_AVAIL -- Yes --> TEST_UVX[Check uvx resolves dbt-mcp]
        TEST_UVX --> WARNS{Any warnings?}
        WARNS -- Yes --> SHOW_WARN[Print warnings]
        WARNS -- No --> ALL_OK[All checks passed]
        SHOW_WARN --> DONE_WARN([Done โ€” review warnings])
        ALL_OK --> DONE([โœ“ All done!])
    end

Environment loading modes

Each server can load environment variables (database credentials, profiles, etc.) in one of three ways:

Mode command Use case
direnv direnv exec /path uvx dbt-mcp Projects that use direnv for automatic env loading
--env-file uvx --env-file /path/.env dbt-mcp Projects with a .env file (recommended by dbt)
direct uvx dbt-mcp Simple setups where env vars are already in the env block

The database credentials themselves live in your .env or direnv setup โ€” dbt-mshhcp-setup never reads, stores, or prints them.

Multiple dbt projects

You can configure more than one server in a single run (e.g. one for Databricks, one for BigQuery). Each server gets its own entry in mcp.json:

{
  "servers": {
    "dbt-databricks": {
      "command": "direnv",
      "args": ["exec", "/home/you/data-platform/dbt_project", "uvx", "dbt-mcp"],
      "env": {
        "DBT_PROJECT_DIR": "/home/you/data-platform/dbt_project",
        "DBT_PATH": "/home/you/data-platform/dbt_local_run/.venv/bin/dbt",
        "DBT_CLI_TIMEOUT": "180",
        "DBT_MCP_ENABLE_DBT_CLI": "true"
      }
    },
    "dbt-bigquery": {
      "command": "uvx",
      "args": ["--env-file", "/home/you/people-analytics/.env", "dbt-mcp"],
      "env": {
        "DBT_PROJECT_DIR": "/home/you/people-analytics",
        "DBT_PATH": "/home/you/people-analytics/.venv/bin/dbt",
        "DBT_CLI_TIMEOUT": "180",
        "DBT_MCP_ENABLE_DBT_CLI": "true"
      }
    }
  }
}

If mcp.json already exists with servers you configured earlier, re-running the wizard offers to add a new server โ€” it will not touch the existing entries.

WSL 2 notes

VS Code's MCP configuration behaves differently in WSL. The wizard writes to the workspace .vscode/mcp.json (not to user settings), which is the correct location for WSL environments. See the dbt VS Code integration docs for details.

Development

git clone https://github.com/your-org/dbt-mshhcp-setup
cd dbt-mshhcp-setup
uv sync          # creates .venv, installs runtime + dev deps, generates uv.lock
uv run pytest    # run tests
uv run dbt-mshhcp-setup  # run the wizard locally

Project structure

dbt-mshhcp-setup/
โ”œโ”€โ”€ pyproject.toml                    # deps, build config, entry point
โ”œโ”€โ”€ uv.lock                           # reproducible dependency lock (commit this)
โ”œโ”€โ”€ .python-version                   # pins Python 3.10
โ””โ”€โ”€ src/
    โ””โ”€โ”€ dbt_mshhcp_setup/
        โ”œโ”€โ”€ __init__.py               # __version__
        โ”œโ”€โ”€ cli.py                    # interactive wizard (6 steps)
        โ”œโ”€โ”€ config.py                 # build / read / write mcp.json
        โ””โ”€โ”€ checks.py                 # uv detection, path validation, smoke test

What is NOT in scope

This tool is intentionally minimal. It does not:

  • Configure dbt platform / dbt Cloud features (Semantic Layer, Discovery API, OAuth)
  • Set up or scaffold dbt projects
  • Manage database credentials
  • Modify VS Code settings.json

For full dbt MCP documentation, see docs.getdbt.com/docs/dbt-ai.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_mshhcp_setup-0.1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_mshhcp_setup-0.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt_mshhcp_setup-0.1.0.tar.gz.

File metadata

  • Download URL: dbt_mshhcp_setup-0.1.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dbt_mshhcp_setup-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a73af84fc55804836842b358ba62c7ce2860ce4dc2ae4723e52a64c3995c664a
MD5 38959d4db76b6ad48a1c18fbf1981be3
BLAKE2b-256 4207d0f4917277b15f1d4ccc3e566c6f13f779b297083967a18ab03bd98a7983

See more details on using hashes here.

File details

Details for the file dbt_mshhcp_setup-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dbt_mshhcp_setup-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dbt_mshhcp_setup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e58a473f6b3bb9d17aaa3b3989846cf6e1649cef272eecf1734b06f59948f5a
MD5 bc5e1e6bc0f6a2c84aaf70dd45b1222f
BLAKE2b-256 b1bd2e06d1a38299ea4c1bc0c4ee073bb207fd1ec9ef69c8b90153d26e2cd615

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page