Repository navigation
Description
Summary
An Orchestrator cannot give its pod a hosted MCP server such as AgentMail (https://mcp.agentmail.to/mcp, authenticated by an x-api-key header). Three things in how the operator renders the pod's mcp.yaml stand in the way.
- Static servers never reach the pod without service discovery.
reconcileMCPsConfigMapreturns early unlessspec.mcp.serviceDiscovery.enabledis true, andbuildOrchestratorPodTemplatemounts the<orchestrator>-mcpsConfigMap at/home/infer/.infer/mcp.yamlunder the same condition.spec.mcp.servers, which the CRD describes as being for externally hosted servers, does nothing on its own. Static A2A agents do not have this gap, because they also reach the pod throughINFER_A2A_AGENTS. MCP has no such variable. - A static server is a bare URL.
buildMCPsYAMLnames each onestatic-mcp-<n>and writes no headers, so a server that authenticates by header cannot be configured. - The renderer splits every URL into
scheme/host/port/path, because the CLI's server entry had nourlfield. [FEATURE] Hosted MCP servers: url and headers in mcp.yaml cli#1755 (PR feat(mcp): reach hosted servers through a url and headers in mcp.yaml cli#1757) addsurlandheadersto the CLI'smcp.yaml, and expands${VAR}in it from the process environment.
The delivery path itself is right: a ConfigMap mounted over the pod's mcp.yaml, with a hash annotation that rolls the pod when it changes. A header value written as ${AGENTMAIL_API_KEY} stays a reference in the ConfigMap. The CLI in the pod expands it from its environment, which a workspace's Secret fills through spec.env and secretKeyRef (inference-gateway/cli#1756, PR inference-gateway/cli#1758). That already works, because spec.env passes through to the container unchanged. No secret ever sits in the ConfigMap or the Orchestrator.
Proposed shape: keep spec.mcp.servers as plain URL strings for compatibility, and add a list of named servers with headers beside it.
spec:
mcp:
enabled: true
hostedServers:
- name: agentmail
url: https://mcp.agentmail.to/mcp
headers:
x-api-key: ${AGENTMAIL_API_KEY}This is the operator half of inference-gateway/desktop#476, where agents pick the MCP servers they use and a server can be given to an agent's own Kubernetes computer. The CLI half, a workspace passing its MCP servers into its Orchestrator, follows from it.
Acceptance Criteria
- Static servers render into the pod's
mcp.yaml, and its ConfigMap is mounted, wheneverspec.mcp.enabledis true and the Orchestrator lists a static server, with or without service discovery. - A static server can carry a name, a URL and headers.
spec.mcp.serverskeeps accepting plain URL strings, so existing Orchestrators keep working. - Header values reach the ConfigMap exactly as given, so
${VAR}stays a reference the CLI expands from the pod's environment. The operator never resolves a secret into the ConfigMap. - Each entry is written with
urlandheaders, as the CLI reads them since cli#1757, and also with the splitscheme/host/port/path, so older CLI images keep connecting. - The document is rendered with a YAML encoder rather than string concatenation, so a header value cannot break or inject YAML.
- The pod still rolls when the rendered
mcp.yamlchanges, on both the Deployment and the Sandbox runtime. - Tests cover an Orchestrator with static servers and no discovery, a server with headers, the plain string form, and the rendered document parsing as the CLI's
mcp.yaml.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Nov 8, 2026
CLI half filed: inference-gateway/cli#1760. A Kubernetes workspace names servers from the daemon's mcp.yaml and writes them into each new Orchestrator's
spec.mcp, forwarding header values as${VAR}references.chore(release): 🔖 0.33.0 [skip ci]
inference-gateway-releaser commentedon Nov 8, 2026
🎉 This issue has been resolved in version 0.33.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀