Skip to content

Commit cb87cec

Browse files
authored
@W-21817321: Add Tableau MCP site level configuration support (#291)
* rough draft mcpSiteSettings * change mcpSiteSettings mock * fix sidebar positions * add site overrides * add override tests * remove unused functions * version bump * add comments to overriableConfig constructor * Update ENV variables with site override info. * finally, site settings docs. * remove invalid links in docs * update version check logic * update docs and logic * update mock for OAuth test. * version bump * add mcp scope * update package version * add scope for custom_view
1 parent 084d0b6 commit cb87cec

20 files changed

Lines changed: 610 additions & 191 deletions

docs/docs/configuration/mcp-config/env-vars.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,19 @@ data source][tab-connect-ds].
150150

151151
<hr />
152152

153+
## `ENABLE_MCP_SITE_SETTINGS`
154+
155+
When `true`, the Tableau MCP server will fetch and apply site settings overrides for any user session, see [Site Settings](site-settings.md).
156+
157+
- Default: `true`
158+
- When `false`, Tableau MCP server will not fetch or apply site settings overrides.
159+
160+
<hr />
161+
153162
## `INCLUDE_TOOLS`
154163

155164
A comma-separated list of tool or tool group names to include in the server. Only these tools will
156-
be available.
165+
be available. This variable is site overridable, see [Site Settings](site-settings.md).
157166

158167
- Default: Empty string (_all_ are included)
159168
- For a list of available tools and groups, see
@@ -165,7 +174,7 @@ be available.
165174
## `EXCLUDE_TOOLS`
166175

167176
A comma-separated list of tool or tool group names to exclude from the server. All other tools will
168-
be available.
177+
be available. This variable is site overridable, see [Site Settings](site-settings.md).
169178

170179
- Default: Empty string (_none_ are excluded)
171180
- Cannot be provided with `INCLUDE_TOOLS`.
@@ -184,13 +193,13 @@ The maximum timeout for requests to the Tableau Server REST API.
184193
## `MAX_RESULT_LIMIT`
185194

186195
The maximum number of results that every tool with a `limit` parameter can return when no
187-
tool-specific max result limit is set in the [`MAX_RESULT_LIMITS`](#max_result_limits) environment
188-
variable.
196+
tool-specific max result limit is set in the [`MAX_RESULT_LIMITS`](#max_result_limits)
197+
variable. This variable is site overridable, see [Site Settings](site-settings.md).
189198

190199
:::warning
191200

192-
Take care when setting this value and be sure to set appropriate tool-specific limits in the
193-
[`MAX_RESULT_LIMITS`](#max_result_limits) environment variable.
201+
Take care when setting this value and be sure to set appropriate tool-specific limits using the
202+
[`MAX_RESULT_LIMITS`](#max_result_limits) variable.
194203

195204
:::
196205

@@ -202,7 +211,7 @@ Take care when setting this value and be sure to set appropriate tool-specific l
202211
## `MAX_RESULT_LIMITS`
203212

204213
A comma-separated list of tool names (or tool group names) and the maximum number of results that
205-
each tool (or tools in the group) can return.
214+
each tool (or tools in the group) can return. This variable is site overridable, see [Site Settings](site-settings.md).
206215

207216
:::info
208217

@@ -229,7 +238,7 @@ This means that:
229238
means that the `list-datasources` tool can return up to 20 data sources but the `query-datasource`
230239
tool can only return up to 1000 results.
231240
- If a tool-specific limit is not set, the global limit specified by the
232-
[`MAX_RESULT_LIMIT`](#max_result_limit) environment variable will be used instead.
241+
[`MAX_RESULT_LIMIT`](#max_result_limit) variable will be used instead.
233242
- Each limit must be a positive number.
234243

235244
<hr />
@@ -238,7 +247,7 @@ This means that:
238247

239248
Disables requests that are made to the VizQl Data Service for validating queries in the
240249
[`query-datasource`](../../tools/data-qna/query-datasource.md) tool. Does not disable the ability to
241-
query the datasource.
250+
query the datasource. This variable is site overridable, see [Site Settings](site-settings.md).
242251

243252
- Default: `false`
244253
- When `true`, skips validation of queries against metadata results and validation of SET and MATCH
@@ -263,6 +272,7 @@ Disable validation of SET and MATCH filter values in the
263272

264273
Disables `graphql` requests to the Tableau Metadata API in the
265274
[`get-datasource-metadata`](../../tools/data-qna/get-datasource-metadata.md) tool.
275+
This variable is site overridable, see [Site Settings](site-settings.md).
266276

267277
- Default: `false`
268278
- When `true`, skips requests to the `graphql` endpoint that provides additional context to field
@@ -302,6 +312,17 @@ variable.
302312

303313
<hr />
304314

315+
## `MCP_SITE_SETTINGS_CHECK_INTERVAL_IN_MINUTES`
316+
317+
When site settings are enabled by the Tableau MCP server, settings will be fetched for the given site and applied to each session.
318+
Rather than fetching site settings with every request, the MCP server will cache the settings and only check it again after the interval
319+
specified by this environment variable.
320+
321+
- Default: `10` minutes
322+
- Must be a positive number between `1` and `1440` (1 day).
323+
324+
<hr />
325+
305326
## `TELEMETRY_PROVIDER`
306327

307328
The telemetry provider to use for metrics collection.

docs/docs/configuration/mcp-config/http-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 5
2+
sidebar_position: 4
33
---
44

55
# HTTP Server

docs/docs/configuration/mcp-config/oauth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 3
33
---
44

55
# Enabling OAuth
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Site Settings
6+
7+
Tableau MCP supports configuration on a per-site basis via REST API. When a Tableau MCP user is authenticated to a given site, the site's configuration is fetched and applied to their session such that each setting will override any current value set by the Tableau MCP server.
8+
9+
In order to use site settings:
10+
- Only available in Tableau versions 2026.2 or higher.
11+
- Site settings must be enabled by the Tableau MCP server, see [`ENABLE_MCP_SITE_SETTINGS`](env-vars.md#enable_mcp_site_settings).
12+
13+
## Configuring Site Settings
14+
15+
Only site and server administrators are able to configure Tableau MCP site settings.
16+
Not every Tableau MCP configuration variable is overridable with site settings, only the ones listed as [Site Overridable Variables](#site-overridable-variables).
17+
18+
When creating or updating site settings via REST API:
19+
- To use a variable's default value or clear limits and bounds set by the Tableau MCP server, you can provide an empty string as the override value.
20+
- To remove an override variable from the list of site settings and restore its value back to what is set by the Tableau MCP server,
21+
you can `POST` the current list of site settings minus the variable you want to remove or include the variable in a `PUT` request with a null value or omit the value property entirely.
22+
23+
:::warning
24+
25+
When configuring site settings, make sure to validate your overrides have been applied successfully.
26+
Tableau MCP will ignore any overrides if it does not recognize the variable being overriden, or if the override value is invalid.
27+
28+
You might not see changes take immediate effect due to caching, see [`MCP_SITE_SETTINGS_CHECK_INTERVAL_IN_MINUTES`](env-vars.md#mcp_site_settings_check_interval_in_minutes).
29+
30+
:::
31+
32+
## Site Overridable Variables
33+
34+
- ### [`DISABLE_METADATA_API_REQUESTS`](env-vars.md#disable_metadata_api_requests)
35+
- ### [`DISABLE_QUERY_DATASOURCE_VALIDATION_REQUESTS`](env-vars.md#disable_query_datasource_validation_requests)
36+
- ### [`EXCLUDE_TOOLS`](env-vars.md#exclude_tools)
37+
- ### [`INCLUDE_DATASOURCE_IDS`](tool-scoping.md#include_datasource_ids)
38+
- ### [`INCLUDE_PROJECT_IDS`](tool-scoping.md#include_project_ids)
39+
- ### [`INCLUDE_TOOLS`](env-vars.md#include_tools)
40+
- ### [`INCLUDE_TAGS`](tool-scoping.md#include_tags)
41+
- ### [`INCLUDE_WORKBOOK_IDS`](tool-scoping.md#include_workbook_ids)
42+
- ### [`MAX_RESULT_LIMIT`](env-vars.md#max_result_limit)
43+
- ### [`MAX_RESULT_LIMITS`](env-vars.md#max_result_limits)

docs/docs/configuration/mcp-config/tool-scoping.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 6
2+
sidebar_position: 5
33
---
44

55
# Tool Scoping
@@ -30,9 +30,10 @@ The following optional environment variables can be used to configure the tool s
3030

3131
A comma-separated list of project IDs by which to constrain tool arguments and results. Only data
3232
sources and workbooks (or views from those workbooks) that are members of the provided projects can
33-
be queried or will be included in the results of the tools.
33+
be queried or will be included in the results of the tools. This variable is site overridable, see [Site Settings](site-settings.md).
3434

35-
- When set, cannot be empty.
35+
- When set by the Tableau MCP server, cannot be empty.
36+
- When overriden by site settings, can be empty to clear any bounds set by the Tableau MCP server.
3637
- Project IDs can be determined using the
3738
[Query Projects](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_projects.htm#query_projects)
3839
REST API or by the [List Data Sources](../../tools/data-qna/list-datasources.md),
@@ -59,9 +60,10 @@ Example: `d87d843b-4326-4ce3-bc50-a68c1e6c9ca5,861566`
5960

6061
A comma-separated list of data source IDs by which to constrain tool arguments and results. Only
6162
data sources or Pulse metrics and definitions derived from those data sources can be queried or will
62-
be included in the results of the tools.
63+
be included in the results of the tools. This variable is site overridable, see [Site Settings](site-settings.md).
6364

6465
- When set, cannot be empty.
66+
- When overriden by site settings, can be empty to clear any bounds set by the Tableau MCP server.
6567
- Data source IDs can be determined using the
6668
[Query Data Sources](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#query_data_sources)
6769
REST API or the [List Data Sources](../../tools/data-qna/list-datasources.md) tool (assuming tool
@@ -76,9 +78,10 @@ Example: `2d935df8-fe7e-4fd8-bb14-35eb4ba31d4`
7678

7779
A comma-separated list of workbook IDs by which to constrain tool arguments and results. Only
7880
workbooks or views from those workbooks can be queried or will be included in the results of the
79-
tools.
81+
tools. This variable is site overridable, see [Site Settings](site-settings.md).
8082

8183
- When set, cannot be empty.
84+
- When overriden by site settings, can be empty to clear any bounds set by the Tableau MCP server.
8285
- Workbook IDs can be determined using the
8386
[Query Workbooks](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_workbooks_and_views.htm#query_workbooks)
8487
REST API or the [List Workbooks](../../tools/workbooks/list-workbooks.md) tool (assuming tool
@@ -94,9 +97,10 @@ Example: `222ea993-9391-4910-a167-56b3d19b4e3b`
9497

9598
A comma-separated list of case-sensitive tags by which to constrain tool arguments and results. Only
9699
data sources, workbooks, or views with the provided tags can be queried or will be included in the
97-
results of the tools.
100+
results of the tools. This variable is site overridable, see [Site Settings](site-settings.md).
98101

99102
- When set, cannot be empty.
103+
- When overriden by site settings, can be empty to clear any bounds set by the Tableau MCP server.
100104
- Tags can be determined using the
101105
[Tableau product](https://help.tableau.com/current/pro/desktop/en-us/tags.htm) or the REST APIs
102106
for querying

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@tableau/mcp-server",
33
"description": "Helping agents see and understand data.",
4-
"version": "1.18.6",
4+
"version": "1.18.7",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/tableau/tableau-mcp.git"

src/config.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,16 @@ describe('Config', () => {
220220
expect(config.mcpSiteSettingsCheckIntervalInMinutes).toBe(2);
221221
});
222222

223-
it('should set enableMcpSiteSettings to false by default', () => {
223+
it('should set enableMcpSiteSettings to true by default', () => {
224224
const config = new Config();
225-
expect(config.enableMcpSiteSettings).toBe(false);
225+
expect(config.enableMcpSiteSettings).toBe(true);
226226
});
227227

228-
it('should set enableMcpSiteSettings to true when specified', () => {
229-
vi.stubEnv('ENABLE_MCP_SITE_SETTINGS', 'true');
228+
it('should set enableMcpSiteSettings to false when specified', () => {
229+
vi.stubEnv('ENABLE_MCP_SITE_SETTINGS', 'false');
230230

231231
const config = new Config();
232-
expect(config.enableMcpSiteSettings).toBe(true);
232+
expect(config.enableMcpSiteSettings).toBe(false);
233233
});
234234

235235
it('should set enablePassthroughAuth to false by default', () => {

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class Config {
189189
},
190190
);
191191

192-
this.enableMcpSiteSettings = enableMcpSiteSettings === 'true';
192+
this.enableMcpSiteSettings = enableMcpSiteSettings !== 'false';
193193
this.enablePassthroughAuth = enablePassthroughAuth === 'true';
194194
const disableOauthOverride = disableOauth === 'true';
195195
const disableScopes = oauthDisableScopes === 'true';

0 commit comments

Comments
 (0)