
dbt MCP Server
Give AI agents context of your dbt project — run dbt CLI, query the Semantic Layer, explore lineage, and manage jobs.
Add to your client
Copy the config for your MCP client and paste it into its config file.
uvx dbt-mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"dbt-mcp-server": {
"command": "uvx",
"args": [
"dbt-mcp"
],
"env": {
"DBT_HOST": "cloud.getdbt.com",
"DBT_PROD_ENV_ID": "your-production-environment-id",
"DBT_DEV_ENV_ID": "your-development-environment-id",
"DBT_USER_ID": "your-user-id",
"DBT_TOKEN": "your-service-token-or-pat",
"DBT_PROJECT_DIR": "/path/to/your/dbt/project",
"DBT_PATH": "/path/to/your/dbt/executable"
}
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- uv / uvx installed (for the local stdio server)
- Python 3.12 or 3.13 (3.12 <= version < 3.14)
- For dbt Platform features: a dbt Platform account, host (DBT_HOST), a service token or Personal Access Token (DBT_TOKEN), and the relevant environment IDs
- For local dbt CLI tools: a dbt project directory (DBT_PROJECT_DIR) and a dbt executable path (DBT_PATH)
About dbt MCP Server
Official dbt Labs MCP server that exposes dbt Core, dbt Fusion, and dbt Platform capabilities to AI agents. Connect it to Claude, Cursor, or VS Code to let an agent understand your project's models, sources, metrics, and lineage; run and compile dbt; query the Semantic Layer; and operate Platform jobs. Runs locally over stdio via uvx dbt-mcp, or as a remote HTTP server hosted on the dbt Platform. Tool groups are toggled with DISABLE_/DBT_MCP_ENABLE_ environment variables.
Tools & capabilities (60)
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 Semantic Layer 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_detailsGets exposure details including owner, parents, and freshness status.
get_exposuresGets all exposures (downstream dashboards, apps, or analyses).
get_lineageGets full lineage graph (ancestors and descendants) with type and depth filtering.
get_macro_detailsGets details for a specific macro.
get_mart_modelsRetrieves all mart models.
get_model_childrenGets downstream dependents of a model.
get_model_detailsGets model details including compiled SQL, columns, and schema.
get_model_healthGets health signals: run status, test results, and upstream source freshness.
get_model_parentsGets upstream dependencies of a model.
get_model_performanceGets execution history for a model; option to include test results.
get_related_modelsFinds similar models using semantic search.
get_seed_detailsGets details for a specific seed.
get_semantic_model_detailsGets details for a specific semantic model.
get_snapshot_detailsGets details for a specific snapshot.
get_source_detailsGets source details including columns and freshness.
get_test_detailsGets details for a specific test.
search[Alpha] Searches for resources across the dbt project (not generally available).
buildExecutes models, tests, snapshots, and seeds in DAG order.
cloneClones selected nodes from the specified state to the target schema(s).
compileGenerates executable SQL from models/tests/analyses; useful for validating Jinja logic.
docsGenerates documentation for the dbt project.
get_lineage_devRetrieves lineage from local manifest.json with type and depth filtering.
get_node_details_devRetrieves node details from local manifest.json (models, seeds, snapshots, sources).
listLists resources in the dbt project by type with selector support.
parseParses and validates project files for syntax correctness.
runExecutes models to materialize them in the database.
showExecutes SQL against the database and returns results.
testRuns tests to validate data and model integrity.
cancel_job_runCancels a running job.
get_job_detailsGets job configuration including triggers, schedule, and dbt commands.
get_job_run_detailsGets run details including status, timing, steps, and artifacts.
get_job_run_errorGets error and/or warning details for a job run; option to include or show warnings only.
list_job_run_artifactsLists available artifacts from a job run.
list_jobsLists jobs in a dbt Platform account; option to filter by project or environment.
list_jobs_runsLists job runs; option to filter by job, status, or order by field.
list_projectsLists all projects in the dbt Platform account.
retry_job_runRetries a failed job run.
trigger_job_runTriggers a job run; option to override git branch, schema, or other settings.
generate_model_yamlGenerates model YAML with columns; option to inherit upstream descriptions.
generate_sourceGenerates source YAML by introspecting database schemas; option to include columns.
generate_staging_modelGenerates staging model SQL from a source table.
fusion.compile_sqlCompiles SQL in project context via dbt Platform (Fusion engine).
fusion.get_column_lineageTraces column-level lineage via dbt Platform (Fusion engine).
get_column_lineageTraces column-level lineage locally (requires dbt-lsp via the dbt Labs VS Code extension).
get_product_doc_pagesFetches the full Markdown content of one or more docs.getdbt.com pages by path or URL.
search_product_docsSearches docs.getdbt.com for pages matching a query; returns titles, URLs, and descriptions ranked by relevance.
get_mcp_server_branchReturns the current git branch of the running dbt MCP server.
get_mcp_server_versionReturns the current version of the dbt MCP server.
What this server can do
dbt MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Ask an AI agent questions about your dbt project's models, sources, and lineage using the Discovery API
- Query business metrics in natural language through the dbt Semantic Layer and return governed results
- Run, build, compile, and test dbt models directly from your AI client via the dbt CLI tools
- Inspect model health, run history, and source freshness to debug pipeline issues
- Operate dbt Platform jobs — trigger, retry, cancel, and inspect runs and artifacts via the Admin API
- Generate boilerplate source and staging YAML/SQL with the Codegen tools
- Trace column-level lineage across the project using the Fusion LSP tools
Security notes
Enabling the dbt CLI tools lets the client run dbt commands (build, run, clone, etc.) that can modify your data models, sources, and warehouse objects — only enable them for clients you trust. The dbt Platform tools require a service token or Personal Access Token (DBT_TOKEN); the execute_sql tool specifically requires a PAT plus dev environment and user IDs. Store tokens via environment variables or an env file rather than committing them. SQL, Codegen, and server-metadata tool groups are disabled by default and must be explicitly enabled.
dbt MCP Server FAQ
How do I install and run the dbt MCP server?
Install uv, then run it via `uvx dbt-mcp` — no need to clone the repo unless you are contributing. Configure it in your MCP client (Claude, Cursor, VS Code) as a stdio server with the appropriate environment variables.
Does it work with dbt Core or only dbt Platform?
Both. It works with dbt Core, dbt Fusion, and the dbt Platform. Local dbt CLI tools need DBT_PROJECT_DIR and DBT_PATH, while Semantic Layer, Discovery, and Admin API tools require dbt Platform credentials (DBT_HOST and DBT_TOKEN).
Is there a hosted/remote option?
Yes. In addition to the local stdio server, dbt offers a remote HTTP MCP server hosted on the dbt Platform that connects over a URL with token-based or OAuth authentication, so no local installation is required.
How do I control which tools are exposed?
Tool groups are toggled with environment variables. Use DISABLE_* flags (e.g. DISABLE_DBT_CLI) to turn groups off, or DBT_MCP_ENABLE_* flags as an allowlist. SQL, Codegen, and server-metadata tools are disabled by default.
Is this the same as the `dbt-mcp` package on npm?
No. dbt Labs publishes this server on PyPI and runs it with `uvx dbt-mcp`. The unrelated `dbt-mcp` package on npm is a different project and is not the dbt Labs server.
Alternatives to dbt MCP Server
Compare all alternatives →Official MCP server providing persistent, file-backed knowledge-graph memory across sessions.
Structured step-by-step reasoning tool for breaking problems into revisable thought sequences.
Fully managed remote server for AWS docs, blogs, What's-New and Well-Architected guidance — no key.
Compare dbt MCP Server with: