feat(mcp): keep the MCP server off until MCP_SERVER_ENABLED is set
Stack. This is one PR in a series that adds a built-in MCP server to DataHub Core. It is based on na--ai-service-image (the previous PR in the stack); review only its own commit. This PR changes GMS, the frontend, Docker or CI, not only the new Python packages. Everything user-facing is behind a GMS feature flag, MCP_SERVER_ENABLED, off by default (added in #21349).
Stack so far:
- #21332
- #21333
- #21334
- #21335
- #21336
- #21337
- #21338
- #21339
- #21340
- #21341
- #21342
- #21343
- #21344
- #21345
- #21346
- #21347
- #21348
- #21349 ā this PR
- #21350
- #21351
- #21352
- #21353
- #21435
- #21436
- #21437
- #21438
- #21439
- #21440
- #21441
- #21442
- #21443
- #21444
- #21445
- #21447
- #21501
- #21502
- #21503
- #21504
- #21505
- #21506
- #21507
- #21508
- #21509
- #21510
- #21511
- #21512
What this does
DataHub's built-in MCP server stays off until it is released. One GMS feature
flag, MCP_SERVER_ENABLED (featureFlags.mcpServerEnabled), default false,
controls both the backend and the UI:
- GMS reports it in /config as mcpServer.enabled, next to
authentication.enabled, and in the app config's feature flags. - datahub-ai-service reads it through the 60-second GmsServerInfo cache and
answers 404 (mcp_disabled) on /mcp while it is off. /health stays up. A GMS
from before the flag doesn't report it; that pairing is deliberate, so MCP
stays on there. An unreadable /config gives a 503, like the other checks
that need GMS. - The UI gets mcpServerEnabled in its app config, so later changes can hide
the MCP settings page and home page module while it is off.
The datahub-ai-service container can still run with the flag off; it serves
only /health until the flag is turned on and GMS restarts.
Testing
Python tests for both packages (the gate: 404 while off, on for a GMS without the flag, 503 when /config can't be read); AppConfigResolverTest and ConfigServletTest. Checked live with the flag off (/mcp 404) and on.
Checklist
- The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
- Tests for the changes have been added/updated (if applicable)
- Docs related to the changes have been added/updated (if applicable). The MCP docs come later in the stack.
- For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes. The release notes come later in the stack.
š¤ Generated with Claude Code