loading…
Search for a command to run...
loading…
ai generate tableau file
Tableau workbook engineering for reproducible
.twb/.twbxgeneration, validation, and migration.
cwtwb is a Python toolkit and Model Context Protocol (MCP) server for building Tableau Desktop workbooks from code or agent tool calls.
It is meant to be a workbook engineering layer, not a conversational analytics agent. The focus is reproducibility, inspectability, and safe automation in local workflows, scripts, and CI.
The cw in cwtwb comes from Cooper Wenhua.
Latest update (0.18.9): release refresh for a republish after the previous 0.18.8 artifacts already existed on PyPI.
Author: Cooper Wenhua <[email protected]>
Try the example workflow · Read the guide
pip install cwtwb
If you want the bundled Hyper-backed example too:
pip install "cwtwb[examples]"
uvx cwtwb
Add the server to your MCP client with the same command. For example:
{
"mcpServers": {
"cwtwb": {
"command": "uvx",
"args": ["cwtwb"]
}
}
}
For Claude Code:
claude mcp add cwtwb -- uvx cwtwb
For VSCode, add cwtwb to your workspace or user mcp.json and use uvx cwtwb as the command.
For client-specific details and the full reference, see https://github.com/imgwho/cwtwb/blob/master/docs/guide.md.
| Area | What you get |
|---|---|
| Workbook authoring | Generate .twb / .twbx files from templates or from scratch |
| Chart building | Build bar, line, pie, map, KPI, and dual-axis workbooks |
| Safety | Validate structure and Tableau XSD before publishing |
| Migration | Repoint existing workbooks to new data sources with explicit steps |
| MCP support | Drive workbook workflows from Claude, Cursor, VSCode, or other MCP clients |
This GIF shows the MCP tool flow that builds a dashboard step by step.
Interfaces
┌───────────────────────────────────────────────────────────────┐
│ ┌──────────────────────────┐ ┌───────────────────────────┐ │
│ │ MCP Server │ │ Python Library │ │
│ │ tools_workbook │ │ from cwtwb.twb_editor │ │
│ │ │ │ import TWBEditor │ │
│ │ │ │ │ │
│ │ │ │ editor.add_...() │ │
│ │ │ │ editor.configure_...() │ │
│ │ (Claude / Cursor / │ │ editor.save(...) │ │
│ │ VSCode / Claude Code) │ │ │ │
│ └─────────────┬────────────┘ └──────────────┬────────────┘ │
│ └──────────────┬────────────────┘ │
└───────────────────────────── ┼ ─────────────────────────────┘
▼
┌───────────────────────────────────────────────────────────────┐
│ TWBEditor │
│ ParametersMixin · ConnectionsMixin │
│ ChartsMixin · DashboardsMixin │
└──────────┬──────────────────┬──────────────────┬─────────────┘
▼ ▼ ▼
┌──────────────────┐ ┌──────────────┐ ┌──────────────────────┐
│ Chart Builders │ │ Dashboard │ │ Analysis & │
│ │ │ System │ │ Migration │
│ Basic DualAxis │ │ │ │ │
│ Pie Text │ │ layouts │ │ migration.py │
│ Map Recipes │ │ actions │ │ twb_analyzer.py │
│ │ │ dependencies│ │ capability_registry │
└────────┬─────────┘ └──────┬───────┘ └──────────┬───────────┘
└───────────────────┼──────────────────────┘
▼
┌───────────────────────────────────────────────────────────────┐
│ XML Engine (lxml) │
│ template.twb/.twbx → patch → validate → save │
└───────────────────────────────┬───────────────────────────────┘
▼
output.twb / output.twbx
.twb and .twbx?.twb is the workbook XML. .twbx is the packaged version that bundles the workbook together with extracts and images.
validate_workbook save files?No. validate_workbook() checks the workbook in memory or on disk, but it does not write output. save_workbook() is the tool that writes files.
uvx cwtwb versus python -m cwtwb.mcp?Use uvx cwtwb for the normal MCP workflow. Use python -m cwtwb.mcp for local testing without uvx.
See the online guide.
AGPL-3.0-or-later
Выполни в терминале:
claude mcp add cwtwb -- npx CSA PROJECT - FZCO © 2026 IFZA Business Park, DDP, Premises Number 31174 - 001
Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.