Mkp logo

Mkp

by StacklokLabs

Connects MCP clients to Kubernetes for resource discovery, inspection, updates, pod commands, and filtered output.

Install Mkp

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

Setup steps from the project

StacklokLabs/mkp 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. Install
    git clone https://github.com/StacklokLabs/mkp.git
    
  2. 2. Run
    cd mkp
    
  3. 3. Install
    task install
    
  4. 4. Install
    task build
    
  5. 5. Start the server
    task run
    
  6. 6. Start the server
    KUBECONFIG=/path/to/kubeconfig task run-with-kubeconfig
    

Overview

StacklokLabs/mkp connects MCP-compatible applications directly to Kubernetes clusters. It exposes tools for listing, retrieving, and applying clustered or namespaced resources, including subresources such as status, scale, and logs. The server uses Kubernetes API machinery and unstructured resources, so it can work with custom resource definitions without hardcoded schemas. Reach for it when an agent needs controlled Kubernetes inspection or mutation without invoking kubectl or Helm.

Use cases

  • Inspect Kubernetes resources and subresources
  • List workloads with label selectors
  • Apply Kubernetes resources from an agent workflow
  • Retrieve bounded pod logs
  • Execute commands in running pods

Key features

  • Lists clustered and namespaced Kubernetes resources
  • Gets resource subresources such as status, scale, and logs
  • Creates or updates Kubernetes resources
  • Supports CRDs through the unstructured client
  • Filters annotations and labels in list results
  • Applies rate limiting to API calls

Tools16

What Mkp lets your agent do. Expand a tool for its parameters.

Self-reported~245 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.

29/30 checks healthy over the last 111d

Adoption & maintenance

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

GitHub stars59Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed16Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Mkp works

What StacklokLabs/mkp does

StacklokLabs/mkp gives MCP clients an interface to Kubernetes clusters. Agents can discover resource types supported by the API server, inspect individual objects, list resources, apply new or changed objects, and retrieve subresources such as status, scale, and pod logs. It also supports executing commands in pods with timeout control.

Operations cover both cluster-scoped and namespaced resources. Resource requests identify the API group, version, resource name, and, where applicable, namespace and object name. The implementation uses Kubernetes' unstructured client, allowing it to work with standard resources and Custom Resource Definitions without adding resource-specific handlers.

How it works

MKP communicates directly with the Kubernetes API server through Kubernetes API machinery. It does not depend on kubectl, Helm, or another command-line client. MCP tools translate requests into Kubernetes resource operations and return the results to the calling application.

Resource listings can use Kubernetes label selectors. Output metadata can be controlled with annotation options: annotations may be disabled, limited to selected keys, or filtered with exclusion patterns. The default behavior excludes the kubectl.kubernetes.io/last-applied-configuration annotation, and trailing wildcard patterns such as nvidia.com/* can exclude groups of keys.

Pod log requests accept options for container selection, previous instances, relative or absolute time ranges, timestamps, byte limits, and tail-line limits. Logs default to the last 100 lines and 32 KB to reduce context size; request parameters can override those limits. Built-in rate limiting helps restrict excessive API calls.

Setup and configuration

The project requires Go 1.24 or later, access to a Kubernetes cluster, and Task for its repository commands. A typical local setup clones the repository, runs task install, and builds with task build. task run starts the server using the default configuration.

Kubernetes configuration is selected in this order:

  1. The --kubeconfig command-line flag
  2. An in-cluster service account when running in Kubernetes
  3. Files listed by KUBECONFIG
  4. ~/.kube/config

KUBECONFIG=/path/to/kubeconfig task run-with-kubeconfig runs with a specified kubeconfig. MCP_PORT=9091 task run selects a listening port. MKP can also be deployed through ToolHive, including its UI, CLI, or Kubernetes operator.

If no Kubernetes configuration is available, the process can still advertise its tools, but calls fail until it is restarted with valid configuration. A missing or invalid explicitly selected kubeconfig causes startup failure.

Tools and capabilities

  • get_resource retrieves clustered or namespaced resources and subresources, including status, scale, and logs.
  • list_resources lists resources with optional namespace, label-selector, and annotation filtering.
  • apply_resource creates or updates clustered and namespaced resources.
  • Pod command execution supports timeout control.
  • Resource handling works with arbitrary Kubernetes types through unstructured objects, including CRDs.
  • Rate limiting provides protection against excessive API calls.

Limitations and notes

Operations depend on the Kubernetes identity and permissions used by the server. Requests for namespaced resources require a namespace, while cluster-scoped requests use the clustered resource type. Agents should account for the default pod-log limits and explicitly provide log parameters when they need more output. Applying resources changes cluster state, so deployment permissions and tool access should be assigned accordingly.

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 Mkp

StacklokLabs/mkp is an MCP server that connects LLM-powered applications to Kubernetes clusters through the Kubernetes API. Its main tools list resources, retrieve objects and subresources, apply clustered or namespaced resources, and support pod operations such as log retrieval and command execution.

Install it by cloning the repository, running `task install`, and building with `task build`. The project requires Go 1.24 or later, a Kubernetes cluster and kubeconfig, and Task. Start the built server with `task run`.

It checks the `--kubeconfig` flag first, then an in-cluster service account, files named by `KUBECONFIG`, and finally `~/.kube/config`. An explicitly supplied missing or invalid file causes startup failure.

Yes, `get_resource` retrieves pod logs through the logs subresource. Requests can select a container, include a previous instance, set time or byte limits, request timestamps, and choose the number of trailing lines. The default is 100 lines and 32 KB.

Use `list_resources` with `include_annotations`, `include_annotation_keys`, or `exclude_annotation_keys`. Including specific keys takes precedence, disabling annotations removes them, and exclusions support trailing-wildcard patterns such as `nvidia.com/*`.

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 PreviewMkp AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/stackloklabs-mkp?style=directory)](https://allmcps.com/mcp/stackloklabs-mkp)
HTML Embed
<a href="https://allmcps.com/mcp/stackloklabs-mkp"><img src="https://allmcps.com/api/badge/stackloklabs-mkp?style=directory" alt="Mkp on AllMCPs" /></a>