mt-mcp-proxy

by loafoe

Helm chartv0.5.0App 0.3.3

A generic multi-tenant JWT/OIDC auth gateway that fronts any streamable-HTTP MCP server (e.g. github-mcp-server, mcp-grafana) with group-based tenant routing and per-tenant credential injection.

About this chart

mt-mcp-proxy

A generic multi-tenant JWT/OIDC auth gateway that fronts any streamable-HTTP MCP server (e.g. github-mcp-server, mcp-grafana) with group-based tenant routing and per-tenant credential injection.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity
authobject{"additionalAudiences":[],"audience":"mt-mcp-proxy","groupsClaim":"groups","issuer":"https://issuer.company.com","jwksUrl":"","mode":"jwks","publicKeyPemFile":""}Authentication for incoming client/LLM JWTs
auth.additionalAudienceslist[]Extra acceptable audiences beyond audience
auth.audiencestring"mt-mcp-proxy"Expected audience (aud)
auth.groupsClaimstring"groups"JWT claim holding the caller's groups
auth.issuerstring"https://issuer.company.com"Expected issuer (iss)
auth.jwksUrlstring""Optional explicit JWKS URL (if omitted, discovered via OIDC metadata)
auth.modestring"jwks"JWT verification mode: jwks
auth.publicKeyPemFilestring""Static mode credentials (only when auth.mode is "static") hmacSecret: "my-hmac-shared-key" publicKeyPemFile mounted at /etc/mt-mcp-proxy/keys/public.pem if set
backendMetricsobject{"enabled":false,"path":"/metrics","port":9090,"serviceMonitor":{"enabled":false,"interval":"30s","labels":{},"metricRelabelings":[],"namespace":"","relabelings":[],"scrapeTimeout":"10s"}}Metrics for MANAGED backend pods (external backends are scraped by whoever runs them). Applies uniformly to every managed backend in the backends list — matches mt-mcp-grafana's single global block; no evidence different backends need different metrics ports/paths.
backendMetrics.enabledboolfalseEnable a metrics container port + env on managed backends
backendMetrics.pathstring"/metrics"Path managed backends serve metrics on
backendMetrics.portint9090Port managed backends serve Prometheus metrics on
backendMetrics.serviceMonitor.enabledboolfalseEnable ServiceMonitor creation for managed-backend metrics
backendMetrics.serviceMonitor.intervalstring"30s"Scrape interval
backendMetrics.serviceMonitor.labelsobject{}Additional labels for ServiceMonitor discovery
backendMetrics.serviceMonitor.metricRelabelingslist[]Metric relabeling rules applied after scraping
backendMetrics.serviceMonitor.namespacestring""Namespace for the ServiceMonitor (defaults to release namespace)
backendMetrics.serviceMonitor.relabelingslist[]Relabeling rules applied before scraping
backendMetrics.serviceMonitor.scrapeTimeoutstring"10s"Scrape timeout
backendslist[{"credentialHeader":"Authorization","credentialScheme":"Bearer","credentialSecret":{"create":false,"key":"token","name":"","value":""},"externalUrl":"","headers":{},"managed":{"args":["http"],"command":[],"configFile":{"content":"","enabled":false,"fileName":"config.yaml","mountPath":"/etc/mt-mcp-proxy/backend-config"},"credentialEnvVar":"","enabled":true,"env":{},"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/github/github-mcp-server","tag":"latest"},"path":"/","port":8082,"resources":{},"secretEnv":[]},"name":"github","protocolVersion":"","tenants":[{"credentialSecret":{"create":false,"key":"token","name":"github-pat-platform","value":""},"groups":["platform-eng"],"headers":{"X-MCP-Toolsets":"repos,issues,pull_requests"},"id":"team-platform"},{"credentialSecret":{"create":false,"key":"token","name":"github-pat-data","value":""},"groups":["data-eng"],"headers":{"X-MCP-Readonly":"true"},"id":"team-data"}]}]The downstream MCP backends this deployment fronts. Each entry is either MANAGED (the chart deploys a Deployment+Service for it) or EXTERNAL (you point at an already-running streamable-HTTP MCP server). One deployment can front multiple backends of the same product (e.g. several Grafana instances) or, by convention, a single product.
backends[0].credentialHeaderstring"Authorization"How the credential is injected downstream. Defaults suit github-mcp-server (Authorization: Bearer ). For an API-key backend set e.g. credentialHeader: X-Api-Key and credentialScheme: "".
backends[0].credentialSecretobject{"create":false,"key":"token","name":"","value":""}Backend-level credential (optional). Used as the downstream token when a tenant of this backend does not supply its own credentialSecret (e.g. github: each tenant has its own PAT, so this is usually empty; a Grafana backend: one SA token shared by that backend's tenant(s), so this is set and per-tenant credentialSecret is omitted). Provided via a Secret so it never lands in the rendered ConfigMap.
backends[0].credentialSecret.createboolfalseHave the chart create the Secret inline from value (dev/testing)
backends[0].credentialSecret.keystring"token"Key in the Secret
backends[0].credentialSecret.namestring""Secret name holding this backend's credential (empty = none)
backends[0].credentialSecret.valuestring""Raw credential (only used when create is true)
backends[0].externalUrlstring""External backend URL (used only when managed.enabled is false), e.g. "http://github-mcp-server.example.svc:8082/".
backends[0].headersobject{}Optional static headers sent toward this backend on every request
backends[0].managedobject{"args":["http"],"command":[],"configFile":{"content":"","enabled":false,"fileName":"config.yaml","mountPath":"/etc/mt-mcp-proxy/backend-config"},"credentialEnvVar":"","enabled":true,"env":{},"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/github/github-mcp-server","tag":"latest"},"path":"/","port":8082,"resources":{},"secretEnv":[]}Managed backend: when enabled, the chart deploys the downstream MCP server (a Deployment + Service) and wires the proxy to it via in-cluster DNS. When disabled, set externalUrl to a pre-existing streamable-HTTP MCP endpoint (the proxy routes directly to it; nothing is deployed). SECURITY: an external/managed backend has NO inbound auth of its own — it must be reachable only from the proxy (NetworkPolicy / cluster- internal), since anyone who can reach it bypasses the proxy's JWT verification.
backends[0].managed.commandlist[]Command/args to launch the backend in streamable-HTTP mode. github-mcp-server: http serves MCP at / on :8082.
backends[0].managed.configFileobject{"content":"","enabled":false,"fileName":"config.yaml","mountPath":"/etc/mt-mcp-proxy/backend-config"}Optional file-based config for backends that require a config file rather than plain env vars (e.g. mcp-notifier's YAML webhook config). Renders a ConfigMap and mounts it read-only at mountPath/fileName. The file content may reference ${ENV_VAR} placeholders - Kubernetes does NOT expand these, the backend binary must (mcp-notifier does, via os.Expand against its own env). Combine with env above (for the file path env var, if the backend needs one) and credentialEnvVar/tenant credentialSecret (for the secret-backed values the file's placeholders resolve to).
backends[0].managed.credentialEnvVarstring""If this backend needs its OWN upstream credential injected as an env var (as opposed to the proxy injecting it as a header toward github-mcp-server), set the env var name the binary expects here, e.g. "GRAFANA_SERVICE_ACCOUNT_TOKEN" for grafana/mcp-grafana. The value comes from this backend's credentialSecret (below). Leave empty for backends like github-mcp-server that take no credential of their own (the proxy is the one authenticating to them).
backends[0].managed.enabledbooltrueDeploy the downstream MCP server as part of this release
backends[0].managed.envobject{}Env vars for the backend container (e.g. GITHUB_HOST for GHES). Do NOT put per-tenant tokens here — those are injected per request by the proxy.
backends[0].managed.image.repositorystring"ghcr.io/github/github-mcp-server"Downstream MCP server image (default: github-mcp-server)
backends[0].managed.pathstring"/"Path this managed backend's MCP endpoint is served on. github-mcp-server (the default) serves at root; other backends (e.g. mcp-grafana) serve at a sub-path like "/mcp". Defaults to "/" (root) to preserve today's behavior for backends that don't set this.
backends[0].managed.portint8082Container port the backend's MCP endpoint listens on
backends[0].managed.secretEnvlist[]Additional secret-backed env vars beyond the single credentialEnvVar/credentialSecret pair above, for backends that need more than one secret injected as an env var (e.g. mcp-notifier needs a Slack AND a Teams webhook URL). Each entry creates one env var sourced from an existing Secret - these secrets are NOT created by this chart, create them out-of-band.
backends[0].namestring"github"Internal/ops name (logging, DNS of the managed backend service). Must be unique across all entries in this list.
backends[0].protocolVersionstring""MCP revision spoken toward this backend. Defaults to "2025-03-26" (stateful: initialize handshake + Mcp-Session-Id). Set to "2026-07-28" for a backend that speaks the stateless revision (e.g. github-mcp-server http >= v1.12.2) — the proxy then skips initialize entirely.
backends[0].tenantslist[{"credentialSecret":{"create":false,"key":"token","name":"github-pat-platform","value":""},"groups":["platform-eng"],"headers":{"X-MCP-Toolsets":"repos,issues,pull_requests"},"id":"team-platform"},{"credentialSecret":{"create":false,"key":"token","name":"github-pat-data","value":""},"groups":["data-eng"],"headers":{"X-MCP-Readonly":"true"},"id":"team-data"}]Tenants this backend serves. Model: groups authorize, tenant selects, backend executes. Each tenant's id is advertised via list_instances and is the tenant tool-argument value; its groups gate access; its credential (if set) overrides the backend-level credential above for calls routed to this tenant.
backends[0].tenants[0].credentialSecretobject{"create":false,"key":"token","name":"github-pat-platform","value":""}Per-tenant credential override (optional). Omit name to fall back to the backend-level credentialSecret above.
backends[0].tenants[0].groupslist["platform-eng"]JWT groups authorized to select this tenant
backends[0].tenants[0].headersobject{"X-MCP-Toolsets":"repos,issues,pull_requests"}Optional per-tenant headers (merge over backend headers)
backends[0].tenants[0].idstring"team-platform"Globally unique tenant id (routing key) across ALL backends
environmentConfig.managedBystring""
environmentConfig.ownerstring""
fullnameOverridestring""Override the fully qualified name of the chart
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"ghcr.io/loafoe/mt-mcp-proxy"Registry repository for the mt-mcp-proxy image
image.tagstring"v0.3.0"Image tag (the release workflow publishes ghcr.io/loafoe/mt-mcp-proxy:)
metricsobject{"enabled":true,"path":"/metrics","port":9090}Prometheus metrics on a SEPARATE listener (isolated from the /mcp data plane).
metrics.enabledbooltrueEnable the metrics listener (adds container/service port + config block)
metrics.pathstring"/metrics"Path the metrics endpoint is served on
metrics.portint9090Port the proxy serves Prometheus metrics on
nameOverridestring""Override the name of the chart
nodeSelectorobject{}Node selectors
replicaCountint1Number of proxy replicas (sessions are in-memory; use sticky routing with >1)
resourcesobject{}Proxy pod resources
server.pathstring"/mcp"Exposed MCP endpoint path
server.portint8080Port the proxy listens on inside the container
service.portint8080Service port
service.typestring"ClusterIP"Kubernetes Service type for exposing the proxy
serviceMonitorobject{"enabled":false,"interval":"30s","labels":{},"namespace":"","scrapeTimeout":"10s"}ServiceMonitor for Prometheus Operator scraping of the proxy metrics port
serviceMonitor.enabledboolfalseEnable ServiceMonitor creation (requires the Prometheus Operator CRDs)
serviceMonitor.intervalstring"30s"Scrape interval
serviceMonitor.labelsobject{}Additional labels for ServiceMonitor discovery (e.g. release: kube-prometheus-stack)
serviceMonitor.namespacestring""Namespace for the ServiceMonitor (defaults to release namespace)
serviceMonitor.scrapeTimeoutstring"10s"Scrape timeout
tolerationslist[]Tolerations
tracingobject{"enableOnBackends":false,"enabled":false,"endpoint":"http://otel-collector:4317","extraEnv":{},"serviceName":"mt-mcp-proxy"}OpenTelemetry tracing. Enabled inside the proxy only when OTEL_EXPORTER_OTLP_ENDPOINT is set. The proxy always injects W3C traceparent on backend calls, so setting OTEL_* on the backend correlates traces.
tracing.enableOnBackendsboolfalseAlso set OTEL_* env on managed backend pods so they join the proxy's trace. OTEL_SERVICE_NAME is derived per backend (-backend).
tracing.enabledboolfalseEnable tracing by settin

Deploy mt-mcp-proxy with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mt-mcp-proxy 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 chartmt-mcp-proxy is pinned at v0.5.0 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