kube-MCP
A Model Context Protocol server for Kubernetes that provides full resource coverage and advanced troubleshooting tools via HTTP chunked streaming. It enables users to manage clusters and diagnose complex issues like pod crashloops through specialized prompts and standard kubectl-like operations.
README
MCP Kubernetes Server
A Model Context Protocol (MCP) server for Kubernetes, supporting chunked HTTP streaming, advanced troubleshooting prompts, and full Kubernetes resource/tool coverage.
Prerequisites
- Node.js v18+ (for local dev/build)
- Docker (for containerization)
- Access to a Kubernetes cluster (AKS, EKS, GKE, or local)
kubectlconfigured (for testing and kubeconfig management)
1. Build and Run Locally
npm install
npm run build
MCP_TRANSPORT=http-chunked npm start
- By default, the server uses your local kubeconfig (
~/.kube/configorC:\Users\<username>\.kube\config). - To use a custom kubeconfig, set the
KUBECONFIGenvironment variable:export KUBECONFIG=/path/to/your/kubeconfig npm start
2. Dockerize the MCP Server
Build the Docker image
docker build -t yourrepo/mcp-server:latest .
Push to your registry
docker push yourrepo/mcp-server:latest
3. Deploy on Kubernetes (AKS, EKS, GKE)
Edit the image name in k8s-mcp-server.yaml:
Replace yourrepo/mcp-server:latest with your image name.
Apply the manifest
kubectl apply -f k8s-mcp-server.yaml
- This creates a namespace, ServiceAccount, RBAC, Deployment, and Service.
- By default, the Service is
ClusterIP(internal). Change toLoadBalancerorNodePortfor external access.
4. Using the MCP Server
HTTP Chunked Endpoint
- The server exposes
/call-tool-chunkedon port 3000. - Example (using
curl):curl -X POST http://<server-ip>:3000/call-tool-chunked \ -H "Content-Type: application/json" \ -d '{"name": "get_pods", "args": {"namespace": "default"}}' - The response will stream progress and results as JSON lines.
Using Prompts
- To use a prompt, POST to
/call-tool-chunkedwith the prompt name, e.g.:curl -X POST http://<server-ip>:3000/call-tool-chunked \ -H "Content-Type: application/json" \ -d '{"name": "k8s-pod-crashloop-diagnose", "args": {"podName": "my-pod", "namespace": "default"}}'
5. Kubeconfig and Permissions
- The MCP server uses the kubeconfig available in the container (default:
/root/.kube/config). - For in-cluster deployments, it uses the ServiceAccount and RBAC provided in the manifest.
- To use a custom kubeconfig, mount it as a secret and update the Deployment (see commented lines in the manifest).
6. Security Notes
- Do not expose the MCP server to the public internet without authentication and TLS.
- Use network policies, firewalls, or VPNs to restrict access.
- Use least-privilege RBAC for the ServiceAccount.
7. Extending and Customizing
- Add new tools, resources, or prompts in the
src/directory. - Rebuild and redeploy the Docker image after making changes.
8. Troubleshooting
- Check logs with
kubectl logs -n mcp-server deploy/mcp-server. - Ensure the ServiceAccount has the required permissions for your use case.
- For local testing, ensure your kubeconfig is valid and has cluster access.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.