> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/agentic-access/agentic-gateway/mcp-server/tableau.md).

# Tableau MCP server

Install the Tableau agentic integration and its MCP server so agents behind the P0 AI Gateway can request read or write access to Tableau Cloud projects.

The **Tableau** agentic integration lets agents behind the AI Gateway, part of [P0 Runtime Access for AI](https://docs.p0.dev/readme/agentic-control-plane.md), request time-bound access to projects on your Tableau Cloud site. For each agent, P0's connector creates a Tableau user on the site, the agent user, and gives it permissions on the approved projects. The gateway runs Tableau's open-source [Tableau MCP server](https://github.com/tableau/tableau-mcp), signed in as that agent user. When access ends, P0 removes the agent user's permissions.

{% hint style="info" %}
The Tableau agentic integration is in beta. Functionality and configuration may change.
{% endhint %}

The integration supports Tableau Cloud only, not Tableau Server.

Setup has four parts, in this order:

1. Install the Tableau site in P0, which deploys P0's connector in AWS or Google Cloud.
2. Create a connected app in Tableau and give P0 its credentials.
3. Add the Tableau MCP server to your gateway.
4. Write the policies that decide which agents get which projects.

## Prerequisites

* A registered [Gateway](https://docs.p0.dev/agentic-access/agentic-gateway/gateway.md) component, with the gateway deployed in your environment. The gateway must be able to reach your Tableau Cloud URL, such as `https://us-east-1.online.tableau.com`, and your secret manager.
* One of these, with permission to apply Terraform where it's installed. P0's connector runs there, and agents' Tableau credentials are stored there.
  * On AWS:
    * The [AWS Secrets Manager](https://docs.p0.dev/integrations/resource-integrations/aws-secrets-manager.md) integration installed on an AWS account. The connector runs there on AWS Lambda. Applying its Terraform also needs Docker and the AWS CLI, signed in to that account, to copy P0's connector image into your Amazon ECR.
    * [AWS OIDC](https://docs.p0.dev/agentic-access/credential-sources/aws-oidc.md) installed for that same account. The gateway uses it to read each agent's Tableau credential.
  * On Google Cloud:
    * The [Google Cloud](https://docs.p0.dev/integrations/resource-integrations/google-cloud.md) integration installed for your Google Cloud organization.
    * The [Google Secret Manager](https://docs.p0.dev/integrations/resource-integrations/google-secret-manager.md) integration installed on the Google Cloud project where the connector will run. The connector runs there on Cloud Run.
    * [GCP Workload Identity Federation](https://docs.p0.dev/agentic-access/credential-sources/gcp-wif.md) installed for that same project. The gateway uses it to read each agent's Tableau credential.
* A Tableau site administrator who can create connected apps, and whose account P0's connector can sign in as.
* An email mailbox for agent users that accepts plus-addressed mail, such as `p0-agents@example.com`.

## Install the site in P0

1. Navigate to **Integrations** on [p0.app](https://p0.app), select **Tableau**, and choose the **Credential provisioning** component.
2. Click **Add Site**, and enter an identifier for it, such as `acme-prod`. Agents and policies use this name for the site. Use letters, digits, and hyphens.
3. Fill in the site details, then click **Next**:
   * **Tableau Cloud URL**: the site's pod URL, the part of the site's address before `/#/`, such as `https://us-east-1.online.tableau.com`.
   * **Site name**: the site's content URL, the part of the site's address after `/site/`. For `https://us-east-1.online.tableau.com/#/site/acme/home`, it's `acme`.
   * **Secret manager provider**: choose where the connector will run:
     * **AWS Secrets Manager**: choose the installation for the AWS account, and enter the region that stores the secrets.
     * **Google Secret Manager**: choose the installation for the project.
4. P0 generates a Terraform configuration. Copy it into your Terraform project, `apply` it, then click **Next**.

   On AWS, the configuration creates:

   * An Amazon ECR repository with a copy of P0's connector image, and a Lambda function, `p0-connector-tableau-ai-aws`, that runs it with its own IAM role.
   * A secret for the connected app's credentials, `p0/install/tableau/<identifier>/admin-app`, which only the connector can read.
   * Permission for the connector to create and manage the secrets that hold each agent's Tableau credential. Their names start with `p0/access-token/tableau/<identifier>/`, and the connector can touch no other secret.
   * A policy on P0's IAM role in the account that lets P0 invoke the function.

   On Google Cloud, it creates:

   * A Cloud Run service, `p0-connector-tableau-ai`, that runs P0's connector under its own service account, `p0-tableau`.
   * A secret for the connected app's credentials, `p0_install_tableau_<identifier>_admin-app`, which only the connector can read.
   * Permission for the connector to create and manage the secrets that hold each agent's Tableau credential. The connector can touch no other secret.
   * Bindings that let P0's Google Cloud service account call the connector and read its URL. The connector accepts calls from that service account only.
   * The Cloud Run, Secret Manager, IAM, and Resource Manager APIs, turned on in the project.

   When you click **Next**, P0 checks that the connector is deployed. A new connector can take a minute to start. If the check fails, wait a minute and click **Next** again.

{% hint style="warning" %}
Install each Tableau site in its own AWS account or Google Cloud project. The Terraform for a second site in the same account or project conflicts with the first.
{% endhint %}

## Set up Tableau

1. **Create a connected app** for P0 in Tableau under **Settings** > **Connected Apps** > **New Connected App** > **Direct Trust**. See [Configure Connected Apps with Direct Trust](https://help.tableau.com/current/online/en-us/connected_apps_direct.htm).
2. **Generate a secret** for the app, then **enable the app**. Tableau creates a connected app disabled, and P0 can't sign in until you enable it.
3. **Store the connected app's credentials.** Set `TABLEAU_CLIENT_ID`, `TABLEAU_SECRET_ID` and `TABLEAU_SECRET` to the app's client ID, secret ID and secret value, and run the command P0 shows. On AWS:

   ```bash
   printf '{"clientId":"%s","secretId":"%s","secret":"%s"}' \
     "$TABLEAU_CLIENT_ID" "$TABLEAU_SECRET_ID" "$TABLEAU_SECRET" | \
     aws secretsmanager put-secret-value \
     --secret-id p0/install/tableau/<identifier>/admin-app \
     --region <secrets-region> --secret-string file:///dev/stdin
   ```

   On Google Cloud:

   ```bash
   printf '{"clientId":"%s","secretId":"%s","secret":"%s"}' \
     "$TABLEAU_CLIENT_ID" "$TABLEAU_SECRET_ID" "$TABLEAU_SECRET" | \
     gcloud secrets versions add p0_install_tableau_<identifier>_admin-app \
     --project=<project-id> --data-file=-
   ```

   P0 never sees the credentials: only your connector reads them. The connector can't grant access until the secret holds them.
4. **Enter the Admin user**: the email of the Tableau site administrator that the connected app signs in as.
5. **Enter the Agent mailbox**: the email address P0 uses to name agent users. See [#agent-users](#agent-users "mention").
6. Review the summary and click **Finish**. The site now appears with the state **Installed**.
7. **Lock the permissions of each project** that agents may reach. In Tableau, open the project's permissions and set **Content permissions** to **Locked to the project**. P0 offers only locked projects, and refuses a request for any other project.
8. **Remove the All Users group from content agents must not reach.** Every agent user is in Tableau's **All Users** group, and Tableau gives that group view permissions on new projects by default. In each project and workbook that agents must not see, open its permissions and delete the **All Users** rule. See [#agent-users](#agent-users "mention").

## Agent users

P0 names each agent user after the agent mailbox, with a plus address that identifies the agent, such as `p0-agents+p0-0123456789abcdef@example.com`. Each agent has one agent user on each site it has access to.

* Tableau emails an invitation to each new agent user, so the mailbox gets one email for each agent user.
* Each agent user takes a Tableau seat while it has access. With only `read` grants, it has the **Viewer** site role. With any `write` grant, it has the **Explorer (can publish)** site role.
* An agent user belongs to Tableau's **All Users** group, like every user on the site. It can see content that group can see, as well as the projects it's granted.
* When the agent's last grant on the site ends, P0 removes the agent user, which ends its open Tableau sessions. If the agent user owns content, for example a workbook it published, Tableau can't remove it, so P0 sets its site role to **Unlicensed** instead, which also ends its sessions and frees its seat. To remove such a user, move its content to another owner, then remove the user in Tableau.

{% hint style="warning" %}
P0 limits an agent to its granted projects only where the **All Users** group has no permissions. An agent can read any project or workbook that **All Users** can read, whether or not it was granted. Remove **All Users** from that content before agents request access.
{% endhint %}

## Add the Tableau MCP server

You can add the Tableau MCP server once at least one site is installed.

1. Follow the shared steps in [MCP server](https://docs.p0.dev/agentic-access/agentic-gateway/mcp-server.md#add-an-mcp-server) to name the server and choose its gateway. On the configuration screen, set the following fields, then click **Finish**:
   * **Credential source**: choose **Vaulted credential**.
   * **Definition**: choose **P0**, then select **Tableau**.
2. The server now appears with the state **Installed**.

One Tableau MCP server serves every site you install. Each grant names the site it is for.

## How agents request access

An agent requests access with the server's `access` tool. It names the site by its P0 identifier, and one or more project grants, each written `<level>:<project-id>`:

* `read`: view the project's content.
* `write`: view the content, and also publish and edit it.

The agent's `list` tool shows the installed sites and, for each site, a `read` and a `write` grant for every project whose permissions are locked.

Agents see every Tableau tool whether or not their grants cover it. Tableau refuses a call for content outside the agent's projects, and a publish or edit in a project the agent can only read.

A new grant on the same site adds its projects to the agent's agent user, and when a grant ends, P0 removes its projects.

{% hint style="warning" %}
Tableau ends an agent's session after at most 120 minutes. A grant longer than that can stop working before it expires, until the agent requests access again. Keep grants to 2 hours or less.
{% endhint %}

See [Requesting access](https://docs.p0.dev/agentic-access/using-the-gateway/requesting-access.md) for how agents submit and use requests.

## Supported tools

These are the tools of the Tableau MCP server that agents see. Publishing a workbook needs a `write` grant on the target project.

### Read tools

| Tool                                                | What it does                                       |
| --------------------------------------------------- | -------------------------------------------------- |
| `list-projects`                                     | Lists projects.                                    |
| `search-content`                                    | Searches content on the site.                      |
| `list-datasources`                                  | Lists published data sources.                      |
| `get-datasource-metadata`                           | Gets a data source's fields and parameters.        |
| `query-datasource`                                  | Queries a data source.                             |
| `list-workbooks`                                    | Lists workbooks.                                   |
| `get-workbook`                                      | Gets a workbook.                                   |
| `download-workbook`                                 | Downloads a workbook.                              |
| `list-views`                                        | Lists views.                                       |
| `get-view`                                          | Gets a view.                                       |
| `get-view-data`                                     | Gets a view's data.                                |
| `get-view-image`                                    | Gets an image of a view.                           |
| `list-custom-views`                                 | Lists custom views.                                |
| `get-custom-view-data`                              | Gets a custom view's data.                         |
| `get-custom-view-image`                             | Gets an image of a custom view.                    |
| `list-all-pulse-metric-definitions`                 | Lists Pulse metric definitions.                    |
| `list-pulse-metric-definitions-from-definition-ids` | Gets Pulse metric definitions by ID.               |
| `list-pulse-metrics-from-metric-definition-id`      | Lists the Pulse metrics of a definition.           |
| `list-pulse-metrics-from-metric-ids`                | Gets Pulse metrics by ID.                          |
| `list-pulse-metric-subscriptions`                   | Lists the agent user's Pulse metric subscriptions. |
| `generate-pulse-metric-value-insight-bundle`        | Generates insights for a Pulse metric's value.     |
| `generate-pulse-insight-brief`                      | Generates a brief of Pulse insights.               |

### Write tools

| Tool                      | What it does                                                                        |
| ------------------------- | ----------------------------------------------------------------------------------- |
| `request-workbook-upload` | Creates an upload URL for a workbook file, to publish with `publish-workbook`.      |
| `publish-workbook`        | Publishes a workbook to a project, and can overwrite a workbook with the same name. |

## Write policies for Tableau

Match Tableau requests in an agentic access policy ([Agentic access policies](https://docs.p0.dev/agentic-access/agentic-access-policies.md)) with `service: tableau-ai` and `accessType: permission`. Two filters narrow them:

* `site`: the site, keyed on `name`, the identifier you gave the site in P0.
* `policy`: the project grant, keyed on `name`, as `<level>:<project-id>`. A rule covers a request only if it matches every project grant in it.

Patterns are regular expressions, so a rule can match one project at one level (`^read:<project-id>$`), or every project at one level (`^read:.*$`).

For example, auto-approve read access to any locked project for one agent, but only on the `acme-prod` site:

```yaml
- requestor:
    type: agentic
    actor:
      type: agent-client
      clientId: reporting-agent
    subject:
      type: any
  resource:
    type: integration
    service: tableau-ai
    accessType: permission
    filters:
      site:
        effect: keep
        key: name
        pattern: ^acme-prod$
      policy:
        effect: keep
        key: name
        pattern: ^read:.*$
  approval:
    - type: persistent
      maxDuration: { time: 2, unit: h }
```

The `maxDuration` keeps auto-approved grants within Tableau's 120-minute session limit.

## Next steps

* Define the [Agentic access policies](https://docs.p0.dev/agentic-access/agentic-access-policies.md) that determine which agents and users may request Tableau access.
