Skip to content
Back to search

dbt-doctor

AI-driven quality & governance MCP Server for dbt projects. Audit coverage, profile data, detect schema drift, and auto-generate documentation — all through natural language with your AI assistant.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/astoriel--dbt-doctor/badge.svg)](/listings/astoriel--dbt-doctor)

HTML

<a href="/listings/astoriel--dbt-doctor"><img src="/api/listings/astoriel--dbt-doctor/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installation

pip install dbt-doctor

Configuration (Claude Desktop)

Add the following to your `claude_desktop_config.json`:

{
  "mcpServers": {
    "dbt-doctor": {
      "command": "dbt-doctor",
      "args": ["--project-dir", "/absolute/path/to/your/dbt/project"]
    }
  }
}

Configuration (Cursor)

Add the following to your `.cursor/mcp.json`:

{
  "mcpServers": {
    "dbt-doctor": {
      "command": "dbt-doctor",
      "args": ["--project-dir", "/absolute/path/to/your/dbt/project"]
    }
  }
}

*Prerequisite: Run `dbt compile` prior to usage to ensure `target/manifest.json` is available for dbt-doctor to parse.*

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 154 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <img src="logo.png" alt="dbt-doctor logo" width="300"/>
  3. <p><strong>AI-driven quality and governance MCP Server for dbt projects.</strong></p>
  4. <p>Audit coverage, profile data, detect schema drift, and auto-generate documentation—all through natural language with an AI assistant.</p>
  5. </div>
  6. <p align="center">
  7. <a href="https://github.com/Astoriel/dbt-doctor/actions/workflows/ci.yml">
  8. <img src="https://github.com/Astoriel/dbt-doctor/actions/workflows/ci.yml/badge.svg" alt="CI"/>
  9. </a>
  10. <a href="https://pypi.org/project/dbt-doctor/">
  11. <img src="https://badge.fury.io/py/dbt-doctor.svg" alt="PyPI version"/>
  12. </a>
  13. <a href="https://python.org">
  14. <img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="Python 3.10+"/>
  15. </a>
  16. <a href="LICENSE">
  17. <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License"/>
  18. </a>
  19. </p>
  20. ---
  21. ## Project status
  22. Active alpha. Snapshot date: 2025-12-25. See [STATUS.md](STATUS.md) and [KNOWN_LIMITATIONS.md](KNOWN_LIMITATIONS.md) for what is working today, what is planned, and what is not claimed.
  23. ## What is dbt-doctor?
  24. dbt-doctor is a Model Context Protocol (MCP) server that provides your AI coding assistant with deep context regarding your dbt project's health. Instead of manually running CLI commands and analyzing outputs, you can interact with your AI:
  25. - "What's the overall health of my dbt project?"
  26. - "Profile the fct_orders model and suggest appropriate tests."
  27. - "Auto-document the models that have the lowest test coverage."
  28. The tool handles the heavy operations—reading the manifest, profiling your data warehouse, detecting schema drift, and writing back to schema.yml files—without requiring you to leave the chat.
  29. Note: This tool is designed to complement the official dbt-labs/dbt-mcp. While dbt-labs/dbt-mcp focuses on running dbt commands, dbt-doctor focuses on auditing, profiling, and documentation.
  30. ## Key Features
  31. ### Project Auditing
  32. Evaluate your project with a 0–100% score based on documentation, testing, and naming conventions. Access a ranked list of models lacking coverage to prioritize your efforts.
  33. ### Data Profiling
  34. Perform efficient single-pass column statistics—including NULL rates, cardinality, min/max values, and uniqueness—using one batched SQL query per table to avoid slow row-by-row scanning.
  35. ### Schema Drift Detection
  36. Compare the current state of your data warehouse against the definitions in your `manifest.json`. Instantly identify added, removed, or type-changed columns.
  37. ### Intelligent Test Suggestions
  38. Translate profiling statistics into actionable dbt test recommendations. For example, a uniquely populated column without nulls will prompt suggestions for `not_null` and `unique` tests, while low cardinality will suggest `accepted_values` with predefined options.
  39. ### Non-Destructive YAML Writing
  40. Update `schema.yml` files using `ruamel.yaml` to retain hand-written comments, existing tests, and formatting. The tool only appends missing information and preserves your manual configurations.
  41. ### End-to-End Documentation Generation
  42. Execute a complete workflow in a single conversational turn: profile a model, suggest tests, preview changes, and write to schema.yml.
  43. ---
  44. ## Included MCP Tools
  45. | Category | Tool | Description |
  46. |---|---|---|
  47. | Context | `list_models` | Overview of all models and their coverage status |
  48. | Context | `get_model_details` | Detailed model information including SQL, columns, lineage, and tests |
  49. | Audit | `audit_project` | Project health score and naming convention violations |
  50. | Audit | `check_test_coverage` | Models ranked by their test coverage percentage |
  51. | Audit | `analyze_dag` | Detection of orphan models and high fan-out nodes |
  52. | Audit | `get_project_health` | Single-call dashboard summarizing project status |
  53. | Profiling | `profile_model` | Batched column statistics |
  54. | Profiling | `execute_query` | Read-only SQL execution against your warehouse |
  55. | Profiling | `detect_schema_drift` | Comparison of database columns against manifest definitions |
  56. | Generation | `suggest_tests` | Translation of profile data into dbt test recommendations |
  57. | Generation | `update_model_yaml` | Safe merging of documentation and tests to schema.yml |
  58. | Generation | `generate_model_docs` | Complete end-to-end documentation workflow |
  59. ---
  60. ## Quick Start
  61. ### Installation
  62. ```bash
  63. pip install dbt-doctor
  64. ```
  65. ### Configuration (Claude Desktop)
  66. Add the following to your `claude_desktop_config.json`:
  67. ```json
  68. {
  69. "mcpServers": {
  70. "dbt-doctor": {
  71. "command": "dbt-doctor",
  72. "args": ["--project-dir", "/absolute/path/to/your/dbt/project"]
  73. }
  74. }
  75. }
  76. ```
  77. ### Configuration (Cursor)
  78. Add the following to your `.cursor/mcp.json`:
  79. ```json
  80. {
  81. "mcpServers": {
  82. "dbt-doctor": {
  83. "command": "dbt-doctor",
  84. "args": ["--project-dir", "/absolute/path/to/your/dbt/project"]
  85. }
  86. }
  87. }
  88. ```
  89. *Prerequisite: Run `dbt compile` prior to usage to ensure `target/manifest.json` is available for dbt-doctor to parse.*
  90. ---
  91. ## Architecture
  92. ![dbt-doctor architecture](docs/architecture.png)
  93. The application connects the AI Assistant with your dbt project and database through the MCP protocol. It features a read-only analysis layer combined with a secure generation toolkit that merges changes seamlessly into your existing YAML schemas.
  94. ---
  95. ## Security Design
  96. - **Read-only execution:** All `execute_query` operations operate within a read-only transaction. Write processes are restricted at the database connector level.
  97. - **SQL validation:** Table and column identifiers are strictly validated against a whitelist to prevent injection.
  98. - **Stateless connections:** Data warehouse credentials are instantiated per connection and are never cached in memory.
  99. - **Preview before commit:** The document generation process provides a difference preview prior to rewriting `schema.yml`, ensuring you retain control over modifications.
  100. ---
  101. ## Related Projects
  102. | Project | Description |
  103. |---|---|
  104. | dbt-labs/dbt-mcp | Official MCP focused on dbt command execution |
  105. | dbt-coverage | CLI tool for coverage reporting without AI integration |
  106. | dbt-project-evaluator | dbt package for project evaluation, requiring installation per project |
  107. dbt-doctor uniquely consolidates auditing, profiling, drift detection, and AI-driven YAML updates into a single server interface.
  108. ---
  109. ## License
  110. MIT — see the [LICENSE](LICENSE) file.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.