Kubernetes Ephemeral Job logo

Kubernetes Ephemeral Job

Runs allowlisted commands in temporary Kubernetes pods and returns logs, exit status, and inline artifacts.

Install Kubernetes Ephemeral Job

Run the project’s own setup commands, in order.

Setup steps from the project

Kubernetes Ephemeral Job installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Start the server
    docker run --rm -i \
      -v "$HOME/.kube:/kube:ro" \
      -e MCP_K8S_KUBECONFIG=/kube/config \
      -e MCP_K8S_NAMESPACE=ephemeral-dev \
      -e MCP_K8S_ALLOWED_IMAGES=busybox:1.36,python:3.12-slim \
      idconstruct/mcp-k8s-ephemeral-job:latest
    
  2. 2. Install
    go build -o mcp-k8s-ephemeral-job ./cmd/mcp-k8s-ephemeral-job
    
  3. 3. Start the server
    ./mcp-k8s-ephemeral-job
    

Overview

Kubernetes Ephemeral Job MCP server creates a short-lived Kubernetes Job from caller-supplied parameters, runs a command in the selected container image, and returns its status, output, and artifacts. It supports synchronous execution with `run_job` and background execution through `submit_job` and `fetch_job`. The server can also check out a repository into the pod before running a command when clone support is configured. Reach for it when an agent needs a Kubernetes-backed toolchain, controlled network access, longer-running work, or files produced by the job.

Use cases

  • Run builds or test suites in a selected container image
  • Generate files and return them as inline artifacts
  • Clone a repository and execute a command against its contents
  • Start long-running jobs without blocking the agent
  • Execute dependency-installing tasks with namespace-controlled network access

Key features

  • Synchronous and asynchronous Kubernetes job execution
  • Allowlisted container images with caller-selected commands
  • Inline base64 artifacts with truncation indicators
  • Optional repository checkout with isolated credentials
  • stdio, HTTP, and SSE transports
  • Ephemeral pods with namespace-scoped execution controls

Tools9

What Kubernetes Ephemeral Job lets your agent do. Expand a tool for its parameters.

Self-reported~16 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

11/11 checks healthy over the last 41d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit4mo agoMost recent push to the default branch.
Tools exposed9Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Kubernetes Ephemeral Job works

What Kubernetes Ephemeral Job MCP server does

Kubernetes Ephemeral Job MCP server lets an MCP client execute commands in fresh, temporary Kubernetes pods. The caller supplies an allowed container image and command, with optional input files, environment variables, resource settings, timeout, working directory, and repository-clone options. The server constructs the pod manifest itself, so callers provide parameters rather than raw Kubernetes YAML.

Each result includes an exit code, combined container output, duration, status, and any files collected from the working directory. Status values distinguish successful execution, command failure, timeout, and server-side errors. A non-zero exit code is returned as a normal job result rather than as an MCP tool error.

How it works

run_job waits for completion. For longer work, submit_job starts the job and immediately returns a token; fetch_job later retrieves the result. While execution continues, fetch_job reports running and can long-poll for up to 120 seconds. Completed results remain available for 60 minutes and may be fetched repeatedly. Tokens are held in memory, so a server restart requires pending work to be submitted again.

The pod is removed after success, failure, or timeout. Kubernetes logs provide combined stdout and stderr, so the returned stderr field is reserved and empty. Artifacts are encoded inline and subject to a total size limit; the corresponding truncation indicator identifies capped output.

When configured, the clone option adds an init container that checks out a repository and optional ref or subdirectory before the main command runs. Git credentials are mounted only for the cloner, and the server masks the token in the checked-out configuration before the main container starts.

Setup and configuration

Run the published container with access to a kubeconfig, a target namespace, and a non-empty image allowlist, or build the Go binary and point it at a development cluster. The server supports stdio, HTTP, and SSE transports; stdio is the default. HTTP and SSE listen on the configured address and can require an X-MCP-AUTH header when MCP_K8S_AUTH_TOKEN is set.

For production, the documented deployment model is an in-cluster Deployment with a ServiceAccount, namespace-scoped Role and RoleBinding, and namespace ResourceQuota and LimitRange. An optional NetworkPolicy controls egress. Clone support requires both a clone image and clone secret configuration.

Tools and capabilities

  • run_job: execute and wait for a command.
  • submit_job: start asynchronous execution and return a job token.
  • fetch_job: retrieve a running or completed asynchronous job.
  • Supply files as base64 content for the working directory.
  • Set command environment variables, working directory, timeout, and resource limits.
  • Return generated files as inline base64 artifacts.
  • Clone a repository before execution when operator configuration enables it.

Limitations and notes

Kubernetes Ephemeral Job MCP server requires an image to pass the strict allowlist; an empty allowlist permits nothing to run. The server has namespace-scoped permissions and creates pods, making tool-policy controls important when exposing it to agents. Pods retain network access unless deployment-level NetworkPolicy rules restrict egress.

The server does not persist or fully log caller commands, input files, output, or artifacts. Output and artifact size caps can mark returned data as truncated. Default CPU and memory values are pod requests; resource limits come from the caller when supplied or from the namespace LimitRange. A concurrency cap, wall-clock timeout, quota, and pod cleanup controls the execution environment.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Kubernetes Ephemeral Job

Kubernetes Ephemeral Job is an MCP server that connects AI clients to a Kubernetes namespace and runs commands in temporary, allowlisted pods. Its main tools are `run_job` for synchronous execution, plus `submit_job` and `fetch_job` for background jobs. Results include status, exit code, combined output, and inline artifacts.

Run the published Docker image or build the Go binary from source. Configure Kubernetes access, `MCP_K8S_NAMESPACE`, and `MCP_K8S_ALLOWED_IMAGES`, then select stdio, HTTP, or SSE through `MCP_K8S_TRANSPORT`. Production deployments use an in-cluster ServiceAccount with a namespace-scoped Role and RoleBinding.

Use `submit_job` to start execution and save its returned `job_token`, then call `fetch_job` to collect the result. Pass `wait_s` to long-poll for up to 120 seconds. Results remain available for 60 minutes, but a server restart removes pending in-memory tokens.

Yes, if the operator configures `MCP_K8S_CLONE_IMAGE` and `MCP_K8S_CLONE_SECRET`. Pass the repository URL, ref, and optional subdirectory in the `clone` field. Credentials are mounted only in the clone init container and are not exposed to the main container.

Yes. Configure Cursor with the server's selected transport and provide the required Kubernetes configuration and image allowlist.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewKubernetes Ephemeral Job AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/kubernetes-ephemeral-job?style=directory)](https://allmcps.com/mcp/kubernetes-ephemeral-job)
HTML Embed
<a href="https://allmcps.com/mcp/kubernetes-ephemeral-job"><img src="https://allmcps.com/api/badge/kubernetes-ephemeral-job?style=directory" alt="Kubernetes Ephemeral Job on AllMCPs" /></a>