Tableau Model Context Protocol (MCP)
repository·main·Indexed 43 days ago
https://github.com/tableau/tableau-mcpA suite of developer primitives and a server (@tableau/mcp-server v4.10.5) that enables AI applications to integrate with Tableau for natural language data querying and content exploration. Supports both a managed hosted service for Tableau Cloud via OAuth 2.1 and self-hosted enterprise deployments for Tableau Server using PAT, Connected Apps, UAT, or passthrough authentication.
What's inside Tableau MCP
- Tableau MCP is a suite of developer primitives designed to simplify the creation of AI applications that integrate with Tableau. It provides tools, resources, and prompts that allow AI clients to interact with Tableau data and content.
Introduction to Tableau MCP
mainTableau MCP is an open-source implementation of the Model Context Protocol designed to facilitate communication between AI agents and Tableau. It enables agents to see, understand, and interact with Tableau data, metadata, and artifacts.
It is compatible with any Tableau edition (Cloud or Server), though access to specific tools may depend on your Tableau SKU.
Tableau MCP is available in two primary forms:
- Hosted Tableau MCP: A managed service available on every Tableau Cloud pod at
https://mcp.tableau.com. - Self-Hosted / Local: Can be run locally using
npx.
- Hosted Tableau MCP: A managed service available on every Tableau Cloud pod at
Enterprise Deployment of Tableau MCP
mainTableau MCP can be self-hosted on your own infrastructure as a lightweight Node.js web application. It is designed to serve multiple MCP clients simultaneously using the Streamable HTTP transport.
Key features for enterprise environments include:
- Security: When OAuth is enabled, users sign in via Tableau, ensuring access is governed by your existing security and identity policies.
- Extensibility: The server uses a plugin model, allowing you to customize operations like telemetry and monitoring to match your internal environment.
- Scalability: It functions like a standard internal web application, exposed at a URL you control.
Understand Tableau MCP Authorization modes
mainTableau MCP supports different authorization models depending on your deployment needs:
1. Embedded Authorization Server (Default for OAuth)
When OAuth is enabled, the MCP server runs its own embedded authorization server.
- Purpose: It issues access and refresh tokens to MCP clients using the authentication mechanisms configured at your Tableau site level.
- Security: User context is stored within the access token, ensuring privileges persist end-to-end.
- Limitation: Refresh tokens are stored in-memory. If the Tableau MCP process restarts, all refresh tokens are lost, and users must re-authenticate.
- Token Lifespan: Access tokens expire after 1 hour by default. You can extend this up to 30 days using the
OAUTH_ACCESS_TOKEN_TIMEOUT_MSenvironment variable.
2. Passthrough Authentication
This mode is designed for enterprise gateway or proxy deployments (e.g., Kerberos, OIDC).
- Mechanism: The proxy forwards a valid Tableau REST API token to the MCP server.
- Usage: Authentication to the MCP server behaves like the Tableau REST APIs, using the
X-Tableau-Authheader. - Configuration: Set
ENABLE_PASSTHROUGH_AUTH=trueto enable this mode.
Understand Download Workbook response behavior
mainThe
download-workbooktool returns different response shapes depending on the server configuration and success of the upload:- S3 file mode enabled: Returns a
resource_linkcontaining a short-lived presigned URL to the workbook file in S3. - S3 file mode disabled or upload failure: The tool writes the workbook to a local temporary directory and returns a JSON object containing the local file path.
Metadata
The tool preserves Tableau response metadata where available:
mimeType: Typicallyapplication/xmlfor.twborapplication/octet-streamfor.twbx.name(for S3 mode) orfilename(for temp-file mode): Extracted from Tableau'sContent-Dispositionheader, with a fallback name generated if unavailable.
- S3 file mode enabled: Returns a
Implement Multi-Turn Conversations for Pulse Insights
mainTo enable follow-up questions and maintain context, you must include the full conversation history in the
messagesarray. If you only send the latest question, the AI will lack the context of previous answers.Required sequence for a follow-up:
- Add the initial user question with
role: 'ROLE_USER'. - Add the assistant's response with
role: 'ROLE_ASSISTANT'andcontentcontaining the previous response text. - Add the follow-up question with
role: 'ROLE_USER'.
Example: Follow-up Request
{ "language": "LANGUAGE_EN_US", "locale": "LOCALE_EN_US", "messages": [ { "action_type": "ACTION_TYPE_SUMMARIZE", "content": "What are the key insights for Sales?", "role": "ROLE_USER", "metric_group_context": [ /* ... */ ], "metric_group_context_resolved": true }, { "action_type": "ACTION_TYPE_SUMMARIZE", "content": "Sales increased 5% with growth in Region A and B...", "role": "ROLE_ASSISTANT", "metric_group_context": [ /* ... */ ], "metric_group_context_resolved": true }, { "action_type": "ACTION_TYPE_ANSWER", "content": "What factors contributed to the increase?", "role": "ROLE_USER", "metric_group_context": [ /* ... */ ], "metric_group_context_resolved": true } ] }- Add the initial user question with
Design tool names and groups
mainWhen adding new capabilities to the Tableau MCP server, follow these naming and grouping conventions to ensure AI models can reason about your tools effectively.
Naming Convention
Use
kebab-casefollowing the patternverb-nounorverb-noun-qualifier. Examples include:list-{resources}(e.g.,list-datasources)get-{resource}(e.g.,get-workbook)get-{resource}-{detail}(e.g.,get-datasource-metadata)query-{resource}(e.g.,query-datasource)search-{scope}(e.g.,search-content)generate-{output}(e.g.,generate-pulse-insight-brief)
Tool Grouping
Organize tools into groups representing feature areas:
datasource: Data Q&A (listing, inspecting, querying)workbook: Workbook explorationview: View data and image retrievalpulse: Tableau Pulse metrics and insightscontent-exploration: Cross-content search
How the two-phase update flow works
mainThe
update-cloud-extract-refresh-tasktool uses a two-phase mutation pattern to ensure safety:- Preview Phase: Call the tool with
confirm: false(or omit theconfirmparameter). The tool returns the proposed schedule and a single-useconfirmationToken. This token is cryptographically bound to the specifictaskIdand the specificscheduleprovided in the preview. - Update Phase: Call the tool again with
confirm: trueand provide theconfirmationTokenreceived in step 1. The server verifies the token matches the requested change before applying the update.
Note on MCP-Apps (Human-in-the-loop): If the
mcp-appsfeature flag is enabled, the preview phase renders a visual confirm panel in an iframe. In this mode, the model cannot apply the change; a human must click Apply schedule change in the UI, which triggers a separate, model-invisible tool (confirm-update-cloud-export-refresh-task) to complete the update.- Preview Phase: Call the tool with
Define tool parameters using Zod
mainParameters are defined using Zod schemas. Follow these principles to improve AI reliability:
- Minimize required parameters: Fewer requirements lead to more reliable calls.
- Use descriptive enum values: Use Zod enums so the AI sees specific allowed options.
- Validate early: Encode constraints (like LUID formats) directly in the Zod schema.
- Include sensible defaults: Avoid requiring parameters like pagination limits or sort orders unless necessary.
Architecture of the Tableau MCP deployment
mainThe Tableau MCP deployment follows this communication flow:
- MCP Client (e.g., Claude Desktop) communicates with the Tableau MCP Server via the Streamable HTTP Transport Layer.
- The Tableau MCP Server (hosted on your platform) communicates with Tableau Cloud via standard HTTP.
- The server interacts with Tableau Cloud services including the VizQL Data Service, Metadata API, and other REST APIs.
Handling duplicate Admin Insights datasources
mainIn some Tableau sites, duplicate Admin Insights projects or cloned content may exist, leading to multiple datasources with the same name. The tool automatically resolves these to the canonical, system-provisioned datasource using the following logic:
- Project Filtering: Narrows candidates to the top-level
Admin Insightsproject. - Ranking: Candidates are ranked based on:
- Certification status.
- A canonical
contentUrlslug (clones typically have a_<epoch-ms>suffix). - A non-empty description.
- Ownership by the Tableau System Account (used as a tie-breaker).
- The oldest
createdAttimestamp (final tie-breaker).
- Error Recovery: If the chosen candidate fails with a Hyper connection error at runtime, the tool negative-caches that LUID and retries the next-ranked candidate.
Diagnostic Warnings
If ambiguity is detected, the result will include a warning in
mcp.warnings:ADMIN_INSIGHTS_AMBIGUOUS_DATASOURCE: Multiple candidates were found.ADMIN_INSIGHTS_DATASOURCE_UNHEALTHY: A dead extract forced a fallback to a different candidate.
Admins should use these warnings to identify and delete non-canonical copies.
- Project Filtering: Narrows candidates to the top-level
Override Tableau MCP configuration at different levels
mainTableau MCP supports a hierarchical configuration model where more specific settings override more general ones. The precedence order (from lowest to highest priority) is:
- Environment Variables: The base configuration.
- Site Settings: Overrides specific variables on a per-site basis via the REST API. These apply to all users authenticated to that specific site.
- Request Overrides: The highest priority. These override settings on a per-request basis via an HTTP header. Note that Request Overrides are only available when using the HTTP transport.