dbt-mcp
Provides tools to interact with dbt, enabling AI agents to run dbt commands (e.g., build, test, run) and query dbt Cloud APIs (Discovery, Semantic Layer) for analytics engineering workflows.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dbt-mcpshow me the documentation for the orders model"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dbt MCP Server
This MCP (Model Context Protocol) server provides tools to interact with dbt. Read this blog to learn more. Add comments or questions to GitHub Issues or join us in the community Slack in the #tools-dbt-mcp channel.
Architecture

Related MCP server: @us-all/dbt-mcp
Setup
Copy the
.env.examplefile locally under a file called.envand set it with your specific environment variables (see theConfigurationsection of theREADME.md)
Configuration
The MCP server takes the following environment variable configuration:
Tool Groups
Name | Default | Description |
|
| Set this to |
|
| Set this to |
|
| Set this to |
|
| Set this to |
| "" | Set this to a list of tool names delimited by a |
Configuration for Discovery, Semantic Layer, and Remote Tools
Name | Default | Description |
|
| Your dbt Cloud instance hostname. This will look like an |
| - | If you are using Multi-cell, set this to your |
| - | Your personal access token or service token. Note: a service token is required when using the Semantic Layer and this service token should have at least |
| - | Your dbt Cloud production environment ID |
Configuration for Remote Tools
Name | Description |
| Your dbt Cloud development environment ID |
| Your dbt Cloud user ID |
Configuration for dbt CLI
Name | Description |
| The path to where the repository of your dbt Project is hosted locally. This should look something like |
| The path to your dbt Core, dbt Cloud CLI, or dbt Fusion executable. You can find your dbt executable by running |
| Configure the number of seconds before your agent will timeout dbt CLI commands. Defaults to 10 seconds. |
It is also possible to set any environment variable supported by your dbt executable (see here for the ones supported in dbt Core).
We automatically set DBT_WARN_ERROR_OPTIONS='{"error": ["NoNodesForSelectionCriteria"]}' so that the MCP server knows if no node is selected when running a dbt command.
You can overwrite it if needed but we believe that it provides a better experience when calling dbt from the MCP server, making sure that the tool is selecting valid nodes.
Using with MCP Clients
After going through the Setup, you can use dbt-mcp with an MCP client.
Add this configuration to the respective client's config file. Be sure to replace the sections within <>:
{
"mcpServers": {
"dbt-mcp": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
},
}
}<path-to-.env-file> is where you saved the .env file from the Setup step
Claude Code
Run the following command to add the MCP server to Claude Code:
claude mcp add dbt -- uvx --env-file <path-to-.env-file> dbt-mcpBy default the MCP server is installed in the "local" scope, meaning that it will be active for Claude Code sessions in the current directory for the user who installed it.
It is also possible to install the MCP server:
in the "user" scope, to have it installed for all Claude Code sessions, independently of the directory used
in the "project" scope, to create a config file that can be version controlled so that all developers of the same project can have the MCP server already installed
To install it in the project scope, run the following and and commit the .mcp.json file. Be sure to use an env var file path that is the same for all users.
claude mcp add dbt -s project -- uvx --env-file <path-to-.env-file> dbt-mcpMore info on scopes here
Claude Desktop
Follow these instructions to create the claude_desktop_config.json file and connect.
For debugging, you can find the Claude Desktop logs at ~/Library/Logs/Claude for Mac or %APPDATA%\Claude\logs for Windows.
Cursor
Note the configuration options here and input your selections with this link:
Cursor MCP docs here for reference
VS Code
Open the Settings menu (Command + Comma) and select the correct tab atop the page for your use case
Workspace- configures the server in the context of your workspaceUser- configures the server in the context of your userNote for WSL users: If you're using VS Code with WSL, you'll need to configure WSL-specific settings. Run the Preferences: Open Remote Settings command from the Command Palette (F1) or select the Remote tab in the Settings editor. Local User settings are reused in WSL but can be overridden with WSL-specific settings. Configuring MCP servers in the local User settings will not work properly in a WSL environment.
Select Features → Chat
Ensure that "Mcp" is
Enabled
Open the command palette
Control/Command + Shift + P, and select either "MCP: Open Workspace Folder MCP Configuration" or "MCP: Open User Configuration" depending on whether you want to install the MCP server for this workspace or for all workspaces for the userAdd your server configuration (
dbt) to the providedmcp.jsonfile as one of the servers:
{
"servers": {
"dbt": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
}
}
}<path-to-.env-file> is where you saved the .env file from the Setup step
You can start, stop, and configure your MCP servers by:
Running the
MCP: List Serverscommand from the Command Palette (Control/Command + Shift + P) and selecting the serverUtlizing the keywords inline within the
mcp.jsonfile
VS Code MCP docs here for reference
Troubleshooting
Some MCP clients may be unable to find
uvxfrom the JSON config. If this happens, try finding the full path touvxwithwhich uvxon Unix systems and placing this full path in the JSON. For instance:"command": "/the/full/path/to/uvx".
Tools
dbt CLI
build- Executes models, tests, snapshots, and seeds in dependency ordercompile- Generates executable SQL from models, tests, and analyses without running themdocs- Generates documentation for the dbt projectls(list) - Lists resources in the dbt project, such as models and testsparse- Parses and validates the project’s files for syntax correctnessrun- Executes models to materialize them in the databasetest- Runs tests to validate data and model integrityshow- Runs a query against the data warehouse
Allowing your client to utilize dbt commands through this MCP tooling could modify your data models, sources, and warehouse objects. Proceed only if you trust the client and understand the potential impact.
Semantic Layer
list_metrics- Retrieves all defined metricsget_dimensions- Gets dimensions associated with specified metricsget_entities- Gets entities associated with specified metricsquery_metrics- Queries metrics with optional grouping, ordering, filtering, and limiting
Discovery
get_mart_models- Gets all mart modelsget_all_models- Gets all modelsget_model_details- Gets details for a specific modelget_model_parents- Gets parent nodes of a specific modelget_model_children- Gets children modes of a specific model
Remote
text_to_sql- Generate SQL from natural language requestsexecute_sql- Execute SQL on dbt Cloud's backend infrastructure with support for Semantic Layer SQL syntax. Note: using a PAT instead of a service token forDBT_TOKENis required for this tool.
Contributing
Read CONTRIBUTING.md for instructions on how to get involved!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bratko1234/dbt-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server