Get the FREE Ultimate OpenClaw Setup Guide →

dbt

A MCP (Model Context Protocol) server for interacting with dbt.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dbt-labs-dbt-mcp node server.js \
  --env DBT_CONFIG="Optional path to dbt_project.yml or dbt profiles if needed" \
  --env DBT_API_KEY="API key or token for authenticated access (if applicable)" \
  --env DBT_API_ENDPOINT="URL for any hosting/dbt Platform integration (if applicable)" \
  --env DBT_PROJECT_ROOT="Path to your dbt project root (absolute or relative)"

How to use

This MCP server exposes a collection of tools to interact with your dbt workstreams via AI agents. The server bundles SQL execution capabilities against dbt Platform infrastructure, semantic layer access to metrics and saved queries, and discovery endpoints to inspect models, sources, macros, lineage, and more. Agents can request generated SQL, fetch metric definitions, inspect model health, pull lineage graphs, and run or test dbt commands in the context of your project. The tools are organized into categories such as SQL, Semantic Layer, Discovery, dbt CLI, Admin API, dbt Codegen, and dbt LSP, enabling comprehensive project introspection and operational automation through natural language prompts.

How to install

Prerequisites:

  • Node.js (recommended LTS version) installed on your machine or server
  • Access to your dbt project (local or remote)
  1. Clone the repository or set up the MCP server package for dbt:

    • git clone <dbt-mcp-repo-url>
    • cd dbt-mcp-repo
  2. Install dependencies:

    • npm install
  3. Configure environment variables (example):

    • Create a .env file or export variables in your environment
    • DBT_PROJECT_ROOT=/path/to/your/dbt/project
    • DBT_CONFIG=/path/to/your/dbt/project/dbt_project.yml
    • DBT_API_ENDPOINT=https://dbt-platform.example/api
    • DBT_API_KEY=your-api-key
  4. Start the MCP server:

    • npm run start (Alternatively, if using the provided Node entry point, you can run: node server.js)
  5. Verify the server is running by visiting the MCP endpoint or checking logs for a successful startup.

Additional notes

Notes and tips:

  • The server exposes an experimental MCP Bundle (dbt-mcp.mcpb) in release assets for easier client integration; download and follow mcpb docs if you plan to use that bundle.
  • If you are using dbt Platform, ensure proper API credentials and network access are configured for the SQL and admin endpoints.
  • The env variables are placeholders; replace them with real values or your environment’s configuration management system.
  • If you encounter issues with dbt project discovery, verify the DBT_PROJECT_ROOT path and ensure the project is accessible by the server process.
  • For production deployments, consider using a process manager and setting up proper logging, retries, and secret management for API keys and tokens.

Related MCP Servers

Sponsor this space

Reach thousands of developers