Skip to main content

MCP server for Kubernetes command execution, node inspection, and diagnostics

Project description

K8s MCP Server

MCP server for Kubernetes command execution, node inspection, and node-level diagnostics. Extension of k8s-mcp-server by alexei-led.

Features

  • validated wrappers around kubectl, helm, istioctl, and argocd
  • node-aware kubeconfig selection through K8S_NODE_PREFIX_MAPPING
  • run_checkup_on_node for kubectl node-shell ... checkup -n
  • get_logs_on_node for collecting dmesg, journalctl, /var/log/*, and /var/crash
  • Kubernetes node inspection tools for status, labels, pods, and resources

Configuration

Set K8S_NODE_PREFIX_MAPPING to a JSON object that maps a node prefix to a kubeconfig file name:

{
  "node-a": "cluster-a.config",
  "edge": "edge-cluster.config"
}

The kubeconfig files are resolved relative to K8S_KUBECONFIG_DIR, which defaults to ~/.kube.

Example MCP Client Configuration

{
  "mcpServers": {
    "k8s-server": {
      "command": "k8s-mcp-server",
      "cwd": "/absolute/path/to/project",
      "env": {
        "K8S_KUBECONFIG_DIR": "/path/to/.kube",
        "K8S_NODE_PREFIX_MAPPING": "{\"node-a\": \"cluster-a.config\", \"edge\": \"edge-cluster.config\"}",
        "K8S_MCP_TIMEOUT": "600"
      }
    }
  }
}

Development

Create the environment and run checks:

uv sync --extra dev
.venv/bin/python -m pytest
.venv/bin/python -m ruff check

Run the server locally:

.venv/bin/python -m k8s_mcp_server

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k8s_mcp_extension-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k8s_mcp_extension-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file k8s_mcp_extension-0.1.0.tar.gz.

File metadata

  • Download URL: k8s_mcp_extension-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for k8s_mcp_extension-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac24017af76ae370129d0591d926a05c137b319f0cbca35a0b3e74b90ecc63c6
MD5 c4dfb2345f3079f4f2de2aa8fecacd00
BLAKE2b-256 3d9533e930d901eb88d141812370cc9f2e913028f0ec7bd0b5d92c5d4b35e55e

See more details on using hashes here.

Provenance

The following attestation bundles were made for k8s_mcp_extension-0.1.0.tar.gz:

Publisher: publish-pypi.yml on CzSadykov/k8s_mcp_extension

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file k8s_mcp_extension-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for k8s_mcp_extension-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9466c75fbfc7507ac7e903480adc28241345742e7e37949c2473ed673030e0ba
MD5 c6b6b0d26be72f1abc8d8caea4ee7960
BLAKE2b-256 69e0602d56f7bc48f90142f349480750575f12e13ef6285e796ae1879e600312

See more details on using hashes here.

Provenance

The following attestation bundles were made for k8s_mcp_extension-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on CzSadykov/k8s_mcp_extension

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page