# Tableau Lineage

> Privacy-first, in-browser Tableau .twbx lineage visualizer. Map calculated-field dependencies, parameters, stored SQL (Custom SQL, Initial SQL, stored procs, RAWSQL), and metadata as an interactive graph and searchable data dictionary. Nothing is uploaded. Free and open source.

- **Type:** MCP server
- **Install:** `agentstack add mcp-andey0saikiran-tableau-lineage`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [andey0Saikiran](https://agentstack.voostack.com/s/andey0saikiran)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [andey0Saikiran](https://github.com/andey0Saikiran)
- **Source:** https://github.com/andey0Saikiran/tableau-lineage
- **Website:** https://tableau-lineage.com

## Install

```sh
agentstack add mcp-andey0saikiran-tableau-lineage
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Tableau Lineage Visualizer

A privacy-first web app that visualizes the field-level lineage, calculated-field
dependencies, and metadata inside any Tableau workbook (`.twbx`), **entirely in your
browser**. Drop in a workbook and get an interactive dependency graph and a searchable
data dictionary. Nothing is uploaded, stored, or sent anywhere.

🔗 **Live:** https://tableau-lineage.com

---

## Why

Inheriting or auditing someone else's Tableau workbook means reverse-engineering dozens
of calculated fields and their tangled dependencies by hand. This tool reads the
workbook's structure and maps it for you: every calculated field, its formula, the raw
fields and parameters it depends on, which calcs are LOD or table calculations, and any
SQL the workbook stores (Custom SQL, Initial SQL, stored procedures, RAWSQL fields).

Because Tableau workbooks often contain sensitive data, the whole thing runs locally;
the `.twbx` never leaves your machine.

## Features

- **Interactive dependency graph** (vis-network): nodes for calculated fields, raw
  fields, and parameters; edges show what depends on what. Cluster by data source,
  search, highlight dependency chains, zoom and pan.
- **Searchable data dictionary**: every calculated field grouped by data source, with
  its formula and dependencies; every parameter with its type, current value, and options.
- **Stored SQL, surfaced**: when a workbook contains SQL, a panel shows every Custom SQL
  query (full text), Initial SQL statement, stored-procedure reference with parameters,
  and `RAWSQL_*` calculated field, each mapped to the connection (class · dbname · server)
  it targets. Runtime-generated live-connection queries are not stored in files, so they
  are explicitly out of scope.
- **Seven metrics at a glance**: data sources, calculated fields, raw fields, parameters,
  LOD calcs, table calcs, filters.
- **Filters, decoded**: every filter deduplicated across worksheets — the field it acts
  on, its kind (categorical / quantitative / relative-date), context-filter status,
  stored member selections and ranges, plus a per-worksheet breakdown showing exactly
  which sheets filter on what. Data-source filters are called out separately.
- **Worksheets in the lineage**: each sheet appears in the graph as a hexagon wired to
  the fields it uses (dashed) and filters on (cyan), toggleable via the Sheets button;
  the dictionary gains a Worksheets section, and the CSV/JSON exports carry a
  "used in worksheets" mapping per field.
- **Exports**, all generated in-browser:
  - **Interactive HTML**: a self-contained, watermarked report (vis-network inlined, so
    it works offline). The same artifact you see in the app.
  - **CSV** of the field inventory and **JSON** of the full model.
- **Clickable metrics**: click a stat (Calculated Fields, Raw Fields, Parameters, LOD,
  Table Calcs) to highlight those nodes in the graph.
- **Private by architecture**: `.twbx` parsing (unzip + XML) happens client-side. No
  backend, no upload, no cookies. Analytics is an anonymous, aggregate page-view count.
- **Accessible**: keyboard navigation, focus management, AA contrast, reduced-motion
  support, and a text dictionary as an equivalent to the canvas graph.
- **Seven UI languages** with English fallback.

## How it works

```
.twbx (a ZIP)
  └─ fflate unzips the .twb entry  ──►  DOMParser reads the XML
        └─ extractor.ts builds the lineage model (calc fields, deps, params, stats)
              ├─ in-app: rendered as a sandboxed  report
              └─ exports: HTML / CSV / JSON, all from the same model
```

The analytical core (`src/lib/extractor.ts`) is a faithful TypeScript port of the
original Python service's extraction logic, with two correctness fixes:

1. **Parameter references by caption.** Formulas reference parameters by their caption
   (e.g. `[Parameters].[Survival Target (Months)]`), but the parameter's internal name
   can differ (`[Survival Benchmark]`). The original failed to resolve these and leaked a
   phantom `Parameters` dependency. Fixed.
2. **Table-calc detection by token, not substring.** The original flagged a field as a
   table calc because `TOTAL` was a substring of `[total_views]`. Now matched as whole
   function calls (`\bTOTAL\s*(`). LOD detection is brace-anchored.

Both fixes are covered by `npm run test:core` (real-workbook fixtures + a synthetic
LOD/table-calc case).

## Tech stack

Vite · React 19 · TypeScript · Tailwind CSS · [fflate](https://github.com/101arrowz/fflate)
(unzip) · native DOMParser (XML) · [vis-network](https://visjs.github.io/vis-network/)
(graph). No backend.

## MCP server (for AI assistants)

The same extraction engine ships as an MCP server, so Claude, Cursor, and other MCP
clients can read calculated-field dependencies, formulas, and parameters straight from a
workbook on your disk. Still 100% local, nothing uploaded.

```bash
claude mcp add tableau-lineage -- npx -y tableau-lineage-mcp
```

Tools: `analyze_workbook`, `list_calculated_fields`, `get_field`, `trace_dependencies`,
`list_parameters`, `get_lineage_graph`, `list_sql_queries` (Custom SQL, Initial SQL,
stored procs, `RAWSQL_*`), `list_filters` (per-worksheet breakdown, context filters,
members and ranges), `list_worksheets` (each sheet's fields and filters). Full docs
in [`mcp/`](mcp/).

## Run locally

```bash
npm install
npm run dev          # http://localhost:5173
```

Other scripts:

```bash
npm run build        # typecheck + production build to dist/
npm run preview      # serve the production build
npm run typecheck    # tsc --noEmit
npm run test:core    # extractor parity + regression tests (Node)
```

## Deploy (Cloudflare Pages)

This is a static site; deploy the `dist/` folder to any static host. Recommended:
**Cloudflare Pages** (unlimited bandwidth, global CDN, native apex-domain TLS).

1. Push this repo to GitHub.
2. Cloudflare dashboard → **Workers & Pages → Create → Pages → Connect to Git** → select
   the repo.
3. Build settings:
   - **Build command:** `npm run build`
   - **Output directory:** `dist`
4. Every push to `main` now builds and deploys automatically. (Cloudflare Workers Builds
   runs the build and deploy on each push.)
5. **Custom domain:** Pages project → Custom domains → add `tableau-lineage.com` and
   `www`. Moving the domain's nameservers to Cloudflare gives automatic HTTPS and
   apex-domain handling.

`public/_headers` ships a security baseline and a Content-Security-Policy that restricts
outbound connections to this origin and Cloudflare's analytics only, which is what makes
the "your data never leaves your browser" promise enforceable.

## Analytics (cookieless)

Visitor counts come from **Cloudflare Web Analytics**: cookieless, no personal data.

1. Cloudflare dashboard → **Web Analytics → Add a site** → enter the hostname.
2. Copy the beacon token and paste it into the commented `` in `index.html`.
3. View numbers in the Cloudflare dashboard → Web Analytics.

That single page-view beacon is the only data collected.

## Demo workbook

`public/demo.twbx` powers the "try a sample workbook" button. Replace it with any `.twbx`
you'd like to feature as the default example.

## License

[MIT](LICENSE) © 2026 Sai Kiran Andey

Built by **Sai Kiran Andey**.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [andey0Saikiran](https://github.com/andey0Saikiran)
- **Source:** [andey0Saikiran/tableau-lineage](https://github.com/andey0Saikiran/tableau-lineage)
- **License:** MIT
- **Homepage:** https://tableau-lineage.com

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-andey0saikiran-tableau-lineage
- Seller: https://agentstack.voostack.com/s/andey0saikiran
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
