Skip to content

feat(gateway): tune MCP health polling with spec.mcp.healthCheck - #328

Merged
edenreich merged 1 commit into
mainfrom
fix/drop-mcp-server-healthcheck
Nov 8, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/drop-mcp-server-healthcheck

Conversation

@edenreich

@edenreich edenreich commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The gateway health-checks its MCP servers: it polls each one with tools/list and reconnects one that stops answering. That polling is configured gateway-wide by MCP_POLLING_ENABLED, MCP_POLLING_INTERVAL and MCP_POLLING_TIMEOUT, and the operator set none of them. Instead it accepted a per-server spec.mcp.servers[].healthCheck (enabled, path, interval) that no controller read, and that the gateway could not honor, since it has no per-server check and polls over MCP rather than an HTTP path.

This moves the health check to where the gateway applies it:

  • spec.mcp.healthCheck (enabled, interval, timeout) renders MCP_POLLING_ENABLED, MCP_POLLING_INTERVAL and MCP_POLLING_TIMEOUT on the gateway pod. enabled defaults to true, and an unset interval or timeout keeps the gateway's default (30s and 5s).
  • Leaving healthCheck out sets none of the variables, so the gateway keeps polling with its defaults as before.
  • spec.mcp.servers[] is now name and url, which is everything the controller renders into MCP_SERVERS.
  • examples/gateway-complete/gateway.yaml and step 5 of examples/mcp-server/README.md set healthCheck at the spec.mcp level.
  • The CRDs, deepcopy code, manifests/crds.yaml and manifests/install.yaml are regenerated.

Closes #326

Behavior change

A Gateway that still sets spec.mcp.servers[].healthCheck is refused as an unknown field. Move the block up to spec.mcp.healthCheck, dropping path.

Verification

  • task test passes, with tests for the rendered MCP_POLLING_* variables and for leaving them out when healthCheck is unset.
  • On a k3d cluster with the regenerated CRDs and the controller running locally, a Gateway with healthCheck: {interval: 10s, timeout: 2s} was defaulted to enabled: true, and its pod got MCP_POLLING_ENABLED=true, MCP_POLLING_INTERVAL=10s and MCP_POLLING_TIMEOUT=2s. The gateway logged started mcp server status polling with "interval":10.
  • Every manifest under examples/ passes a server dry run, and a Gateway with the per-server field is refused with strict decoding error: unknown field "spec.mcp.servers[0].healthCheck".

Cross-repo impact

The gateway polls every MCP server with tools/list and reconnects one that
stops answering, configured gateway-wide by MCP_POLLING_ENABLED,
MCP_POLLING_INTERVAL and MCP_POLLING_TIMEOUT. The operator set none of them.
Its per-server spec.mcp.servers[].healthCheck (enabled, path, interval) was
accepted but never read, and the gateway has no per-server check or path to
drive.

spec.mcp.healthCheck (enabled, interval, timeout) now renders those
variables. Left unset, the gateway keeps its defaults. The per-server field
is gone, so a Gateway that still sets it is refused as an unknown field.
@edenreich
edenreich force-pushed the fix/drop-mcp-server-healthcheck branch from e33aea3 to 3ae6aab Compare November 8, 2026 22:15
@edenreich edenreich changed the title fix(gateway): drop the unused MCP server healthCheck field feat(gateway): tune MCP health polling with spec.mcp.healthCheck Nov 8, 2026
@edenreich
edenreich merged commit ff0867c into main Nov 8, 2026
1 check passed
@edenreich
edenreich deleted the fix/drop-mcp-server-healthcheck branch November 8, 2026 22:19
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 8, 2026
## [0.33.0](v0.32.0...v0.33.0) (2026-11-08)

### ✨ Features

* **gateway:** tune MCP health polling with spec.mcp.healthCheck ([#328](#328)) ([ff0867c](ff0867c))
* **orchestrator:** give spec.mcp.servers names and headers in the pod's mcp.yaml ([#324](#324)) ([56f4ff8](56f4ff8)), closes [#321](#321)
* **orchestrator:** pass through binding Service annotations and labels ([#320](#320)) ([d543db8](d543db8))

### ♻️ Improvements

* **orchestrator:** export the status contract from api/v1alpha1 ([#330](#330)) ([4b5d854](4b5d854))

### 🐛 Bug Fixes

* **examples:** serve the example MCP servers over stateless MCP 2026-07-28 ([#325](#325)) ([6d34978](6d34978)), closes [#323](#323)
* **samples:** make the Gateway and MCP samples pass CRD validation ([#329](#329)) ([e2e5d2a](e2e5d2a))

### 👷 CI

* **deps:** bump the gomod group with 4 updates ([#319](#319)) ([67f1bde](67f1bde))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.33.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Gateway spec.mcp.servers[].healthCheck is accepted but never used

1 participant