Skip to content

Add Tableau embedding support to MCP app#400

Open
jarhun88 wants to merge 7 commits into
mainfrom
app_embedding
Open

Add Tableau embedding support to MCP app#400
jarhun88 wants to merge 7 commits into
mainfrom
app_embedding

Conversation

@jarhun88

Copy link
Copy Markdown
Contributor

Description

This PR implements full-screen Tableau visualization embedding in the MCP app using the Embedding API v3. The app now retrieves OAuth tokens via the get-oauth-token tool and embeds Tableau views received from MCP tool results.

Key changes:

  • Add tableau:views:embed scope to get-oauth-token tool for embedding authentication
  • Create embedTableauViz utilities for creating and managing viz elements
  • Create getOAuthTokenToolClient module for retrieving OAuth tokens from MCP server
  • Simplify app UI to full-screen layout with no loading hero section
  • Dynamically load Tableau Embedding API from configured server URL
  • Add comprehensive test coverage (19 new tests) for embedding and token retrieval
  • Install jsdom as dev dependency for DOM testing

Motivation and Context

The MCP app needed the ability to embed Tableau visualizations when users request views through MCP tools. This enables a seamless experience where tool results are automatically rendered as interactive visualizations rather than just returning metadata.

The critical fix was adding the tableau:views:embed scope to the OAuth token, which is required by Tableau's Embedding API. Without this scope, the embedding API prompts for login instead of accepting the token.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

How Has This Been Tested?

  • Added 19 unit tests covering:
    • OAuth token retrieval (7 tests in getOAuthTokenToolClient.test.ts)
    • Tableau viz element creation and embedding (12 tests in embedTableauViz.test.ts)
  • All 1742 tests pass locally
  • Manual testing: verified embedding works with OAuth token containing tableau:views:embed scope
  • Tested full-screen layout and visualization rendering

Related Issues

Related to the MCP apps feature development.

Checklist

  • I have updated the version in the package.json file by using npm run version. For example, use npm run version:patch for a patch version bump.
  • I have made any necessary changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have documented any breaking changes in the PR description. For example, renaming a config environment variable or changing its default value.

Contributor Agreement

By submitting this pull request, I confirm that:

jarhun88 added 7 commits June 15, 2026 16:41
Extracted getOAuthToken logic from mcp-app.ts into a separate
lib/getOAuthTokenToolClient module. This improves code reusability
and testability by isolating the token retrieval logic.

Also enabled mcp-apps feature flag in features.json.
Implement full-screen Tableau visualization embedding using the Embedding
API v3. The app retrieves OAuth tokens via the get-oauth-token tool and
embeds views received from MCP tool results.

Key changes:
- Add tableau:views:embed scope to get-oauth-token tool for embedding auth
- Create embedTableauViz utilities for creating and managing viz elements
- Create getOAuthTokenToolClient for retrieving OAuth tokens from MCP
- Simplify app UI to full-screen layout with no loading state
- Dynamically load Embedding API from configured Tableau server
- Add comprehensive tests for embedding and token retrieval (19 tests)
- Install jsdom for DOM testing

The app now extracts view URLs from tool results, fetches OAuth tokens,
and renders visualizations in a full-viewport container.
Remove all console.log, console.info, console.warn, and console.error
statements from the MCP app client code for a cleaner runtime with no
console output. The app now runs silently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant