Skip to main content

Run dbt MCP locally

dbt MCP
AI
Quickstart
Beginner
Menu

    This quickstart walks you through connecting dbt MCP server to your local dbt project. This setup gives you dbt command tools (run, build, test, compile, and more) inside your AI assistant.

    If you'd like to connect to dbt platform with the CLI, see the OAuth quickstart.

    To connect to dbt Wizard, see the dbt Wizard quickstart.

    No clone required

    You don't need to clone the dbt-mcp repository. Install uv and run uvx dbt-mcp — it fetches and runs dbt-mcp for you.

    Prerequisites​

    • Install uv
    • A local dbt project (the folder containing your dbt_project.yml file)
    • dbt installed and available locally

    For the full list of environment variables and how to enable or disable toolsets, see the Environment variables reference.

    Step 1: Find your paths​

    You need two values before configuring your MCP client:

    • DBT_PROJECT_DIR — the full path to your dbt project folder (where dbt_project.yml lives). For example, if your project name is jaffle_shop, the path should be /Users/yourname/dbt-projects/jaffle_shop.
    • DBT_PATH — the full path to your dbt executable.
    # Find DBT_PATH
    which dbt
    # Example output: /opt/homebrew/bin/dbt

    # Find DBT_PROJECT_DIR — run from inside your project folder
    pwd
    # Example output: /Users/yourname/projects/my_dbt_project

    Step 2: Add to your MCP client​

    Replace the paths below with the values from Step 1:

    1. In Claude Desktop, go to Settings → Developer tab → Edit Config.
    2. Paste the following configuration, replacing the paths with your actual values:
    {
    "mcpServers": {
    "dbt": {
    "command": "uvx",
    "args": ["dbt-mcp"],
    "env": {
    "DBT_PROJECT_DIR": "/path/to/your/dbt/project",
    "DBT_PATH": "/path/to/your/dbt/executable"
    }
    }
    }
    }
    1. Save and restart Claude Desktop.

    Config file location:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    Step 3: Test your setup​

    Ask your AI assistant to run a dbt command (for example, "Run dbt compile on my project" or "List all models in my project"). If dbt MCP is working, the assistant will execute the command against your local project.

     Optional: verify from the command line
    uvx dbt-mcp

    If there are no errors, your configuration is correct. Press Ctrl+C to stop the server.

    What's available​

    With CLI-only setup, your AI assistant can use:

    • dbt run, dbt build, dbt test, dbt compile, dbt list, dbt parse, dbt show
    • Model lineage and node details from your local project
    • Codegen tools (when enabled — see Environment variables reference)

    Platform features like Semantic Layer, Discovery API, and metadata queries require a dbt platform account. To add them, see Connect to dbt platform.

    Troubleshooting​

    Can't find the uvx executable
    Server not starting

    For all troubleshooting topics, see dbt MCP FAQs and troubleshooting.

    Next steps​

    Was this page helpful?

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

    0