mcp-kubernetes-server
by feiskyer
A Model Context Protocol (MCP) server to enable Claude, Cursor and other AI tools to interact with Kubernetes cluster via kubectl. It allows AI tools to access and manage your Kubernetes resources.
View on GitHub
Last updated: N/A
mcp-kubernetes-server
A Model Context Protocol (MCP) server to enable Claude, Cursor and other AI tools to interact with Kubernetes cluster via kubectl.
How to install
Docker
Get your kubeconfig file for your Kubernetes cluster and setup in the mcpServers (replace src path with your kubeconfig path):
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/home/username/.kube/config,dst=/home/mcp/.kube/config",
"ghcr.io/feiskyer/mcp-kubernetes-server"
]
}
}
}
NPX
- Install uv and add it to your PATH, e.g. using curl:
# For Linux and MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh
- Install kubectl and add it to your PATH, e.g.
# For Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
# For MacOS
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"
- Config your MCP servers in Claude Desktop, Cursor, ChatGPT Copilot, Github Copilot and other supported AI clients, e.g.
{
"mcpServers": {
"kubernetes": {
"command": "uvx",
"args": [
"mcp-kubernetes-server"
],
"env": {
"KUBECONFIG": "<your-kubeconfig-path>"
}
}
}
}
Contribution
The project is opensource at github feiskyer/mcp-kubernetes-server with Apache License.
If you would like to contribute to the project, please follow these guidelines:
- Fork the repository and clone it to your local machine.
- Create a new branch for your changes.
- Make your changes and commit them with a descriptive commit message.
- Push your changes to your forked repository.
- Open a pull request to the main repository.
LICENSE
The project is licensed under the Apache License 2.0. See the LICENSE file for more details.