Skip to content

Fail fast when required MCP servers are omitted - #52854

Closed
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/aw-failures-fix-mcp-omission
Closed

Fail fast when required MCP servers are omitted#52854
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/aw-failures-fix-mcp-omission

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Missing MCP secrets could cause Sentry/Grafana servers to disappear from the gateway output, leaving workflows to fail later after the agent discovered unavailable tools. This makes required MCP omission an explicit startup failure.

  • Startup validation

    • Compares configured mcpServers with gateway output before agent config conversion.
    • Fails required server omissions with the omitted server names and missing/empty env vars.
    • Preserves required: false best-effort server behavior.
  • Coverage

    • Adds focused tests for required omission detection, optional server exclusions, and failure message formatting.

Example failure shape:

ERROR: Required MCP server(s) were omitted from the gateway output: sentry (missing/empty env: SENTRY_ACCESS_TOKEN); grafana (missing/empty env: GRAFANA_SERVICE_ACCOUNT_TOKEN, GRAFANA_URL). Configure the missing secrets/environment variables, or mark intentionally best-effort servers with required: false.

Copilot AI and others added 3 commits August 15, 2026 05:58
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: bug | Risk: medium | Score: 64/100

  • Impact: 27/50 (prevents silent MCP server omission from causing late workflow failures)
  • Urgency: 19/30 (fresh PR, no CI signal yet, moderate operational risk)
  • Quality: 18/20 (clean startup-validation diff, no reviews yet)

Recommended action: fast_track
Improves fail-fast behavior for missing required MCP servers. Batched with reliability-fixes cluster (#52757, #52836, #52837).

Generated by 🔧 PR Triage Agent · auto · 46.6 AIC · ⌖ 2.63 AIC · ⊞ 8.1K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: bug
  • Risk: medium
  • Priority: medium
  • Score: 70/100
  • Recommended action: fast_track
  • Batch: reliability-fixes

Fixes silent MCP server omission causing downstream tool-discovery failures. CI unstable — verify before merge.

Automated triage — see [PR Triage Report] for full context.

Generated by 🔧 PR Triage Agent · auto · 62.5 AIC · ⌖ 2.53 AIC · ⊞ 8.1K ·

@pelikhan
pelikhan marked this pull request as ready for review August 15, 2026 12:54
Copilot AI balanced review requested due to automatic review settings August 15, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds startup validation to fail fast when required MCP servers are omitted from gateway output.

Changes:

  • Detects omitted required servers and missing environment variables.
  • Preserves optional-server behavior.
  • Adds focused validation and formatting tests.
Show a summary per file
File Description
actions/setup/js/start_mcp_gateway.cjs Adds omission detection, diagnostics, and startup failure handling.
actions/setup/js/start_mcp_gateway.test.cjs Tests required/optional detection and error formatting.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +300 to +304
for (const match of matches) {
const varName = match[1];
const envValue = env[varName];
if (envValue == null || envValue.trim() === "") {
missing.add(varName);
@pelikhan pelikhan closed this Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw-failures] [P0] Sentry/Grafana MCP servers silently omitted when secrets missing — blocks Daily AIC Consumption Report

3 participants