dbt MCP server

Analytics and monitoring

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

Your AI app calls the dbt MCP server, which does the work through tools like execute_sql, text_to_sql, get_dimension_values and get_dimensions and sends the result back to the chat.

About dbt

dbt is the official MCP server from dbt-labs, filed in our directory under analytics and monitoring. A MCP (Model Context Protocol) server for interacting with dbt.

The README for dbt lists tools such as execute_sql, text_to_sql, get_dimension_values and get_dimensions, which your AI app can call once the server is connected.

At a glance

Publisher
dbt-labs, the company behind the product
Runs
See the README for setup
Written in
Python
License
Apache-2.0
GitHub stars
626

Tools dbt gives your AI app

  • execute_sqlExecutes SQL on dbt Platform infrastructure with Semantic Layer support.
  • text_to_sqlGenerates SQL from natural language using project context.
  • get_dimension_valuesGets distinct values for a dimension; option to scope to specific metrics.
  • get_dimensionsGets dimensions for specified metrics.
  • get_entitiesGets entities for specified metrics.
  • get_metrics_compiled_sqlReturns compiled SQL for metrics without executing the query.
  • list_metricsRetrieves all defined metrics.
  • list_saved_queriesRetrieves all saved queries.
  • query_metricsExecutes metric queries with filtering and grouping options.
  • get_all_macrosRetrieves macros; option to filter by package or return package names only.
  • get_all_modelsRetrieves name and description of all models.
  • get_all_sourcesGets all sources with freshness status; option to filter by source name.
  • get_exposure_details(deprecated, use getnodedetails instead).
  • get_exposuresGets all exposures (downstream dashboards, apps, or analyses).
  • get_lineageGets a bounded lineage graph with type, depth, and direction filtering.
  • get_macro_details(deprecated, use getnodedetails instead).
  • get_mart_modelsRetrieves all mart models.
  • get_model_children(deprecated, use getlineage instead).
  • get_model_details(deprecated, use getnodedetails instead).
  • get_model_healthGets health signals: run status, test results, and upstream source freshness.
  • get_model_parents(deprecated, use getlineage instead).
  • get_model_performanceGets execution history for a model; option to include test results.
  • get_node_detailsGets full details for any dbt resource type (model, source, exposure, test, seed, snapshot, macro, semanticmodel).
  • get_related_modelsFinds similar models using semantic search.

Tool names as the dbt README lists them. Your AI app shows the live list once dbt is connected.

How to set up dbt

  1. Follow the install steps in the dbt README; it is written in Python, so have that toolchain ready.
  2. Check the dbt README for keys or settings; the registry lists none that dbt requires.
  3. Add dbt to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the dbt tools to confirm the connection.
  5. Run one read-only task with dbt first, such as a call to execute_sql, before you allow anything that writes or sends.

dbt compared with similar servers

  • Ratel by ratel-ai has fewer GitHub stars than dbt (581 against 626); dbt is official while Ratel is a community server, and both run locally.
  • Marmot Data Catalog by marmotdata has more GitHub stars than dbt (645 against 626); dbt is official while Marmot Data Catalog is a community server, and both run locally.
  • Fastapi MCP Langgraph Template by NicholasGoh has fewer GitHub stars than dbt (561 against 626); dbt is official while Fastapi MCP Langgraph Template is a community server, and both run locally.

Before you connect dbt

  • Give dbt its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each dbt tool call until you trust what it does with them.
  • Treat text that dbt fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for dbt on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for dbt

How marketing and sales teams put dbt to work, by company size. Pick the size closest to yours and start dbt on one use case.

Small business

  • A small business can ask dbt where this month's customers came from and which channel is worth more budget.
  • Owners can use dbt to get a weekly traffic and conversion summary in plain words, without learning the analytics tool.
  • dbt runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can connect dbt to answer attribution and funnel questions in a chat, then save the useful ones as reports.
  • Growth teams can have dbt flag drops in signups or conversion the day they happen, with the page or source that changed.
  • Start with execute_sql and text_to_sql, the tools dbt lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can expose governed metrics through dbt, so every team's AI answers use the same definitions as finance.
  • Large analytics teams can use dbt to triage anomalies across regions and products before the weekly business review.
  • Because dbt comes from dbt-labs, the company behind the product, it follows that product's own auth and permissions, which security teams usually prefer.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

dbt README

From dbt-labs/dbt-mcp on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

dbt MCP Server

This MCP (Model Context Protocol) server provides various tools to interact with dbt. You can use this MCP server to provide AI agents with context of your project in dbt Core, dbt Fusion, and dbt Platform.

Read our documentation docs.getdbt.com/docs/dbt-ai/about-mcp to learn more. docs.getdbt.com/blog/introducing-dbt-mcp-server blog post provides more details for what is possible with the dbt MCP server.

Experimental MCP Bundle

We publish an experimental Model Context Protocol Bundle (dbt-mcp.mcpb) with each release so that MCPB-aware clients can import this server without additional setup. Download the bundle from the latest release assets and follow Anthropic's mcpb CLI docs to install or inspect it.

Feedback

If you have comments or questions, create a GitHub Issue or join us in the community Slack in the #tools-dbt-mcp channel.

Architecture

The dbt MCP server architecture allows for your agent to connect to a variety of tools.

Tools

SQL

Tools for executing and generating SQL on dbt Platform infrastructure.

  • execute_sql: Executes SQL on dbt Platform infrastructure with Semantic Layer support.
  • text_to_sql: Generates SQL from natural language using project context.
Semantic Layer

To learn more about the dbt Semantic Layer, click docs.getdbt.com/docs/use-dbt-semantic-layer/dbt-sl.

  • get_dimension_values: Gets distinct values for a dimension; option to scope to specific metrics.
  • get_dimensions: Gets dimensions for specified metrics.
  • get_entities: Gets entities for specified metrics.
  • get_metrics_compiled_sql: Returns compiled SQL for metrics without executing the query.
  • list_metrics: Retrieves all defined metrics.
  • list_saved_queries: Retrieves all saved queries.
  • query_metrics: Executes metric queries with filtering and grouping options.
Discovery

To learn more about the dbt Discovery API, click docs.getdbt.com/docs/dbt-cloud-apis/discovery-api.

  • get_all_macros: Retrieves macros; option to filter by package or return package names only.
  • get_all_models: Retrieves name and description of all models.
  • get_all_sources: Gets all sources with freshness status; option to filter by source name.
  • get_exposure_details: (deprecated, use get_node_details instead)
  • get_exposures: Gets all exposures (downstream dashboards, apps, or analyses).
  • get_lineage: Gets a bounded lineage graph with type, depth, and direction filtering.
  • get_macro_details: (deprecated, use get_node_details instead)
  • get_mart_models: Retrieves all mart models.
  • get_model_children: (deprecated, use get_lineage instead)
  • get_model_details: (deprecated, use get_node_details instead)
  • get_model_health: Gets health signals: run status, test results, and upstream source freshness.
  • get_model_parents: (deprecated, use get_lineage instead)
  • get_model_performance: Gets execution history for a model; option to include test results.
  • get_node_details: Gets full details for any dbt resource type (model, source, exposure, test, seed, snapshot, macro, semantic_model).
  • get_related_models: Finds similar models using semantic search.
  • get_seed_details: (deprecated, use get_node_details instead)
  • get_semantic_model_details: (deprecated, use get_node_details instead)
  • get_snapshot_details: (deprecated, use get_node_details instead)
  • get_source_details: (deprecated, use get_node_details instead)
  • get_test_details: (deprecated, use get_node_details instead)
  • search: [Alpha] Searches for resources across the dbt project (not generally available).
  • search_public_mesh_models: Finds public dbt Mesh models across projects and confirms producer identity so you can build a verified cross-project ref (multi-project configurations only).
dbt CLI

Allowing your client to utilize dbt commands through the MCP tooling could modify your data models, sources, and warehouse objects. Proceed only if you trust the client and understand the potential impact.

  • build: Executes models, tests, snapshots, and seeds in DAG order.
  • clone: Clones selected nodes from the specified state to the target schema(s).
  • compile: Generates executable SQL from models/tests/analyses; useful for validating Jinja logic.
  • docs: Generates documentation for the dbt project.
  • get_lineage_dev: Retrieves lineage from local manifest.json with type and depth filtering.
  • get_node_details_dev: Retrieves node details from local manifest.json (models, seeds, snapshots, sources).
  • list: Lists resources in the dbt project by type with selector support.
  • parse: Parses and validates project files for syntax correctness.
  • run: Executes models to materialize them in the database.
  • show: Executes SQL against the database and returns results.
  • test: Runs tests to validate data and model integrity.
Admin API

To learn more about the dbt Administrative API, click docs.getdbt.com/docs/dbt-cloud-apis/admin-cloud-api.

  • cancel_job_run: Cancels a running job.
  • get_job_details: Gets job configuration including triggers, schedule, and dbt commands.
  • get_job_run_artifacts: Downloads a specific artifact from a job run; large artifacts return a guidance message to retry with a jq_filter; supports jq filtering for targeted extraction.
  • get_job_run_details: Gets run details including status, timing, steps, and artifacts.
  • get_job_run_error: Gets error and/or warning details for a job run; option to include or show warnings only.
  • list_job_run_artifacts: Lists available artifacts from a job run.
  • list_jobs: Lists jobs in a dbt Platform account; option to filter by project or environment.
  • list_jobs_runs: Lists job runs; option to filter by job, status, or order by field.
  • list_projects: Lists all projects in the dbt Platform account.
  • retry_job_run: Retries a failed job run.
  • trigger_job_run: Triggers a job run; option to override git branch, schema, or other settings.
dbt Codegen

These tools help automate boilerplate code generation for dbt project files.

  • generate_model_yaml: Generates model YAML with columns; option to inherit upstream descriptions.
  • generate_source: Generates source YAML by introspecting database schemas; option to include columns.
  • generate_staging_model: Generates staging model SQL from a source table.
dbt LSP

A set of tools that leverage the Fusion engine for advanced SQL compilation and column-level lineage analysis.

  • fusion.compile_sql: Compiles SQL in project context via dbt Platform.
  • fusion.get_column_lineage: Traces column-level lineage via dbt Platform.
  • get_column_lineage: Traces column-level lineage locally (requires dbt-lsp via dbt Labs VSCE).
Product Docs

Tools for searching and fetching content from the official dbt documentation at docs.getdbt.com.

  • get_product_doc_pages: Fetches the full Markdown content of one or more docs.getdbt.com pages by path or URL.
  • search_product_docs: Searches docs.getdbt.com for pages matching a query; returns titles, URLs, and descriptions ranked by relevance. Use get_product_doc_pages to fetch full content.
MCP Server Metadata

These tools provide information about the MCP server itself.

  • get_mcp_server_branch: Returns the current git branch of the running dbt MCP server.
  • get_mcp_server_version: Returns the current version of the dbt MCP server.

Examples

Commonly, you will connect the dbt MCP server to an agent product like Claude or Cursor. However, if you are interested in creating your own agent, check out the examples directory for how to get started.

Dependencies

Dependencies are pinned to specific versions and are not updated automatically. Only security-related dependency updates are submitted via automated pull requests.

Contributing

Read CONTRIBUTING.md for instructions on how to get involved!

See tool inputs and resolved context for selector declarations and context mapper contracts.

Questions about dbt

What is the dbt MCP server?

A MCP (Model Context Protocol) server for interacting with dbt. dbt is published by dbt-labs, the company behind the product, on GitHub at dbt-labs/dbt-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the dbt MCP server?

dbt doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (dbt-labs/dbt-mcp). Like most servers, dbt ends with a command or URL you paste into your AI app's MCP config.

Does dbt need an API key?

The registry lists no required keys for dbt. Check the dbt README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is dbt an official MCP server?

Yes. dbt is published by dbt-labs, the company that makes the product it connects to, so it follows that product's own API and auth.

What license is dbt under?

dbt is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of dbt; the service it connects to has its own terms.