The MCP Kubernetes Server is a powerful tool designed to manage Kubernetes clusters through interactions with Large Language Models (LLMs). It leverages the Model Context Protocol (MCP) to provide a structured and seamless interface for Kubernetes operations. This server wraps kubectl
commands, allowing users to perform common Kubernetes tasks with ease.
Model Context Protocol (MCP) is a framework that enables Language Models to interact with external tools and services in a structured way. It provides:
Here are some examples of how you can use the MCP Kubernetes Server:
nginx-app
and image nginx:latest
in the production
namespace with 3 replicas.nginx-app
to version 1.19
in the production
namespace.nginx-app
to 5 replicas in the production
namespace.production
namespace.This MCP client is designed to work seamlessly with Large Language Models (LLMs). The functions are decorated with @mcp.tool()
, making them accessible to LLMs through the Model Context Protocol framework.
LLMs can interact with your Kubernetes cluster using natural language. Here are some example prompts:
The LLM will interpret these natural language requests and call the appropriate MCP functions with the correct parameters.
kubectl
syntaxkubectl
When using this client with LLMs, ensure that:
{
"mcpServers": {
"Kubernetes": {
"command": "uv",
"args": [
"--directory",
"~/mcp/mcp-k8s-server",
"run",
"kubernetes.py"
]
}
}
}
We welcome contributions to the MCP Kubernetes Server! If you'd like to contribute:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)For major changes, please open an issue first to discuss what you would like to change.
This is an MCP Kubernetes Server.
No releases published
No packages published