openai-mcp-tunnel

by KlickTipp

Helm chartv0.2.1App 0.0.20Verified publisher

A Helm chart for running the OpenAI Secure MCP Tunnel client in Kubernetes.

About this chart

openai-mcp-tunnel

A Helm chart for running the OpenAI Secure MCP Tunnel client in Kubernetes.

Homepage: https://github.com/klicktipp/helm-charts

Maintainers

NameEmailUrl
vquiehttps://github.com/vquie

Source Code

Deployment Model

This chart deploys openai/tunnel-client as a dedicated Kubernetes Deployment for an MCP server that is already reachable from the pod network.

It is intentionally scoped to the dedicated-pod pattern described by OpenAI:

  • no inbound firewall rule is required for the tunnel itself
  • the pod needs outbound HTTPS access to api.openai.com:443
  • the pod also needs private reachability to the configured MCP_SERVER_URL, or a local stdio command via MCP_COMMAND

Security Defaults

The chart ships with restrictive defaults suitable for production hardening:

  • non-root execution with all Linux capabilities dropped
  • RuntimeDefault seccomp profile
  • read-only root filesystem with a dedicated /tmp emptyDir
  • ServiceAccount token mounting disabled
  • optional NetworkPolicy enabled by default
  • admin UI remote access disabled by default

Two runtime inputs are always required:

  • controlPlane.tunnelId
  • a Secret-backed CONTROL_PLANE_API_KEY via credentials.existingSecretName or credentials.createSecret=true

The control-plane host override is optional:

  • leave controlPlane.baseUrl empty for the normal OpenAI default
  • set controlPlane.baseUrl only when you use a custom gateway host
  • set controlPlane.urlPath when that gateway expects a prefix before /v1/..., for example /workspace/dev/us

MCP Upstream Modes

The chart supports exactly one main MCP binding:

  • mcp.serverUrl for a private Streamable HTTP MCP server reachable from the cluster
  • mcp.command for a stdio MCP command started inside the container
  • automatic fallback to the built-in stub MCP when neither mcp.serverUrl nor mcp.command is set
  • mcp.bootstrap.enabled=true if you want that stub mode to be explicit in values

For Kubernetes production use, mcp.serverUrl is the safer default. OpenAI documents that stdio transport does not support MCP sessions, and multi-replica active-active behavior only works when the upstream is stateless or session-aware.

The bootstrap stub is useful only as a first-step bring-up mechanism. It lets ChatGPT connect to the tunnel, but it does not expose your real MCP tools. Switch to mcp.serverUrl or mcp.command once the backend exists.

Startup and Health Probes

The chart sets mcp.startupWaitTimeout: "5m" to retry startup initialization when an HTTP MCP endpoint is unavailable. The startup probe checks /readyz every 10 seconds and permits 36 failures (about 6 minutes). If startup never succeeds, Kubernetes restarts the container and begins a new retry window.

Readiness checks /readyz; liveness checks /healthz. Readiness failures alone do not restart the container. Liveness and readiness probes begin only after the startup probe succeeds. Set startupProbe: null to disable the startup probe.

When increasing mcp.startupWaitTimeout, also increase startupProbe.failureThreshold or startupProbe.periodSeconds so their product exceeds the retry window. These settings cover startup recovery; they do not ensure MCP session recovery or restart the container on every later upstream outage.

Internal MCP Authentication

For internal MCP servers that require static technical authentication, prefer the dedicated Secret-backed header settings instead of raw extraEnv:

  • mcp.auth.extraHeaders for normal MCP HTTP requests
  • mcp.auth.discoveryExtraHeaders for startup probes, OAuth discovery, and MCP initialize probing

The expected secret values are complete header values. For a bearer token, store the full string such as Bearer eyJ... in a secret key, then map the header name to that key.

Example:

mcp:
  serverUrl: https://internal-mcp.example.local/mcp
  auth:
    extraHeaders:
      existingSecretName: internal-mcp-auth
      headers:
        Authorization: authorization

If the MCP also requires auth during discovery or initialize probing, mirror the same mapping under mcp.auth.discoveryExtraHeaders.

Production Notes

For production rollouts, prefer one of these image supply-chain patterns:

  • pin image.digest against a vetted mirror in your own registry
  • or mirror the published openai/tunnel-client image into an internal registry and override image.registry / image.repository

Values

KeyTypeDefaultDescription
replicaCountint1Number of tunnel-client pods to run.
imageobject{"digest":"","pullPolicy":"IfNotPresent","registry":"ghcr.io","repository":"klicktipp/openai-tunnel-client","tag":""}Container image configuration for openai/tunnel-client.
image.registrystring"ghcr.io"Optional image registry prefix.
image.repositorystring"klicktipp/openai-tunnel-client"Image repository name.
image.tagstring""Image tag. When empty, the chart appVersion is used.
image.pullPolicystring"IfNotPresent"Image pull policy.
image.digeststring""Optional image digest overriding the tag-based reference.
imagePullSecretslist[]Image pull secrets for the pod.
nameOverridestring""Partially override generated resource names.
fullnameOverridestring""Fully override generated resource names.
namespaceOverridestring""Override the namespace used for namespaced resources.
serviceAccountobject{"annotations":{},"automount":false,"create":true,"name":""}ServiceAccount configuration.
serviceAccount.createbooltrueCreate a dedicated ServiceAccount.
serviceAccount.automountboolfalseMount the ServiceAccount token into the pod.
serviceAccount.annotationsobject{}ServiceAccount annotations.
serviceAccount.namestring""Existing ServiceAccount name to use. When empty, a name is generated.
podAnnotationsobject{}Extra annotations added to the pod template.
podLabelsobject{}Extra labels added to the pod template.
podSecurityContextobject{"fsGroup":65532,"fsGroupChangePolicy":"OnRootMismatch"}Pod-level security context.
podSecurityContext.fsGroupint65532Filesystem group applied to mounted volumes.
podSecurityContext.fsGroupChangePolicystring"OnRootMismatch"Change policy for fsGroup ownership.
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}Container-level security context.
securityContext.runAsNonRootbooltrueRun the container without root privileges.
securityContext.runAsUserint65532Numeric user ID for the container process.
securityContext.runAsGroupint65532Numeric group ID for the container process.
securityContext.allowPrivilegeEscalationboolfalsePrevent privilege escalation.
securityContext.readOnlyRootFilesystembooltrueKeep the root filesystem read-only.
securityContext.capabilities.droplist["ALL"]Linux capabilities to drop.
securityContext.seccompProfile.typestring"RuntimeDefault"Seccomp profile type.
serviceobject{"annotations":{},"enabled":true,"port":8080,"type":"ClusterIP"}Service configuration for health, readiness, metrics, and optional UI access.
service.enabledbooltrueCreate a ClusterIP Service for the admin/health port.
service.typestring"ClusterIP"Kubernetes Service type.
service.portint8080Service port exposed by the pod.
service.annotationsobject{}Annotations added to the Service.
podDisruptionBudgetobject{"enabled":true,"maxUnavailable":"","minAvailable":1}PodDisruptionBudget settings.
podDisruptionBudget.enabledbooltrueCreate a PodDisruptionBudget.
podDisruptionBudget.minAvailableint1Minimum number/percentage of pods that should remain available.
podDisruptionBudget.maxUnavailablestring""Maximum number/percentage of pods that may be unavailable.
resourcesobject{"limits":{"memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}CPU and memory requests/limits for the container.
credentialsobject{"apiKey":"","createSecret":false,"existingSecretName":"","secretKey":"control-plane-api-key"}Secret-backed control plane credentials.
credentials.createSecretboolfalseCreate a Secret from values in this chart instead of referencing an existing one.
credentials.existingSecretNamestring""Existing Secret name containing the runtime API key.
credentials.secretKeystring"control-plane-api-key"Secret key containing the runtime API key.
credentials.apiKeystring""Runtime API key value written to the generated Secret.
controlPlaneobject{"baseUrl":"","tunnelId":"","urlPath":""}OpenAI control plane settings.
controlPlane.tunnelIdstring""Tunnel ID created in the OpenAI tunnels management UI or API.
controlPlane.baseUrlstring""Optional override for the control plane base URL. Leave empty to let tunnel-client use its built-in default (https://api.openai.com).
controlPlane.urlPathstring""Optional URL path prefix inserted before /v1/... routes, for example /workspace/dev/us behind an enterprise gateway.
mcpobject{"auth":{"discoveryExtraHeaders":{"createSecret":false,"existingSecretName":"","headers":{},"values":{}},"extraHeaders":{"createSecret":false,"existingSecretName":"","headers":{},"values":{}}},"bootstrap":{"enabled":false},"command":"","connectionMaxTTL":"10m","maxConcurrentRequests":10,"serverUrl":"","startupWaitTimeout":"5m"}Upstream MCP configuration. Set either serverUrl or command.
mcp.bootstrap.enabledboolfalseStart tunnel-client with the built-in stub MCP so the tunnel can come up before a real MCP backend is available. When mcp.serverUrl and mcp.command are both empty, the chart falls back to this stub automatically.
mcp.serverUrlstring""URL of the private MCP server reachable from the pod.
mcp.commandstring""Command to launch a local stdio MCP server. stdio does not support MCP sessions.
mcp.auth.extraHeaders.existingSecretNamestring""Existing Secret whose keys contain complete header values such as Bearer ....
mcp.auth.extraHeaders.createSecretboolfalseCreate the Secret from values in this chart.
mcp.auth.extraHeaders.valuesobject{}Secret data written when createSecret=true. Each key becomes one mounted file.
mcp.auth.discoveryExtraHeaders.existingSecretNamestring""Existing Secret whose keys contain complete discovery/probe header values.
mcp.auth.discoveryExtraHeaders.createSecretboolfalseCreate the Secret from values in this chart.
mcp.auth.discoveryExtraHeaders.valuesobject{}Secret data written when createSecret=true. Each key becomes one mounted file.
mcp.startupWaitTimeoutstring"5m"Startup retry window for an unavailable HTTP MCP endpoint. Keep the startup probe budget longer than this duration.
mcp.connectionMaxTTLstring"10m"Maximum lifetime of an upstream MCP connection.
mcp.maxConcurrentRequestsint10Maximum number of concurrent upstream MCP requests.
logobject{"format":"json","level":"info"}Runtime logging configuration.
log.levelstring"info"Tunnel client log level.
log.formatstring"json"Tunnel client log format.
healthobject{"allowRemoteUI":false,"listenAddr":":8080","openWebUI":false}Health and admin UI settings.
health.listenAddrstring":8080"Listen address for /healthz, /readyz, /metrics, and /ui.
health.allowRemoteUIboolfalseAllow remote clients to reach /ui and log endpoints.
health.openWebUIboolfalseOpen the embedded web UI automatically on startup.
extraArgslist[]Additional command-line arguments appended to tunnel-client run.
extraEnvlist[]Additional environment variables appended to the container.
extraEnvFromlist[]Additional envFrom entries appended to the container.
extraVolumeMountslist[]Additional volume mounts appended to the container.
extraVolumeslist[]Additional volumes appended to the pod.
serviceMonitorobject{"enabled":false,"interval":"30s","labels":{},"path":"/metrics","scrapeTimeout":"10s"}Prometheus Operator ServiceMonitor configuration.
serviceMonitor.enabledboolfalseCreate a ServiceMonitor when the CRD is available.
serviceMonitor.pathstring"/metrics"Metrics path scraped by Prometheus.
serviceMonitor.labelsobject{}Additional labels added to the ServiceMonitor.
serviceMonitor.intervalstring"30s"Prometheus scrape interval.
serviceMonitor.scrapeTimeoutstring"10s"Prometheus scrape timeout.
startupProbeobject{"failureThreshold":36,"httpGet":{"path":"/readyz","port":"http"},"periodSeconds":10,"timeoutSeconds":5}Startup

Deploy openai-mcp-tunnel with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has openai-mcp-tunnel on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartopenai-mcp-tunnel is pinned at v0.2.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply