MD

mattijsdp/dbt-docs-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

23 stars 8 forks 品質 61 トレンド 0MIT

Dbt Docs とやり取りするための MCP (モデルコンテキストプロトコル) サーバー

概要

Dbt Docs のアーティファクト (manifest.json, Catalog.json) を含む dbt プロジェクトメタデータと相互作用するためのモデルコンテキストプロトコル (MCP) サーバー。 このサーバーは、dbt グラフ情報を公開し、ノードの詳細情報、モデル/カラムの行数、関連するメタデータを照会することができます。 * 名前(search dbt node names)でノード(モデル、ソース、テストなど)を検索します。 * カラム名(search dbt column names)に基づいてノードを検索します。 * ノードのコンパイルされたSQLコード(search dbt sql code)内で検索します。 * 特定のノード固有のID(get dbt node attributes)の詳細な属性を取得します。 * ノード(get dbt predecessors)の直接上流依存関係(predecessors)を検索します。 * ノード(get dbt successors)の直接下流依存 (successors) を検索します。 * モデル(get column ancestors)の特定の列のすべての上流ソースをトレースします。 * モデル(get column descendants)内の特定の列のすべての下流依存をトレースします。 * SQL クエリを実行できるツール.

概要(AI 翻訳)

Dbt Docs のアーティファクト([T0]]])、catalog.json を含む dbt プロジェクトメタデータと相互作用するためのモデルコンテキストプロトコル(MCP)サーバー。 このサーバーは、dbt グラフ情報を公開し、ノードの詳細情報、モデル/カラムの行数、関連するメタデータを照会することができます。

主な機能

このサーバーでは、以下のツールを提供しています。

*Search dbt ノード:

  • 名前([search_dbt_node_names)でノード(モデル、ソース、テストなど)を検索します。
  • 列名([search_dbt_column_names)に基づいてノードを検索します。
  • ノードのコンパイルされたSQLコード([search_dbt_sql_code])内で検索します。 *ノデックスを点検して下さい:
  • 特定のノード固有のID([get_dbt_node_attributes])の詳細な属性を取得します。
  • ** 探査の行程:**
  • ノード([[get_dbt_predecessors])の直接上流依存関係(前者)を検索します。
  • ノード([get_dbt_successors)の直接下流依存(成功者)を検索します。
  • コラムレベル リッジ:
  • モデル([[get_column_ancestors])の特定の列のすべての上流ソースをトレースします。 *モデル内の特定の列のすべての下流依存をトレースします([get_column_descendants])。 **混雑した延長:
  • SQLクエリを実行できるツール.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

dbt-docs-mcp

Model Context Protocol (MCP) server for interacting with dbt project metadata, including dbt Docs artifacts (manifest.json, catalog.json). This server exposes dbt graph information and allows querying node details, model/column lineage, and related metadata.

Key Functionality

This server provides tools to:

  • Search dbt Nodes:
    • Find nodes (models, sources, tests, etc.) by name (search_dbt_node_names).
    • Locate nodes based on column names (search_dbt_column_names).
    • Search within the compiled SQL code of nodes (search_dbt_sql_code).
  • Inspect Nodes:
    • Retrieve detailed attributes for any given node unique ID (get_dbt_node_attributes).
  • Explore Lineage:
    • Find direct upstream dependencies (predecessors) of a node (get_dbt_predecessors).
    • Find direct downstream dependents (successors) of a node (get_dbt_successors).
  • Column-Level Lineage:
    • Trace all upstream sources for a specific column in a model (get_column_ancestors).
    • Trace all downstream dependents of a specific column in a model (get_column_descendants).
  • Suggested extensions:
    • Tool that allows executing SQL queries.
    • Tool that retrieves table/view/column metadata directly from the database.
    • Tool to search knowledge-base.

Getting Started

  1. Prerequisites: Ensure you have Python installed and uv
  2. Clone the repo:
    git clone 
    cd dbt-docs-mcp
    
  3. Optional: parse dbt manifest for column-level lineage:
    • Setup the required Python environment, e.g.:
    uv sync
    
    • Use the provided script scripts/create_manifest_cl.py and simply provide the path to your dbt manifest, dbt catalog and the desired output paths for your schema and column lineage file:
    python scripts/create_manifest_cl.py --manifest-path PATH_TO_YOUR_MANIFEST_FILE --catalog-path PATH_TO_YOUR_CATALOG_FILE --schema-mapping-path DESIRED_OUTPUT_PATH_FOR_SCHEMA_MAPPING --manifest-cl-path DESIRED_OUTPUT_PATH_FOR_MANIFEST_CL
    
    • Depending on your dbt project size, creating column-lineage can take a while (hours)
  4. Run the Server:
    • If your desired MCP client (Claude desktop, Cursor, etc.) supports mcp.json it would look as below:
    {
        "mcpServers": {
            "DBT Docs MCP": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "networkx,mcp[cli],rapidfuzz,dbt-core,python-decouple,sqlglot,tqdm",
                "mcp",
                "run",
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "DBT Docs MCP": { "command": "uv", "args": [ "run", "--with", "networkx,mcp[cli],rapidfuzz,dbt-core,python-decouple,sqlglot,tqdm", "mcp", "run", "/Users/mattijs/repos/dbt-docs-mcp/src/mcp_server.py" ], "env": { "MANIFEST_PATH": "/Users/mattijs/repos/dbt-docs-mcp/inputs/manifest.json", "SCHEMA_MAPPING_PATH": "/Users/mattijs/repos/dbt-docs-mcp/outputs/schema_mapping.json", "MANIFEST_CL_PATH": "/Users/mattijs/repos/dbt-docs-mcp/outputs/manifest_column_lineage.json" } } } }