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, andargocd - node-aware kubeconfig selection through
K8S_NODE_PREFIX_MAPPING run_checkup_on_nodeforkubectl node-shell ... checkup -nget_logs_on_nodefor collectingdmesg,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
When installing from PyPI, you can use the package-matched command name k8s-mcp-extension.
The legacy k8s-mcp-server command remains available for backward compatibility.
{
"mcpServers": {
"k8s-server": {
"command": "k8s-mcp-extension",
"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
After installing the package, either console script works:
k8s-mcp-extension
k8s-mcp-server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file k8s_mcp_extension-0.1.1.tar.gz.
File metadata
- Download URL: k8s_mcp_extension-0.1.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09129c3be5d9f947ebed5282df6a155f2a7daef7c90f3a317c8abe8b888493fb
|
|
| MD5 |
d012cac0cb6d0129a5f84957f95d0bdd
|
|
| BLAKE2b-256 |
4622c6ab2fc6d3e9fe0e469cb841f92fa397a935ba47c398f8f99c16a9947331
|
Provenance
The following attestation bundles were made for k8s_mcp_extension-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on CzSadykov/k8s_mcp_extension
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
k8s_mcp_extension-0.1.1.tar.gz -
Subject digest:
09129c3be5d9f947ebed5282df6a155f2a7daef7c90f3a317c8abe8b888493fb - Sigstore transparency entry: 1318680689
- Sigstore integration time:
-
Permalink:
CzSadykov/k8s_mcp_extension@140620c8ee0f7b6fb22b2ff2e20517546afd5336 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/CzSadykov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@140620c8ee0f7b6fb22b2ff2e20517546afd5336 -
Trigger Event:
release
-
Statement type:
File details
Details for the file k8s_mcp_extension-0.1.1-py3-none-any.whl.
File metadata
- Download URL: k8s_mcp_extension-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16694a6f072f982e7b231559c8bfefa9eabafdab72537fdbf138dc2e7a2ce0b3
|
|
| MD5 |
1df24c8b72d882eede1835f9c1b62824
|
|
| BLAKE2b-256 |
449d72259f964fd64d77beaad9c4f949806ee53874979c999f47ca0e8bc974c3
|
Provenance
The following attestation bundles were made for k8s_mcp_extension-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on CzSadykov/k8s_mcp_extension
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
k8s_mcp_extension-0.1.1-py3-none-any.whl -
Subject digest:
16694a6f072f982e7b231559c8bfefa9eabafdab72537fdbf138dc2e7a2ce0b3 - Sigstore transparency entry: 1318680838
- Sigstore integration time:
-
Permalink:
CzSadykov/k8s_mcp_extension@140620c8ee0f7b6fb22b2ff2e20517546afd5336 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/CzSadykov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@140620c8ee0f7b6fb22b2ff2e20517546afd5336 -
Trigger Event:
release
-
Statement type: