New: one score for how consistent your answers are. See more

What the dbt MCP server can do, and which tools to turn on

Local or remote, dbt Core or the dbt platform: what each tool group needs, how to connect Claude, Cursor or ChatGPT, and how to keep it read-only.

December 1, 2026•10 min read•Vivek Sah
Jump to a section

The dbt MCP server lets Claude, ChatGPT or Cursor read your dbt project: models, lineage, tests, job runs and Semantic Layer metrics. It is open source, it runs either on your laptop or hosted by dbt, and depending on which tools you leave on, it can also build models in your warehouse and trigger production jobs. (Source: dbt docs: About dbt Model Context Protocol (MCP) server, https://docs.getdbt.com/docs/dbt-ai/about-mcp, checked on 2026-12-01) Most of the setup decisions come down to that last part.

Two servers with one name

"dbt MCP server" covers two deployments. The self-hosted one is the dbt-mcp Python package, Apache-2.0 licensed, that you start with uvx dbt-mcp. (Source: GitHub: dbt-labs/dbt-mcp, https://github.com/dbt-labs/dbt-mcp, checked on 2026-12-01) The remote one is the same server run by dbt Labs at a URL on your dbt platform account. dbt positions the local server for development (writing models, tests and docs) and the remote one for consumption: querying metrics, exploring metadata and viewing lineage. (Source: dbt docs: About dbt Model Context Protocol (MCP) server, https://docs.getdbt.com/docs/dbt-ai/about-mcp, checked on 2026-12-01)

Self-hosted (uvx dbt-mcp)Remote (hosted by dbt)
Installuv on each machineNone, a URL in your client
Works with dbt Core aloneYes, CLI tools against a local projectNo, it needs a dbt platform account
Runs dbt build, run, testYesNo
Semantic Layer, Discovery, Admin APIYes, with a dbt platform accountYes
Codegen toolsYesNo
Sign-inOAuth, personal access token or service tokenOAuth (public beta on Starter, Enterprise and Enterprise+) or a token in headers
Tool listFixed by the version you pinCan change without notice

The last row matters if you plan to restrict tools by name. dbt's tool reference says remote tool names can change without notice, and suggests pinning a self-hosted version if you need a frozen tool set. (Source: dbt docs: Available tools, https://docs.getdbt.com/docs/dbt-ai/mcp-available-tools, checked on 2026-12-01)

What each tool group touches

The server ships about 60 tools in nine groups. Ten Discovery tools are marked deprecated, like get_model_details and get_model_parents, and sit next to the broader get_node_details and get_lineage. (Source: dbt docs: Available tools, https://docs.getdbt.com/docs/dbt-ai/mcp-available-tools, checked on 2026-12-01) The useful way to read the list is by what each group can change.

GroupExample toolsWhereNeedsCan it change things?
dbt CLIbuild, run, test, show, compile, listLocal onlyDBT_PROJECT_DIR and DBT_PATH; works with dbt CoreYes: builds tables and views in your warehouse
Semantic Layerlist_metrics, get_dimensions, query_metrics, get_metrics_compiled_sqlBothStarter, Enterprise or Enterprise+No, but queries are billed
SQLexecute_sql, text_to_sqlBothA personal access token (service tokens don't work for execute_sql); text_to_sql needs dbt's AI features onRuns whatever SQL the model writes
Discoveryget_all_models, get_lineage, get_model_health, get_model_performanceBothStarter, Enterprise or Enterprise+No
Admin APIlist_jobs, get_job_run_error, trigger_job_run, cancel_job_runBothDBT_ACCOUNT_ID on self-hostedYes: starts, retries and cancels jobs
Codegengenerate_source, generate_staging_modelLocal onlyThe dbt-codegen packageWrites YAML and SQL for you to save
dbt LSP / Fusionget_column_lineage, fusion.compile_sqlBothThe dbt platform for fusion.*, the dbt VS Code extension locallyNo
Product Docs, Server Metadatasearch_product_docs, get_mcp_server_versionBothNothingNo

Plan requirements come from the APIs underneath. The Semantic Layer needs a Starter or Enterprise-tier account, (Source: dbt docs: dbt Semantic Layer, https://docs.getdbt.com/docs/use-dbt-semantic-layer/dbt-sl, checked on 2026-12-01) and so does the Discovery API. (Source: dbt docs: Discovery API, https://docs.getdbt.com/docs/dbt-cloud-apis/discovery-api, checked on 2026-12-01) On the free Developer plan neither is available, so dbt Core users get most of their value from the self-hosted CLI tools.

Which tools to turn on for which job

The default self-hosted config turns on the CLI, Semantic Layer, Discovery, Admin API and LSP groups whenever their variables are set, and leaves SQL and Codegen off. (Source: dbt docs: Set up self-hosted MCP, https://docs.getdbt.com/docs/dbt-ai/setup-local-mcp, checked on 2026-12-01) That is a lot of surface for someone who wants to ask what last month's revenue was. Start from the job instead.

JobTurn onLeave offDeployment
Business users asking for numbersSemantic LayerCLI, SQL, Admin APIRemote
Analysts exploring models before writing SQLDiscovery, Semantic LayerCLI, Admin APIRemote
Engineer writing and testing modelsCLI, Discovery, Codegen, LSPAdmin APISelf-hosted, dev target
On-call debugging a failed jobAdmin API (read tools), DiscoveryCLIEither
Agent with free rein in a sandboxEverythingNothingSelf-hosted, sandbox warehouse only

The on-call row is the one people get wrong. get_job_run_error and list_jobs_runs sit in the same group as trigger_job_run and retry_job_run, so turning on the Admin API for diagnosis also lets the model rerun production jobs unless you narrow it to named tools.

Setting it up

Pick the variant that matches your account. Each JSON block below goes in claude_desktop_config.json for Claude Desktop, .mcp.json in the project root for Claude Code, or .cursor/mcp.json for Cursor.

dbt Core, no dbt platform account

  1. Install uv and find two paths: run which dbt for the executable, and use the folder that contains dbt_project.yml.
  2. Add the server:
{
  "mcpServers": {
    "dbt": {
      "command": "uvx",
      "args": ["dbt-mcp"],
      "env": {
        "DBT_PROJECT_DIR": "/path/to/your/dbt/project",
        "DBT_PATH": "/path/to/your/dbt/executable"
      }
    }
  }
}
  1. Restart the client. If it reports spawn uvx ENOENT, replace "uvx" with the full path from which uvx. (Source: dbt docs: Set up self-hosted MCP, https://docs.getdbt.com/docs/dbt-ai/setup-local-mcp, checked on 2026-12-01)

dbt platform, self-hosted

Add DBT_HOST (your Access URL hostname, like abc123.us1.dbt.com) to the env block above. On first start, the server opens a browser for OAuth and you pick a project. OAuth needs an account with a static subdomain. For shared or CI setups, dbt recommends a service token instead, set with DBT_TOKEN, DBT_PROD_ENV_ID and, for Admin API tools, DBT_ACCOUNT_ID. Use numeric IDs, not URLs copied from the browser. (Source: dbt docs: Set up self-hosted MCP, https://docs.getdbt.com/docs/dbt-ai/setup-local-mcp, checked on 2026-12-01)

Remote server

Copy the MCP URL from Account settings, Access URLs. It has the form https://YOUR_DBT_HOST/api/ai/v1/mcp/. (Source: dbt docs: Connect to the remote dbt MCP server, https://docs.getdbt.com/docs/dbt-ai/mcp-quickstart-remote, checked on 2026-12-01)

ClientHow to add it
Claude Desktop and claude.aiCustomize, then Connectors, then Add custom connector with the MCP URL. Click Connect and approve the scopes on dbt's consent screen
Claude Code.mcp.json with "type": "http" and the url; add a headers block for token auth
Cursor.cursor/mcp.json with the url, or the deeplink in dbt's Cursor guide
ChatGPTThe dbt plugin from dbt Labs in OpenAI's business plugin directory; a workspace admin may need to approve it

For token auth, the headers are Authorization: Token YOUR_TOKEN and x-dbt-prod-environment-id. execute_sql also needs x-dbt-dev-environment-id and x-dbt-user-id, and only works with a personal access token. (Source: dbt docs: Connect to the remote dbt MCP server, https://docs.getdbt.com/docs/dbt-ai/mcp-quickstart-remote, checked on 2026-12-01) OpenAI's listing describes the ChatGPT plugin as covering project inspection, Semantic Layer queries, lineage, dbt commands and job management, and says availability depends on your plan and workspace settings. (Source: OpenAI: dbt plugin for ChatGPT, https://openai.com/business/plugins/dbt/, checked on 2026-12-01)

A read-only configuration

dbt's own README warns that the CLI tools "could modify your data models, sources, and warehouse objects". (Source: GitHub: dbt-labs/dbt-mcp, https://github.com/dbt-labs/dbt-mcp, checked on 2026-12-01) The toggles are documented, but spread across the setup and tool reference pages. Put together, a read-only server takes five lines.

The self-hosted server has two modes. Disable mode (DISABLE_DBT_CLI=true and so on) starts from everything and removes groups. Enable mode starts from nothing and adds only what you list, which is safer because a new tool group in a later version stays off. (Source: dbt docs: Set up self-hosted MCP, https://docs.getdbt.com/docs/dbt-ai/setup-local-mcp, checked on 2026-12-01)

# .env for a read-only, consumption-only dbt MCP server
DBT_HOST=abc123.us1.dbt.com
DBT_TOKEN=dbtc_xxx            # service token with "Semantic Layer Only" and "Metadata Only"
DBT_PROD_ENV_ID=12345
DBT_MCP_ENABLE_SEMANTIC_LAYER=true
DBT_MCP_ENABLE_DISCOVERY=true
# No DBT_PROJECT_DIR, DBT_PATH or DBT_ACCOUNT_ID: CLI and Admin API tools can't load without them

Point the client at it with "args": ["--env-file", "/absolute/path/.env", "dbt-mcp"], then run uvx --env-file /absolute/path/.env dbt-mcp once in a terminal to check it starts cleanly. Setting DBT_MCP_LOG_LEVEL=DEBUG for a run shows which toolsets loaded.

Two narrower patterns are worth knowing:

  1. For engineers who want the CLI without builds, list tools by name: DBT_MCP_ENABLE_TOOLS=list,compile,parse,show,get_lineage_dev,get_node_details_dev. Named tools take precedence over every group setting. show still runs a SELECT against your warehouse, so point the profile at a dev target.
  2. For on-call, keep the Admin API but name only the read tools: list_jobs, list_jobs_runs, get_job_run_details, get_job_run_error.

The remote server has no env vars. Control it with the scopes you approve on the OAuth consent screen, or with the permissions on the token you put in the headers. Client-side tool allowlists also work, with the caveat above that remote tool names can change.

What a question costs

The MCP server itself has no separate price on dbt's pricing page. What it calls does. Starter is $100 per user per month and includes 5,000 queried metrics a month. Enterprise and Enterprise+ include 20,000. (Source: dbt pricing, https://www.getdbt.com/pricing/, checked on 2026-12-01)

A queried metric is counted per metric, per successful request to render or run SQL through the Semantic Layer API. Grouping by more dimensions doesn't add to the count, compiling a metric counts the same as running it, and metadata requests and failed queries are free. (Source: dbt docs: How does dbt pricing work?, https://docs.getdbt.com/docs/platform/billing/how-pricing-works, checked on 2026-12-01)

Here is how that adds up for one question, "Show revenue and gross margin by country for the last four quarters", with an illustrative tool sequence:

StepToolQueried metrics
Find the metricslist_metrics0 (metadata)
Find the dimensionget_dimensions0 (metadata)
Check the SQL firstget_metrics_compiled_sql for 2 metrics2
Run itquery_metrics for 2 metrics2
Follow-up "now just EMEA"query_metrics for 2 metrics2
Total6

At 6 per conversation, Starter's 5,000 covers roughly 830 conversations a month, shared with every BI tool and spreadsheet on the Semantic Layer. dbt's launch post noted that models "will sometimes cycle through several unnecessary tool calls", (Source: dbt blog: Introducing the dbt MCP Server, https://docs.getdbt.com/blog/introducing-dbt-mcp-server, checked on 2026-12-01) so a retry loop on query_metrics spends real allowance. Your estimated usage shows under Account settings, Billing. execute_sql and the CLI's show don't count as queried metrics, but they run on your warehouse and bill as compute there.

Prompts that map cleanly to tools

The server works best when the question names the kind of answer you want, so the model picks the right group on the first call. These are phrased so each lands on one or two tools:

PromptTools it should reach for
"Which metrics do we have about revenue, and what dimensions can I slice them by?"list_metrics, get_dimensions
"Weekly active users by plan for the last 12 weeks, from the Semantic Layer only."query_metrics
"What feeds fct_orders, and what breaks if I rename customer_id?"get_lineage, get_node_details
"Which models failed tests or ran slowest in the last production run?"get_model_health, get_model_performance
"Why did last night's job fail? Don't rerun anything."list_jobs_runs, get_job_run_error
"Generate a staging model and source YAML for the new raw.stripe_refunds table."generate_source, generate_staging_model

"From the Semantic Layer only" and "don't rerun anything" are doing real work in those prompts. Without them, a model with SQL or Admin API tools available may write its own query or helpfully retry the job. In Claude, put the routing rule in a Project instruction so you don't have to type it each time.

What it doesn't answer

The server serves what lives in dbt. Questions about tables dbt doesn't model, like raw Stripe or Salesforce syncs nobody staged, a Postgres app database, or a spreadsheet from finance, have nothing to land on unless you enable SQL and let the model write freehand against the warehouse. And the Semantic Layer answers only the metrics someone has defined in MetricFlow YAML. Ask for something adjacent, like a metric split by a dimension no semantic model joins to, and query_metrics returns an error.

That leaves a split. The defined metrics come back right, and everything else is ad hoc SQL with no shared context.

Where Contextflo fits

Contextflo connects Claude or ChatGPT to your warehouse and the rest of your stack (Snowflake, BigQuery, Postgres, Databricks, Redshift and uploaded files) through one connector, and it works with or without dbt. Point it at the GitHub or GitLab repo that holds your dbt project, and it reads your models as source code to write a description for each table and column, plus starter metric definitions your team reviews. Tables outside dbt get context from the schema and your docs, so the ad hoc questions start from the same definitions as the modeled ones. When someone corrects an answer, the fix is saved once and every later answer uses it.

It supports access control across all data sources, at the granularity each underlying data source supports, on every plan, and every question and query is logged per person.

It works with the Claude or ChatGPT subscription your team already pays for, so there's one AI bill and you pick the model. Pricing is from $500/month for up to 10 people with unlimited queries, so a chatty agent doesn't eat an allowance, and it's free for one user and one data source. Tilt, a live-auction marketplace for limited-edition goods, runs it with a one-person data team: about 6,000 queries a month, with 30+ people asking every week.

Here is a more in-depth look at Contextflo and how it works.

What is Contextflo?

Contextflo is a governed context layer between your data and the AI your team already uses. Connect your warehouse once, and your team asks questions in their own Claude or ChatGPT. The model writes and runs the SQL; Contextflo supplies the definitions, the per-user access control, and the audit that make the answers trustworthy. Your data never moves, and you do not need a data team.

How it works

1
Connect your data
Point Contextflo at your warehouse or database, or upload a CSV. It reaches multiple sources at once, so a single question can span all of them.
2
Bootstrap your context layer and review
Connect your code repo, Notion docs, or a data dictionary, and Contextflo annotates each table in your data source where it can. You review and correct them. That becomes the foundational context layer: your AI agent does not just see tables, it sees the context around them.
3
Define metrics and save golden queries
Pin the verified SQL behind a metric once. Every question then resolves against the same definitions, so the number is consistent no matter who asks or how they phrase it.

Contextflo, explained by our founder.

Your team queries in their own Claude or ChatGPT over MCP, so you bring any agent rather than a locked-in bot, and every answer comes back with the SQL shown and access enforced per user.

FAQ

Does the dbt MCP server work with dbt Core? Yes. The self-hosted server runs with a local dbt project and no dbt platform account, which gives you the dbt CLI tools like list, compile, show, run and build. The Semantic Layer, Discovery and Admin API tools call dbt platform APIs, so they need a dbt platform account, and the Semantic Layer and Discovery APIs need a Starter, Enterprise or Enterprise+ plan.

What is the difference between the local and remote dbt MCP server? The local server is the open-source dbt-mcp package you start with uvx dbt-mcp on your machine. It can run dbt commands against your project and is aimed at development. The remote server is hosted by dbt at your account's /api/ai/v1/mcp URL, needs no install, and covers consumption: Semantic Layer, SQL, Discovery, Admin API and docs tools, without dbt CLI commands.

Can I make the dbt MCP server read-only? Yes. On the self-hosted server, use allowlist mode, for example DBT_MCP_ENABLE_SEMANTIC_LAYER=true and DBT_MCP_ENABLE_DISCOVERY=true, so the CLI, SQL and Admin API tools never load. On the remote server, approve only the scopes you want in the OAuth consent screen, or use a token whose permissions cover only Semantic Layer and metadata access.

Can I use the dbt MCP server with ChatGPT? Yes. dbt Labs publishes a dbt plugin in OpenAI's business plugin directory that brings the dbt MCP server into ChatGPT. Availability depends on your ChatGPT plan and workspace settings, and an admin may need to approve it.

Does Contextflo need dbt to give Claude or ChatGPT context about my data? No. Contextflo works with or without dbt. Connect your warehouse and it generates table and column descriptions from your schema, and if you point it at the GitHub or GitLab repo that holds your dbt project, it uses those models as source code too. It works with the Claude or ChatGPT subscription your team already pays for, from $500/month for up to 10 people with unlimited queries.