dbt-labs/dbt-mcp

View on GitHub ↗

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

596 ★126 forksPythonUpdated 1mo ago

What you need to know

Official dbt Labs MCP server for interacting with dbt projects — SQL execution, dbt Semantic Layer queries, Discovery API metadata, dbt CLI commands, Admin (Cloud) API job management, codegen, and product-docs search — for dbt Core, dbt Fusion, and dbt Platform.

Install

An experimental Model Context Protocol Bundle (dbt-mcp.mcpb) is published with each release for MCPB-aware clients (follow Anthropic's mcpb CLI docs)
Otherwise connect the server from an agent product such as Claude or Cursor (see docs.getdbt.com/docs/dbt-ai/about-mcp)

Usage

  • •Read the official docs at docs.getdbt.com/docs/dbt-ai/about-mcp and the intro blog post
  • •Connect the dbt MCP server to an agent product like Claude or Cursor; see the examples directory for building your own agent
  • •Use SQL tools (execute_sql, text_to_sql), Semantic Layer tools (list_metrics, query_metrics), Discovery tools (get_lineage, get_node_details), dbt CLI tools (build, run, test), Admin API tools (list_jobs, trigger_job_run), and codegen tools (generate_source)

Key features

  • ✓SQL tools: execute_sql on dbt Platform infrastructure with Semantic Layer support; text_to_sql generates SQL from natural language
  • ✓Semantic Layer tools: list_metrics, query_metrics, list_saved_queries, get_dimension_values, get_dimensions, get_entities, get_metrics_compiled_sql
  • ✓Discovery tools: get_lineage, get_node_details (for any resource type), get_all_models, get_all_sources, get_model_health, get_model_performance, get_related_models (semantic search), get_all_macros, get_exposures, get_mart_models
  • ✓dbt CLI tools: build, run, test, clone, compile, docs, show, list, parse, plus local line-of-descent tools
  • ✓Admin API tools: list_jobs, list_jobs_runs, trigger/cancel/retry_job_run, get_job_run_details, get_job_run_error, list_projects
  • ✓Codegen tools (generate_model_yaml, generate_source, generate_staging_model), dbt LSP/Fusion tools (fusion.compile_sql, get_column_lineage), and product-docs search (search_product_docs, get_product_doc_pages)

Caveats

  • ⚠dbt CLI tools can modify your data models, sources, and warehouse objects — the README warns to proceed only if you trust the client and understand the impact
  • ⚠Many Discovery tools are deprecated (get_model_details, get_seed_details, get_source_details, get_test_details, get_snapshot_details, get_semantic_model_details, get_exposure_details, get_macro_details, get_model_children, get_model_parents) in favor of get_node_details / get_lineage
  • ⚠search tool is [Alpha] and not generally available
  • ⚠Dependencies are pinned to specific versions and only security updates are submitted automatically
Clients: Claude · Cursor
Documentation ↗

Reviewed 2026-08-07

Topics

data-analyticsdata-engineeringdbtllmmcpmcp-servermodel-context-protocol
Stars
596★
Forks
126
Language
Python
License
Apache-2.0
Created
2025-03-12
Last push
2026-08-17