Skip to content

@W-22065947: Allow for disabling the MCP server globally#309

Open
anyoung-tableau wants to merge 7 commits intomainfrom
anyoung/global-disable
Open

@W-22065947: Allow for disabling the MCP server globally#309
anyoung-tableau wants to merge 7 commits intomainfrom
anyoung/global-disable

Conversation

@anyoung-tableau
Copy link
Copy Markdown
Collaborator

These changes add a BREAK_GLASS_DISABLE_GLOBALLY env var that allows for disabling then MCP server globally. When true all tool call results will immediately return an error.

The motivation here is in the event there is some significant livesite issue that warrants bringing the whole server down, we can do so while still handling requests and returning a somewhat helpful error message to clients.

Copilot AI review requested due to automatic review settings April 16, 2026 18:18
@anyoung-tableau anyoung-tableau changed the title Allow for disabling the MCP server globally @W-22065947: Allow for disabling the MCP server globally Apr 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “break glass” environment-variable switch to globally disable MCP tool execution while keeping the server process up, intended for mitigating live-site incidents with a clearer client-facing failure mode.

Changes:

  • Introduces BREAK_GLASS_DISABLE_GLOBALLY config/env plumbing and a new ServiceUnavailableError (503).
  • Short-circuits tool callbacks in Server.registerTools() when the flag is enabled.
  • Updates tests and documentation to cover/describe the new global-disable behavior.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
types/process-env.d.ts Adds the new env var to the typed process env surface.
src/config.ts Parses BREAK_GLASS_DISABLE_GLOBALLY into config.breakGlassDisableGlobally.
src/config.test.ts Adds default/true parsing tests for the new config flag.
src/errors/mcpToolError.ts Adds ServiceUnavailableError (type service-unavailable, 503).
src/server.ts Rejects tool calls when breakGlassDisableGlobally is enabled.
src/server.test.ts Switches tests to vi.stubEnv + adds break-glass rejection test.
src/tools/listDatasources/listDatasources.ts Exposes params schema via exportedForTesting for use in server test.
src/index.ts Emits a stderr warning when break-glass is enabled at startup.
docs/docs/enterprise/tableau-server.md Documents how to temporarily disable service via the new env var.
docs/docs/configuration/mcp-config/env-vars.md Adds documentation section for BREAK_GLASS_DISABLE_GLOBALLY.
package.json / package-lock.json Bumps version to 1.18.6.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server.ts Outdated
Comment thread src/server.ts
Comment thread docs/docs/configuration/mcp-config/env-vars.md
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.

3 participants