dbt-mcp
dbt-labs · dbt-labs/dbt-mcp
MCP server that gives your agent dbt project context, plus tools to run SQL and query the Semantic Layer across dbt Core, Fusion and Platform.
A MCP (Model Context Protocol) server for interacting with dbt.
Preview
What you can do with it
- Ask the agent to generate SQL from natural language using your dbt project context
- Query metrics and dimensions from the dbt Semantic Layer
- Let the agent explore and explain your dbt models
Safety check
No risky patterns found in the files we scanned.
Automated scan of the repo files. Always review code you run.
From the README
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 here to learn more. This 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 here.
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 here.
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 — useget_node_detailsinstead)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 — useget_node_detailsinstead)get_mart_models: Retrieves all mart models.get_model_children: (deprecated — useget_lineageinstead)get_model_details: (deprecated — useget_node_detailsinstead)get_model_health: Gets health signals: run status, test results, and upstream source freshness.get_model_parents: (deprecated — useget_lineageinstead)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 — useget_node_detailsinstead)get_semantic_model_details: (deprecated — useget_node_detailsinstead)get_snapshot_details: (deprecated — useget_node_detailsinstead)get_source_details: (deprecated — useget_node_detailsinstead)get_test_details: (deprecated — useget_node_detailsinstead)search: [Alpha] Searches for resources across the dbt project (not generally available).
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 here.
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,