Degrade unreachable non-critical MCP servers instead of aborting gateway startup - #52075
Conversation
…ay startup Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…eway handoff Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds per-server startup criticality so unavailable non-critical MCP servers no longer abort the gateway.
Changes:
- Adds and propagates the
requiredMCP setting. - Degrades optional-server failures while retaining fatal defaults.
- Updates Datadog workflows, documentation, and tests.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/mcp_property_validation.go |
Allows required during schema projection. |
pkg/workflow/mcp_config_validation.go |
Recognizes the new field. |
pkg/workflow/mcp_config_compilation_test.go |
Tests rendered criticality configuration. |
pkg/parser/schemas/mcp_config_schema.json |
Defines required. |
pkg/parser/schemas/main_workflow_schema.json |
Enables the field for MCP servers. |
docs/src/content/docs/reference/tools.md |
Documents startup criticality. |
actions/setup/sh/check_mcp_servers.sh |
Degrades optional-server failures. |
actions/setup/sh/check_mcp_servers_test.sh |
Tests shell degradation behavior. |
actions/setup/js/start_mcp_gateway.test.cjs |
Tests extraction and stripping. |
actions/setup/js/start_mcp_gateway.cjs |
Propagates optional server names. |
.github/workflows/smoke-otel-backends.lock.yml |
Recompiles Smoke OTEL configuration. |
.github/workflows/shared/mcp/datadog.md |
Marks Datadog non-critical. |
.github/workflows/mcp-inspector.lock.yml |
Recompiles inspector configuration. |
Review details
Tip
Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 13/13 changed files
- Comments generated: 1
- Review effort level: Balanced
| tmpFile.Close() | ||
|
|
||
| compiler := NewCompiler() | ||
| compiler.SetSkipValidation(true) |
There was a problem hiding this comment.
Updated in 2ad15f7: removed compiler.SetSkipValidation(true) from TestMCPServerRequiredFalseCompilation, so the test now exercises frontmatter/schema validation as well as YAML rendering.
|
@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back. No failed checks were reported in the compact candidate set for this run.
|
Done. Branch is refreshed at |
PR Triage: #52075
Automated triage — see labels for machine-readable classification.
|
|
@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back. No failed checks were reported in the compact candidate set for this run.
|
Done. Branch is refreshed at |
|
@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back. Unresolved review threads to address (newest first):
No failed checks were reported in the compact candidate set for this run. Branch update was requested by sous-chef in run https://github.com/github/gh-aw/actions/runs/31527012599.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Done. Branch is refreshed at |
|
@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back. Unresolved review threads to address (newest first):
No failed checks were reported in the compact candidate set for this run. Branch update was requested by sous-chef in run https://github.com/github/gh-aw/actions/runs/31531364207.
|
Branch is already refreshed at |
|
@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back. No failed checks were reported in the compact candidate set for this run. Branch update was requested by sous-chef in run https://github.com/github/gh-aw/actions/runs/31535473039.
|
Branch is refreshed at |
|
@copilot This PR looks ready for another finishing pass. Please refresh the branch context, address any remaining reviewer feedback, and run the
|
Branch context is refreshed and up to date at |
A single unreachable MCP server (Datadog returning HTTP 503) aborted the entire gateway startup on Smoke OTEL, taking Sentry, Grafana, and OTLP export down with it even though those three servers connected successfully.
check_mcp_servers.shalready had degradation logic keyed offrequired: false, but it was unreachable end to end: the frontmatter schema rejectedrequiredat compile time, and the flag would not have survived intogateway-output.json— the file the check script actually reads — because the gateway configuration spec has no such field.Schema and validation
main_workflow_schema.json/mcp_config_schema.json:required(boolean, defaulttrue) is now valid on stdio and HTTP MCP server definitions.mcp_config_validation.go,mcp_property_validation.go: addedrequiredto the known-field maps. The renderer already knew how to emit"required": false; only validation was blocking it.Flag propagation
start_mcp_gateway.cjs: newextractOptionalServerNames()collects servers marked non-critical, strips the flag from the config handed to the gateway (unknown field per spec), logs which servers are best-effort, and forwards the names to the check script viaGH_AW_MCP_OPTIONAL_SERVERS.check_mcp_servers.sh: honors that env var in addition to.required == false, and emits a distinct line —⚠ <name>: non-critical MCP server unavailable, continuing without it— instead of the generic optional-failure message.Workflow and docs
shared/mcp/datadog.md: Datadog markedrequired: false;smoke-otel-backends.lock.ymlandmcp-inspector.lock.ymlrecompiled.reference/tools.md.Servers without the flag remain startup-critical, and startup still fails when no server connects at all.
Tests
"required": falserenders only for the non-critical server.extractOptionalServerNamescollection and flag stripping.Not addressed here: the issue's suggested circuit breaker for repeated transient
503s within a 6h window. Optional servers still run the full 10s/20s/30s retry sequence — they just no longer abort startup.Run: https://github.com/github/gh-aw/actions/runs/31508439729> Generated by 👨🍳 PR Sous Chef · gpt54 · 35.1 AIC · ⌖ 6.14 AIC · ⊞ 8.5K · ◷
Requested branch update from https://github.com/github/gh-aw/actions/runs/31535473039.> Generated by 👨🍳 PR Sous Chef · gpt54 · 8.59 AIC · ⌖ 5.18 AIC · ⊞ 8.5K · ◷