Tableau Public Authoring MCP
Tableau Public Authoring MCP
一个 MCP 服务器,它根据声明式规范创作 Tableau 工作簿,通过在已安装的 Tableau Public 应用程序中打开它们来验证,并通过 Tableau 自己的可见桌面工作流发布。
这是现有读取器 MCP(
tableau-public)的对应物,后者检查已发布的内容。读取器无法创建或发布任何内容。此服务器无法浏览公开个人资料。请同时保留两者。
它生成什么
下面的每张截图都是此服务器根据 JSON 规范生成的工作簿,然后在 Tableau Public 2026.2.0 中打开并拍摄的。没有任何内容是手工创作的,截图拍摄前也没有在 Tableau 中进行过任何操作。数据是 tests/fixtures/data/ 中的合成 12 行测试夹具。
仪表板 - 两个生成的工作表平铺在一个容器中,固定 1200×800 画布,标题已渲染:

符号地图 - 从列名检测出 latitude/longitude,并标记为 Tableau 的 [Geographical] 语义角色,这正是让标记背后出现真实背景地图的原因。每个站点一个标记,按维度着色并按度量调整大小:

条形图 - 按维度着色,绘制了标记标签,已应用画布适配:

地图背后的规范就是全部输入:
{
"name": "Site Map",
"template": "map",
"data_source": "sites",
"detail": ["Site Name"],
"color": "Status",
"size": { "field": "Annual Sessions", "aggregation": "Sum" },
"title": "Candidate sites"
}Related MCP server: tableau-audit-mcp
它能做什么
读取器 MCP( | 此服务器( | |
搜索 / 检查公开个人资料 | ✅ | ❌ |
下载并解包 | ✅ | 仅检查 |
创建工作簿 | ❌ | ✅ |
在 Tableau Public 中打开它 | ❌ | ✅ |
发布到你的账户 | ❌ | ✅(可见界面) |
已验证的能力
以下所有内容都通过生成工作簿并在 macOS 上的 Tableau Public 2026.2.0 中打开它得到确认,而不仅仅是生成 XML。
支持
CSV 数据源,自动物化为
.hyper提取字段类型推断:字符串、整数、实数、布尔值、日期、日期时间
工作表模板:
bar、line、text_table、heatmap、scatter、circle、map(全部七个已在 Tableau Public 2026.2.0 中通过截图验证,并在每次实时运行时由tests/live/test_render_templates.py重新检查)地理角色:按名称检测纬度和经度列,这正是让
map模板背后出现真实背景地图的原因仪表板:标题、固定或自动画布、工作表平铺在一个容器中
计算字段(Tableau 公式语法)
分类筛选器,渲染为交互式筛选器卡片
编码:color、size、label、tooltip 和 detail -
detail提高详细级别,因此散点图按站点绘制一个标记,而不是按颜色值绘制一个标记画布适配:
standard、fit_width、fit_height、entire_view工作表标题和副标题
.twbx打包,内含字节确定性的.twb
v0.1 中不支持 - 参见 docs/architecture/CAPABILITY_BOUNDARY.md
故事、参数、LOD 表达式、联接/自定义 SQL、实时连接
集、组、层次结构、表计算、参考线
填充/等值区域地图、自定义区域、地图图层、空间文件
仪表板筛选器卡片、图例、操作、浮动区域、设备布局
两个需要仔细阅读的声明
.twbx不是字节可重现的。 其中的.twb是 - 相同的规范,相同的字节。归档文件不是,因为嵌入的.hyper由 Tableau 的 Hyper 引擎写入,并带有非确定性的内部状态。请对.twb进行 diff,绝不要对包摘要进行 diff。参见docs/LIMITATIONS.md§1。独立的
.twb只能在其数据目录旁边使用。output.package_twbx: false会写入<name>.twb以及一个<name>.data/目录,其中包含每个数据源的.hyper和 CSV,而.twb相对于自身解析其数据 - 因此请将两者放在一起,或一起移动。打包构建会在Data/下生成相同的布局,与归档内的布局一致。路径总是出于必要而相对,而非出于偏好:绝对路径会嵌入主目录,而build_workbook拒绝输出可识别机器的数据(参见docs/architecture/THREAT_MODEL.md,T6)。
影响一切的两个约束
Tableau Public 没有发布 API。 REST API 仅涵盖 Server/Cloud,因此发布是通过真实 UI 驱动的。Tableau 将命令记录为
Server > Tableau Public > Save to Tableau Public,但那是 Desktop Professional 的路径:在 Public 版本(2026.2.0)中,Server 菜单只包含Run Optimizer...,而该命令位于 File 菜单上。它通过真实的 Command+Shift+S 按键事件调用,并以 File 菜单作为后备 - 参见docs/PUBLISHING_WORKFLOW.md。Tableau Public 拒绝非提取数据源(
Error Code: 3C242D89)。因此,每个 CSV 在构建时都会转换为 Hyper 提取。
安装
uv tool install git+https://github.com/andyyaro/tableau-public-authoring-mcp
tableau-public-authoring doctor无需克隆,无需 virtualenv,无需编辑路径。doctor 会检查服务器所需的一切,并准确打印需要修复的内容 - 请在注册之前运行它,因为下面的每个先决条件在运行时都会静默失败,而不是抛出错误:
[PASS] platform macOS
[PASS] python 3.13.14 at ~/.local/share/uv/tools/…/bin/python
[PASS] mcp sdk importable
[PASS] tableauhyperapi importable
[PASS] quartz (pyobjc) importable
[PASS] tableau public 2026.2.0 at /Applications/Tableau Public.app
[PASS] accessibility granted to this process
[PASS] screen recording capture succeeded缺失项 | 你实际会看到什么 |
Quartz | Tableau 似乎没有打开任何窗口;发布时提示“no document window matching …” |
屏幕录制 | 验证截图返回空白,且没有错误 |
辅助功能 | 按键和点击没有任何效果 |
tableauhyperapi | 根本无法构建任何工作簿 |
macOS 权限是按可执行文件授予的,因此请授予 doctor 打印的解释器 - 而不是 Tableau,如果你注册了不同的终端,也不是你的终端。详细信息见 docs/MACOS_PERMISSIONS.md。
要求:安装了 Tableau Public 的 macOS(针对 2026.2.0、Apple silicon 开发),Python ≥ 3.10,以及 uv。
使用 Claude Code 注册
claude mcp add --transport stdio --scope user tableau-public-authoring \
-- tableau-public-authoring这就是完整的命令 - uv tool install 会将可执行文件放在 PATH 上的一个稳定位置,因此无需替换绝对路径,并且它在升级后仍然有效。注册不会影响任何其他 MCP 服务器;使用 claude mcp list 验证。在工具出现之前重启 Claude Code。
git clone https://github.com/andyyaro/tableau-public-authoring-mcp
cd tableau-public-authoring-mcp
uv venv && uv sync && uv pip install -e .
uv run tableau-public-authoring doctor通过显式指向其解释器来注册该构建:
claude mcp add --transport stdio --scope user tableau-public-authoring \
-- /absolute/path/to/.venv/bin/python -m tableau_public_authoring.server避免对已注册的服务器使用 uvx --from …:它从内容哈希缓存路径运行,该路径在依赖项发生变化时就会改变,而 macOS 权限授予与该路径绑定 - 因此服务器会在下次升级时悄悄失去辅助功能和屏幕录制权限。对于一次性使用(例如 uvx --from … tableau-public-authoring doctor)是可以的。
升级
uv tool upgrade tableau-public-authoring
tableau-public-authoring doctor构建工作簿
{
"spec_version": "0.1",
"workbook": { "name": "EV Charging Readiness", "description": "Generated" },
"data_sources": [{ "id": "sites", "type": "csv", "path": "/abs/path/sites.csv" }],
"calculated_fields": [{
"name": "Readiness Band", "data_source": "sites", "datatype": "string",
"formula": "IF [Readiness Score] >= 70 THEN \"High\" ELSE \"Low\" END"
}],
"worksheets": [{
"name": "Readiness by Site", "template": "bar", "data_source": "sites",
"rows": ["Site Name"],
"columns": [{ "field": "Readiness Score", "aggregation": "Sum" }],
"color": "Readiness Band",
"filters": ["Status"],
"title": "EV Charging Readiness by Site"
}],
"output": { "directory": "/abs/path/output", "package_twbx": true }
}路径可以是相对于单个 base_dir 的,而不是绝对路径 - 相对路径被限制在该目录内,而绝对路径则不然。参见 docs/AUTHORING_SPEC.md。
然后:validate_workbook_spec(试运行)→ build_workbook → validate_in_tableau_public → publish_to_tableau_public。
完整模式:schemas/workbook-spec-v0.1.json 和 docs/AUTHORING_SPEC.md。
为什么事情会是这样
这个代码库的大部分形态都是对 Tableau 实际行为的回应。docs/LIMITATIONS.md 列出了这些约束;docs/history/CHANGE_HISTORY.md 保留了发布说明,其中记录了每个修复所应对的失败以及证明其已修复的内容。docs/fixtures/ 保存了对一个真实已发布工作簿的取证分析,编译器正是从该工作簿逆向工程而来。
发布
publish_to_tableau_public 被标记为破坏性操作,并且需要 confirm_publish: true 和 profile(你的 Tableau Public 个人资料名称);overwrite 默认为 false。profile 是必需的,因为没有它,服务器无法检查同名工作簿是否已经在线,而 Tableau Public 会不可逆地替换同名工作簿,且没有版本历史。
它驱动可见命令,并且从不读取、输入或存储凭据 - 它使用你现有的已登录桌面会话。如果 Tableau 需要登录,该工具会停止并告诉你手动登录。发布是不可逆的,并且对全世界可见。
使用 dry_run: true 先查看确切会发生什么。
测试
uv run pytest # unit + integration (no Tableau needed)
uv run pytest -m live # requires Tableau Public installed
uv run ruff check . && uv run ruff format --check .live 和 publish 测试被排除在正常运行之外,并且绝不能在 CI 中运行。
安全
任何地方都不存储凭据。XML 通过 ElementTree 生成(绝不使用字符串拼接),归档受到 ZIP-slip 防护,路径经过遍历检查,生成的工作簿在打包前会扫描可识别机器的数据。参见 docs/SECURITY.md 和 docs/architecture/THREAT_MODEL.md。
回滚
claude mcp remove --scope user tableau-public-authoring这不会影响所有其他 MCP 服务器。
卸载
claude mcp remove tableau-public-authoring -s user
claude mcp list # your other servers should still be listed
rm -rf <this repo>/output # generated workbooks are inert local files任何已经发布的内容都必须由你在浏览器中从你的 Tableau Public 个人资料中删除。此服务器没有删除功能,这是设计使然:发布从它这一侧是不可逆的,这就是为什么它要求 confirm_publish,并且除非你传递 overwrite,否则会拒绝名称冲突。
许可证
MIT - 参见 LICENSE。
Available Tools
10 toolsbuild_workbookA
PRIMARY TOOL. Compile a specification into a .twb and packaged .twbx with Hyper extracts (required by Tableau Public). Writes files to the spec's output.directory. The .twb is byte-deterministic for an identical spec; the .twbx digest is not, because the embedded Hyper extract carries non-deterministic state.
Inputs: spec (required), overwrite.
get_authoring_capabilitiesA
Report what this server can and cannot author, the detected Tableau Public installation, and the macOS permission state. Read-only.
Inputs: no named parameters.
get_tableau_public_app_statusA
Report Tableau Public installation, version, running state, open windows and Accessibility permission. Read-only.
Inputs: no named parameters.
inspect_local_workbookA
Safely inspect a local .twbx archive's contents. Read-only.
Inputs: path (required).
list_workbook_templatesA
List supported worksheet templates and their required shelves. Read-only.
Inputs: no named parameters.
open_in_tableau_publicA
Open a generated workbook in Tableau Public and wait for its window. Returns the load error verbatim if Tableau rejects the file.
Inputs: path (required), timeout_s.
publish_to_tableau_publicA
DESTRUCTIVE / PUBLIC. Publish an open workbook to the user's Tableau Public account through the visible Server > Tableau Public > Save to Tableau Public workflow. Publication is irreversible and world-visible. Requires confirm_publish=true. Never reads credentials; pauses for manual sign-in if required.
Inputs: profile (required), public_name (required), confirm_publish (required), workbook_window (required), +5 more.
validate_in_tableau_publicC
Layer 3+4 validation: open the workbook in Tableau Public, detect error dialogs, and capture a screenshot proving rendered content.
Inputs: path (required), settle_s, screenshot_dir.
validate_workbook_specA
Validate an authoring specification without writing any files (dry run). Returns actionable errors. Read-only.
Inputs: spec (required).
verify_published_workbookB
Layer 5 validation: load a public Tableau URL and confirm it responds. Read-only.
Inputs: url (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose: capabilities, templates, validation, building, inspection, app status, opening, in-app validation, publishing, and verification. No two tools overlap in function, and descriptions clearly differentiate them.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., get_authoring_capabilities, build_workbook, publish_to_tableau_public). No mixing of conventions, and verbs clearly indicate the action.
Ten tools is well-scoped for the domain of authoring and publishing Tableau Public workbooks. Each tool serves a necessary step in the workflow, from capability reporting to verification.
The tool set covers the full authoring and publishing lifecycle: capabilities, templates, dry-run validation, building, local inspection, app status, opening, in-app validation, publishing, and web verification. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Generate Tableau .twb/.twbx workbooks: 47 tools for charts, dashboards, rules, CSV pipelines.
Build print-ready PDF catalogs from templates and spreadsheet data.
Formula-backed WorkPaper tools for workbook readback, input edits, and JSON persistence.
Excel analytics: inspect, query (JSON rows), charts, and JSON-to-xlsx workbook writing.
Related MCP Servers
- FlicenseAqualityDmaintenanceMCP server that automates the publishing and validation of Tableau workbooks and data sources on Tableau Server or Tableau Cloud, enabling an AI agent to discover, build, validate, and publish content without human intervention.10-
- AlicenseNot gradedqualityCmaintenanceAudits local Tableau workbooks for unused assets, duplicate worksheets, and dashboard weight, providing cleanup reports and health summaries.MIT
- AlicenseAqualityDmaintenanceProvides 22 MCP tools to access Tableau Public profiles, workbooks, visualizations, social connections, discovery features, and TWBX workbook analysis without authentication.22Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAudits local Tableau workbooks for unused assets, near-duplicate sheets, and dashboard weight, producing actionable cleanup reports.MIT