io.github.inhuman

mcp-k8s-ephemeral-job

Kubernetes Ephemeral Job

Runs a command in a throwaway Kubernetes pod and returns exit code, output and artifacts.

stdiocommunityapplication

Package Details

docker.io/idconstruct/mcp-k8s-ephemeral-job:v0.7.1

Transportstdio
Runtimedocker

Runtime Arguments

Named
--volume
{kubeconfig_dir}:/kube:roMount the kubeconfig directory read-only so the server can reach the cluster.
--read-only
Read-only root filesystem — the server writes nothing locally.
--cap-drop
ALLDrop all Linux capabilities.
--security-opt
no-new-privilegesBlock privilege escalation.
--memory
256mMemory limit for the server process itself.

Environment Variables

MCP_K8S_ALLOWED_IMAGES
Required

Strict image allowlist (CSV). Empty means every call is rejected, so this must be set.

MCP_K8S_KUBECONFIG
Default:/kube/config

Path to the kubeconfig inside the container. Empty = use in-cluster credentials.

MCP_K8S_NAMESPACE
Default:mcp-ephemeral

Namespace the ephemeral pods are created in. Needs a Role/RoleBinding for jobs and pods.

MCP_K8S_TRANSPORT
Default:stdio

MCP transport: stdio | http | sse. Must be 'stdio' for direct docker/stdio use.

MCP_K8S_DEFAULT_TIMEOUT_S
Default:60

Default wall-clock timeout per job, seconds.

MCP_K8S_MAX_TIMEOUT_S
Default:600

Maximum wall-clock timeout a caller may request, seconds.

MCP_K8S_MAX_OUTPUT_BYTES
Default:1048576

Cap on combined stdout/stderr before truncation.

MCP_K8S_MAX_ARTIFACT_BYTES
Default:10485760

Cap on the total size of returned artifacts.

MCP_K8S_MAX_CONCURRENT
Default:10

Maximum ephemeral pods running at the same time.

MCP_K8S_DEFAULT_CPU
Default:1

Pod CPU request; limits come from the caller or the namespace LimitRange.

MCP_K8S_DEFAULT_MEMORY
Default:512Mi

Pod memory request; limits come from the caller or the namespace LimitRange.

MCP_K8S_SIDECAR_IMAGE
Default:busybox:1.36

Helper image used to inject input files and collect artifacts.

MCP_K8S_CLONE_IMAGE

Image carrying git for the clone init container. Empty disables the clone field.

MCP_K8S_CLONE_SECRET
Secret

Secret with git tokens, mounted only on the cloner. Empty disables the clone field.

MCP_K8S_CACHE_PVC

Existing PVC mounted into every job pod as a shared cache. Empty = no cache.

MCP_K8S_CACHE_MOUNT_PATH

Where the cache PVC is mounted, e.g. /go/pkg/mod. Empty = no cache.

MCP_K8S_JOB_EXTRA_ENV

JSON object of env vars added to every job pod; caller keys win on collision.

MCP_K8S_AUTH_TOKEN
Secret

Optional X-MCP-AUTH token required on every request (http/sse transports only).