The order is the whole design: describe the flow, validate the contract, then generate the archive. Generation writes temporary artifacts and backs up an existing output before replacing it, so a rerun does not quietly eat yesterday's work. SQL translation is a reading aid for review and migration planning, not a way to execute the flow outside Prep.
A Python toolkit and MCP server that generates Tableau Prep .tfl and .tflx archives from a flow definition rather than from clicks in Prep Builder. The same declarative shape runs from an agent, a terminal, and a CI job without translation.
- generate_tfl — write the final .tfl or .tflx archive from a flow definition
- validate_flow_definition — check the definition before anything reaches disk
- translate_to_sql — turn a generated or existing .tfl into readable ANSI SQL CTEs with per-step comments
- list_supported_operations — confirm an operation is inside the stable surface before planning around it
- Inputs from MySQL, PostgreSQL, SQL Server, Alibaba AnalyticDB for MySQL, CSV, Excel, custom SQL, and table inputs
- Prep steps: joins, unions, filters, value filters, keep and remove columns, renames, calculations, quick clean steps, type changes, aggregates, pivots, and unpivots
- Packaged reference documents served as MCP resources, including Tableau Prep calculation syntax — which is not SQL syntax
- A CLI covering the same ground: doctor, status, capabilities, validate, run, and translate
No account and no key — it writes files and does not talk to a Tableau server. Python 3.8 or higher. Install with pip install cwprep, or let the client launch it with uvx cwprep; cwprep mcp and python -m cwprep.mcp_server are equivalent launch styles. Opening the result needs Tableau Prep Builder, which cwprep generates for but does not automate or launch.
One command — uvx cwprep
