Cwtwb
@imgwho
About Cwtwb
ai generate tableau file
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"cwtwb": {
"command": "uvx",
"args": [
"cwtwb"
]
}
}
}Tools
40Create a new workbook from a TWB or TWBX template file.
Open an existing workbook (.twb or .twbx) for in-place worksheet editing.
List all available fields in the current workbook datasource.
List worksheet names in the current workbook.
List dashboards and their worksheet zones in the current workbook.
Add a calculated field to the datasource.
Remove a previously added calculated field.
Add a parameter to the workbook.
Add a new blank worksheet to the workbook.
Clone an existing worksheet and its worksheet window.
Preview worksheet-scoped field rewrites without mutating the workbook.
Rewrite one worksheet to use replacement fields without touching others.
Set or clear a plain-text worksheet caption.
Hide or unhide a worksheet tab by updating worksheet window metadata.
Configure chart type and field mappings for a worksheet.
Configure a dual-axis chart composition.
Apply worksheet-level styling: background color, axis/grid/border visibility.
Configure a showcase recipe chart through the shared recipe registry.
Configure the workbook datasource to use a local MySQL connection.
Configure the workbook datasource to use a Tableau Server connection.
Configure the workbook datasource to use a local Excel connection.
Configure the workbook datasource to use a local CSV connection.
Configure the workbook datasource to use a local Hyper extract connection.
Create a dashboard combining multiple worksheets.
Add an interaction action to a dashboard.
Save the workbook as a TWB file. Use a .twbx extension to produce a packaged workbook (ZIP) that bundles the XML with any data extracts and images carried over from the source .twbx. This is the only default MCP tool that writes the active in-memory workbook to disk. After create_workbook/open_workbook plus worksheet/chart/dashboard edits, call save_workbook with the desired output_path to create the final .twb or .twbx file. validate_workbook and analyze_twb do not save files.
Generate and save a dashboard layout JSON file.
Inspect the first-sheet schema of a target Excel datasource.
Profile workbook datasources and worksheet scope before migration.
Scan source and target schema and propose a field mapping.
Preview a workbook migration onto a target datasource.
Apply a workbook migration and write a migrated TWB plus reports.
List cwtwb's declared capability boundary. This reports what workbook features/charts are supported by cwtwb. It does not enumerate callable MCP tools and should not be used to infer whether a tool like add_dashboard or save_workbook exists.
Describe one declared capability and its support tier.
Analyze an existing TWB/TWBX file against cwtwb's declared capabilities. This tool requires a file_path that already exists on disk. It cannot analyze the active in-memory workbook directly and it does not save the current workbook. For a newly generated workbook, call save_workbook first, then pass that saved path to analyze_twb.
Summarize the non-core capability gap of a TWB template.
Validate a workbook against the official Tableau TWB XSD schema (2026.1). Checks whether the generated XML conforms to Tableau's published schema. This tool does not save or export the active workbook. If file_path is omitted, it validates the current in-memory workbook before save; if file_path is provided, it validates an existing .twb/.twbx file on disk. Call save_workbook when you need to write the workbook to a file. Args: file_path: Path to a .twb or .twbx file to validate. If omitted, validates the currently open workbook (in memory, before save). Returns: PASS/FAIL summary with error details.
Preview how an Excel workbook will be interpreted before connection setup.
Upload a .twb/.twbx to Tableau Cloud to validate it. Upload success means the workbook structure is valid and Tableau Cloud can parse it. Use this after saving a generated workbook to verify correctness. Args: twb_path: Path to .twb or .twbx file. data_path: Optional data file (.xlsx/.xls/.hyper) to package. name: Workbook name on Tableau Cloud (defaults to filename stem). overwrite: Whether to overwrite existing workbook with same name. Returns: {success, workbook_id, workbook_url, views, twbx_path, twbx_size_kb, error}
Screenshot a published workbook's view for human review. Use after upload_workbook to capture a visual snapshot. The screenshot is saved locally for human inspection. Args: workbook_id: The workbook ID returned by upload_workbook. output_dir: Directory to save screenshot (default: output/validation). view_index: Index of the view to screenshot (default: 0). view_name: Name of the view to screenshot (overrides view_index). Returns: {success, path, view_name, view_id, size_kb, error}
Overview
What is Cwtwb?
Cwtwb is a Model Context Protocol (MCP) server and Python toolkit for programmatically generating Tableau Desktop workbook files (.twb / .twbx) from code or AI-driven tool calls. It is designed as a workbook engineering layer to make workbook generation reproducible, inspectable, and safe to automate in local workflows, scripts, and CI.
How to use Cwtwb?
Install via pip install cwtwb. As an MCP server, configure your client to launch with uvx cwtwb. As a Python library, use TWBEditor to open templates, add fields, build worksheets, assemble dashboards, and save .twb or .twbx files. Cwtwb also supports a guided datasource-first authoring run with confirmation gates.
Key features of Cwtwb
- MCP tools for guided authoring runs and workbook creation
- Python library with
TWBEditorfor scripted workbook engineering - Supports
.twband.twbxfiles transparently - Worksheet clone and refactor with identity normalization
- Built-in chart primitives (bar, pie, map, text, etc.) and dashboard composition
- XML-based engine using lxml for patching and validation
Use cases of Cwtwb
- Automate Tableau workbook generation in CI/CD pipelines
- Create reproducible dashboards from code or AI assistant interactions
- Clone and refactor existing worksheets to produce KPI variants
- Build structured authoring contracts from datasource schema exploration
- Package plain
.twbfiles into.twbxarchives for distribution
FAQ from Cwtwb
What are the runtime dependencies?
Python >= 3.10, lxml >= 5.0, uv, and mcp >= 1.0.
Can I work with packaged .twbx files?
Yes. Cwtwb reads and writes .twbx files (ZIP archives containing workbook XML, extracts, and images). You can open existing .twbx files, modify them, and save back as .twb or .twbx.
What is the difference between the MCP server and the Python library?
The MCP server exposes tools (e.g., create_workbook, add_parameter, generate_workbook_from_run) for AI clients like Claude Desktop or Cursor. The Python library provides TWBEditor for direct script-based use without an MCP client.
Does cwtwb require Tableau Desktop to be installed?
No. Cwtwb generates valid .twb / .twbx files that open in Tableau Desktop, but it does not require Tableau to be installed on the same machine.
How do I start a guided authoring run?
Use the start_authoring_run MCP tool, which creates a manifest under tmp/agentic_run/{run_id}/ and guides you through schema intake, analysis brief, contract drafting, wireframe review, and final workbook generation.
More Other MCP servers
Awesome-MCP-ZH
yzflyMCP 资源精选, MCP指南,Claude MCP,MCP Servers, MCP Clients

Sequential Thinking
modelcontextprotocolModel Context Protocol Servers
FastMCP v2 🚀
jlowin🚀 The fast, Pythonic way to build MCP servers and clients.
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Comments