agentleFS
tableautableau/tableau-mcp/.cursor/rules/tableau-mcp.mdc

tableau-mcp / rules

Cursor rule347 starsChanged 6 months agoApache-2.0View on GitHub

Tableau MCP project context, architecture overview, and core principles

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

We split this tableau-mcp.mdc into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test coverage for new paths

    line 84
  2. Distinctive:

    No tool can execute data operations without verified auth

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
tableau-mcp.mdc
---
description: Tableau MCP project context, architecture overview, and core principles
globs:
  - "src/**/*.ts"
  - "tests/**/*.ts"
---

# Tableau MCP — Project Context

## What This Is
Official Tableau MCP server (`tableau/tableau-mcp`). Provides MCP tools
for AI applications integrating with Tableau Cloud and Server via
REST API, VDS API, Metadata API, and Pulse API.

## Role Context
Auth lead on this project. All auth-related code requires architectural
rigor — not just working code.

## Core Principles
- Deterministic control over prompt hope for all auth paths
- Programmatic enforcement for security-critical operations
- Structured errors always — never silent failures
- Understand before building — plan before coding

## Architecture Overview

### Source Layout
```
src/
├── config.ts              # Config loading from env
├── server.ts              # MCP Server class
├── restApiInstance.ts      # REST API lifecycle, auth, useRestApi()
├── index.ts               # Entry point (stdio/http)
├── tools/                 # MCP tools (factory pattern)
│   ├── tool.ts            # Base Tool class
│   ├── tools.ts           # Tool factory registry
│   ├── toolContext.ts     # TableauRequestHandlerExtra type
│   └── toolName.ts        # Tool name constants + groups
├── server/                # HTTP server & auth middleware
│   ├── express.ts         # Express setup, middleware chain
│   ├── passthroughAuthMiddleware.ts
│   └── oauth/             # OAuth provider, tokens, scopes
├── sdks/tableau/          # Tableau REST API client (Zodios)
├── utils/                 # Shared utilities
├── telemetry/             # Telemetry
└── logging/               # Structured logging
```

### Key Libraries
- `ts-results-es` — `Result<T, E>`, `Ok()`, `Err()` for tool callbacks
- `zod` — Schema validation for params, auth tokens, configs
- `@zodios/core` — Type-safe REST API client for Tableau APIs
- `jose` — JWT/JWE operations for OAuth tokens
- `vitest` — Test framework (NOT jest)

### Tool Registry (All 16 Tools)
Datasource: `list-datasources`, `get-datasource-metadata`, `query-datasource`
Workbook: `list-workbooks`, `get-workbook`
View: `list-views`, `get-view-data`, `get-view-image`
Pulse: `list-all-pulse-metric-definitions`,
  `list-pulse-metric-definitions-from-definition-ids`,
  `list-pulse-metrics-from-metric-definition-id`,
  `list-pulse-metrics-from-metric-ids`,
  `list-pulse-metric-subscriptions`,
  `generate-pulse-metric-value-insight-bundle`,
  `generate-pulse-insight-brief`
Content Exploration: `search-content`

Auth touches ALL of these. Changes to auth affect every tool downstream.

## Error Handling Patterns
- `getExceptionMessage(error: unknown)` — safe error text extraction
- `getHttpStatus(error: Error)` — HTTP status from AxiosError or PulseDisabledError
- `invariant(condition, message)` — internal precondition assertions
- `src/utils/retry.ts` — exponential backoff (3 retries, jitter)
- Zod validation errors → non-error results with warning + raw data
  (so users don't get stuck on schema strictness)

## PR Standards
PRs must include:
- What problem this solves
- What alternatives were considered
- Auth impact assessment (if auth-adjacent)
- Test coverage for new paths

## What Good Looks Like
- Auth errors surface cleanly with enough context for the calling agent
  to recover or escalate
- No tool can execute data operations without verified auth
- A new contributor can understand the auth flow from the code alone

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.