Skip to main content
Glama
Warehouse Graph MCP Server

Warehouse Graph MCP Server

by Crestward

warehouse-graph

Shared foundation for two linked projects:

This package will build a metadata/lineage graph from dbt artifacts, compile one policies.yml to database access controls (Postgres RLS / Unity Catalog), and serve the graph over an MCP server.

Status: Phase 1 (demo warehouse). Done so far:

  • repo tooling and the LLM wrapper (cost ledger, cache, budget cap, Batch API)

  • Kiwi Retail Co., a deliberately messy synthetic warehouse: 40 dbt models, 13 metrics, 6 dashboards, 13 documented traps

Quick start

cp .env.example .env      # add ANTHROPIC_API_KEY for real model calls
uv sync
make warehouse            # Postgres + synthetic data + dbt build + artifacts (~1 min)
make demo                 # the same, then the Dagster UI at http://localhost:3000
make check                # lint, format check, type-check, tests

Related MCP server: dagsmith

The demo warehouse: Kiwi Retail Co.

A fictional NZ/AU retailer: 12 stores (2 online), 9,000 customers, ~29k orders from Jan 2024 to Sep 2026, in NZD and AUD.

raw.* (11 tables, seeded generator)
  └─ staging (11 views) ─ intermediate (9 views) ─ marts (20 tables)
                                                    ├─ core: customers, products, stores, employees, orders, items, payments, refunds
                                                    ├─ finance: fct_revenue_daily (canonical revenue), rpt_revenue_by_region
                                                    ├─ marketing: campaigns, ad spend, campaign performance
                                                    ├─ customers: churn, LTV, active customers
                                                    └─ legacy: orders_v1 (deprecated), rpt_regional_sales_legacy (fan-out)

Piece

Where

Generator and loader

src/warehouse_graph/demo/ (warehouse-graph demo-data [--stale TABLE])

dbt project (models, tests, freshness, exposures, Semantic Layer metrics)

demo/kiwi_retail/

Tribal knowledge attached to nodes

demo/caveats.yml (14 caveats)

Validated question → SQL examples

demo/query_examples.yml (30, each tested against the DB)

Orchestration (nightly dbt build, run-failure sensor)

demo/orchestration/definitions.py (Dagster)

Artifacts for the graph

demo/artifacts/ (manifest, catalog, run_results, sources), produced by make warehouse

Planted traps and their measured effects

docs/planted-traps.md

Docs

Licence

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      A read-only MCP server that exposes dbt project artifacts and data quality result tables (BigQuery/Postgres) to LLM clients, enabling deep introspection, run-history analysis, source freshness, test coverage, and lineage walks.
      27
      76 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server providing read-only Snowflake metadata tools (schemas, tables, queries, lineage) for agentic data pipeline generation, enabling natural-language-to-pipeline workflows with dbt, Airflow, and Great Expectations.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Exposes a governed semantic layer to AI agents so they select metrics and dimensions from a closed, engineer-declared vocabulary instead of writing SQL. Validates every typed call against the contract, rejects out-of-contract requests with structured errors and suggestions, and returns query rows together with the compiled SQL and dbt lineage for auditing.
      4
      MIT