{"id":26775479,"url":"https://github.com/alexei-led/k8s-mcp-server","last_synced_at":"2026-02-14T11:18:17.232Z","repository":{"id":284932502,"uuid":"956054596","full_name":"alexei-led/k8s-mcp-server","owner":"alexei-led","description":"K8s-mcp-server is a Model Context Protocol (MCP) server that enables AI assistants like Claude to securely execute Kubernetes commands. It provides a bridge between language models and essential Kubernetes CLI tools including kubectl, helm, istioctl, and argocd, allowing AI systems to assist with cluster management, troubleshooting, and deployments","archived":false,"fork":false,"pushed_at":"2025-04-29T08:56:16.000Z","size":389,"stargazers_count":149,"open_issues_count":2,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-18T19:48:24.312Z","etag":null,"topics":["ai-assistant","argocd","claude","devops","docker","helm","istioctl","k8s","kubectl","kubernetes","mcp","mcp-server","modelcontextprotocol"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexei-led.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":"docs/supported-tools.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-27T16:14:32.000Z","updated_at":"2025-06-17T14:51:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"119606ee-a260-4de6-a03e-f0f319e0a245","html_url":"https://github.com/alexei-led/k8s-mcp-server","commit_stats":null,"previous_names":["alexei-led/k8s-mcp-server"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/alexei-led/k8s-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-led%2Fk8s-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-led%2Fk8s-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-led%2Fk8s-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-led%2Fk8s-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexei-led","download_url":"https://codeload.github.com/alexei-led/k8s-mcp-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-led%2Fk8s-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28579646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T17:42:58.221Z","status":"ssl_error","status_checked_at":"2026-01-19T17:40:54.158Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-assistant","argocd","claude","devops","docker","helm","istioctl","k8s","kubectl","kubernetes","mcp","mcp-server","modelcontextprotocol"],"created_at":"2025-03-29T03:18:29.010Z","updated_at":"2026-02-14T11:18:17.226Z","avatar_url":"https://github.com/alexei-led.png","language":"Python","funding_links":[],"categories":["Cloud Infrastructure","Cloud \u0026 Infrastructure","Cloud \u0026 DevOps MCP Servers","Cloud Platforms","📚 Projects (1974 total)","MCP 服务器精选列表","⚙️ DevOps","サーバー実装","MCP Servers","☁️ Cloud Platforms","Table of Contents","Container Orchestration"],"sub_categories":["🐳 Container Orchestration","Kubernetes","MCP Servers","☁️ 云平台与服务集成 (AWS, Cloudflare, Azure, K8s, etc.)","☁️ \u003ca name=\"cloud-platforms\"\u003e\u003c/a\u003eクラウドプラットフォーム","☁️ Cloud Platforms \u0026 Infrastructure","System Automation"],"readme":"# K8s MCP Server\n\n[![CI Status](https://github.com/alexei-led/k8s-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/alexei-led/k8s-mcp-server/actions/workflows/ci.yml)\n[![Release Status](https://github.com/alexei-led/k8s-mcp-server/actions/workflows/release.yml/badge.svg)](https://github.com/alexei-led/k8s-mcp-server/actions/workflows/release.yml)\n[![codecov](https://codecov.io/gh/alexei-led/k8s-mcp-server/graph/badge.svg?token=eCaXPJ0olS)](https://codecov.io/gh/alexei-led/k8s-mcp-server)\n[![Image Tags](https://ghcr-badge.egpl.dev/alexei-led/k8s-mcp-server/tags?color=%2344cc11\u0026ignore=latest\u0026n=4\u0026label=image+tags\u0026trim=)](https://github.com/alexei-led/k8s-mcp-server/pkgs/container/k8s-mcp-server/versions)\n[![Image Size](https://ghcr-badge.egpl.dev/alexei-led/k8s-mcp-server/size?color=%2344cc11\u0026tag=latest\u0026label=image+size\u0026trim=)](https://github.com/alexei-led/k8s-mcp-server/pkgs/container/k8s-mcp-server)\n[![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nK8s MCP Server is a Docker-based server implementing [Anthropic's Model Context Protocol (MCP)](https://www.anthropic.com/news/introducing-mcp) that enables Claude to run Kubernetes CLI tools (`kubectl`, `istioctl`, `helm`, `argocd`) in a secure, containerized environment.\n\n## Demo: Deploy and Troubleshoot WordPress\n\n**Session 1:** Using k8s-mcp-server and Helm CLI to deploy a WordPress application in the claude-demo namespace, then intentionally breaking it by scaling the MariaDB StatefulSet to zero.\n\n**Session 2:** Troubleshooting session where we use k8s-mcp-server to diagnose the broken WordPress site through kubectl commands, identify the missing database issue, and fix it by scaling up the StatefulSet and configuring ingress access..\n\n[Demo](https://private-user-images.githubusercontent.com/1898375/428398164-5ddce5bc-ec92-459b-a506-5d4442618a81.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDMzNDE0OTEsIm5iZiI6MTc0MzM0MTE5MSwicGF0aCI6Ii8xODk4Mzc1LzQyODM5ODE2NC01ZGRjZTViYy1lYzkyLTQ1OWItYTUwNi01ZDQ0NDI2MThhODEubXA0P1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAzMzBUMTMyNjMxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmUyNDExMGUzOGRlN2QxNWViMzhhOTE4Y2U1ZmRjMTQxYTI0OGNlNTFjNTRlMjFjNmQ3NTNhNGFmODNkODIzMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.hwKERwuQRXxHEYJ9d_fQ__XL1gj8l76nO6Yy6M4Uov8)\n\n## How It Works\n\n```mermaid\nflowchart LR\n    A[User] --\u003e |Asks K8s question| B[Claude]\n    B --\u003e |Sends command via MCP| C[K8s MCP Server]\n    C --\u003e |Executes kubectl, helm, etc.| D[Kubernetes Cluster]\n    D --\u003e |Returns results| C\n    C --\u003e |Returns formatted results| B\n    B --\u003e |Analyzes \u0026 explains| A\n```\n\nClaude can help users by:\n- Explaining complex Kubernetes concepts\n- Running commands against your cluster\n- Troubleshooting issues\n- Suggesting optimizations\n- Crafting Kubernetes manifests\n\n## Quick Start with Claude Desktop\n\nGet Claude helping with your Kubernetes clusters in under 2 minutes:\n\n1. **Create or update your Claude Desktop configuration file**:\n   - **macOS**: Edit `$HOME/Library/Application Support/Claude/claude_desktop_config.json`\n   - **Windows**: Edit `%APPDATA%\\Claude\\claude_desktop_config.json`\n   - **Linux**: Edit `$HOME/.config/Claude/claude_desktop_config.json`\n\n   ```json\n   {\n     \"mcpServers\": {\n       \"kubernetes\": {\n         \"command\": \"docker\",\n         \"args\": [\n           \"run\",\n           \"-i\",\n           \"--rm\",\n           \"-v\",\n           \"/Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro\",\n           \"ghcr.io/alexei-led/k8s-mcp-server:latest\"\n         ]\n       }\n     }\n   }\n   ```\n\n2. **Restart Claude Desktop**\n   - After restart, you'll see the Tools icon (🔨) in the bottom right of your input field\n   - This indicates Claude can now access K8s tools via the MCP server\n\n3. **Start using K8s tools directly in Claude Desktop**:\n   - \"What Kubernetes contexts do I have available?\"\n   - \"Show me all pods in the default namespace\"\n   - \"Create a deployment with 3 replicas of nginx:1.21\"\n   - \"Explain what's wrong with my StatefulSet 'database' in namespace 'prod'\"\n   - \"Deploy the bitnami/wordpress chart with Helm and set service type to LoadBalancer\"\n\n\u003e **Note**: Claude Desktop will automatically route K8s commands through the MCP server, allowing natural conversation about your clusters without leaving the Claude interface.\n\n\u003e **Cloud Providers**: For AWS EKS, GKE, or Azure AKS, you'll need additional configuration. See the [Cloud Provider Support](./docs/cloud-providers.md) guide.\n\n## Features\n\n- **Multiple Kubernetes Tools**: `kubectl`, `helm`, `istioctl`, and `argocd` in one container\n- **Cloud Providers**: Native support for AWS EKS, Google GKE, and Azure AKS\n- **Security**: Runs as non-root user with strict command validation\n- **Command Piping**: Support for common Unix tools like `jq`, `grep`, and `sed`\n- **Easy Configuration**: Simple environment variables for customization\n\n## Transport Protocols\n\nThe server supports three transport protocols, configured via `K8S_MCP_TRANSPORT`:\n\n| Transport | Description | Default |\n|-----------|-------------|---------|\n| `stdio` | Standard I/O (Claude Desktop default) | Yes |\n| `streamable-http` | HTTP transport (recommended for remote/web clients, MCP spec 2025-11-25) | No |\n| `sse` | Server-Sent Events (deprecated, use `streamable-http` instead) | No |\n\nExample using Streamable HTTP transport:\n\n```bash\ndocker run --rm -p 8000:8000 \\\n  -v ~/.kube:/home/appuser/.kube:ro \\\n  -e K8S_MCP_TRANSPORT=streamable-http \\\n  ghcr.io/alexei-led/k8s-mcp-server:latest\n```\n\n\u003e **Note**: When running in Docker with HTTP transports, the server automatically binds to `0.0.0.0` for proper port mapping. Outside Docker it binds to `127.0.0.1`.\n\n## Documentation\n\n- [Getting Started Guide](./docs/getting-started.md) - Detailed setup instructions\n- [Cloud Provider Support](./docs/cloud-providers.md) - EKS, GKE, and AKS configuration\n- [Supported Tools](./docs/supported-tools.md) - Complete list of all included CLI tools\n- [Environment Variables](./docs/environment-variables.md) - Configuration options\n- [Security Features](./docs/security.md) - Security modes and custom rules\n- [Claude Integration](./docs/claude-integration.md) - Detailed Claude Desktop setup\n- [Architecture](./docs/architecture.md) - System architecture and components\n- [Detailed Specification](./docs/spec.md) - Complete technical specification\n\n## Usage Examples\n\nOnce connected, you can ask Claude to help with Kubernetes tasks using natural language:\n\n```mermaid\nflowchart TB\n    subgraph \"Basic Commands\"\n        A1[\"Show me all pods in the default namespace\"]\n        A2[\"Get all services across all namespaces\"]\n        A3[\"Display the logs for the nginx pod\"]\n    end\n    \n    subgraph \"Troubleshooting\"\n        B1[\"Why is my deployment not starting?\"]\n        B2[\"Describe the failing pod and explain the error\"]\n        B3[\"Check if my service is properly connected to the pods\"]\n    end\n    \n    subgraph \"Deployments \u0026 Configuration\"\n        C1[\"Deploy the Nginx Helm chart\"]\n        C2[\"Create a deployment with 3 replicas of nginx:latest\"]\n        C3[\"Set up an ingress for my service\"]\n    end\n    \n    subgraph \"Advanced Operations\"\n        D1[\"Check the status of my Istio service mesh\"]\n        D2[\"Set up a canary deployment with 20% traffic to v2\"]\n        D3[\"Create an ArgoCD application for my repo\"]\n    end\n```\n\nClaude can understand your intent and run the appropriate kubectl, helm, istioctl, or argocd commands based on your request. It can then explain the output in simple terms or help you troubleshoot issues.\n\n## Advanced Claude Desktop Configuration\n\nConfigure Claude Desktop to optimize your Kubernetes workflow:\n\n### Target Specific Clusters and Namespaces\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro\",\n        \"-e\", \"K8S_CONTEXT=production-cluster\",\n        \"-e\", \"K8S_NAMESPACE=my-application\",\n        \"-e\", \"K8S_MCP_TIMEOUT=600\",\n        \"ghcr.io/alexei-led/k8s-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\n### Connect to AWS EKS Clusters\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.aws:/home/appuser/.aws:ro\",\n        \"-e\", \"AWS_PROFILE=production\",\n        \"-e\", \"AWS_REGION=us-west-2\",\n        \"ghcr.io/alexei-led/k8s-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\n### Connect to Google GKE Clusters\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.config/gcloud:/home/appuser/.config/gcloud:ro\",\n        \"-e\", \"CLOUDSDK_CORE_PROJECT=my-gcp-project\",\n        \"-e\", \"CLOUDSDK_COMPUTE_REGION=us-central1\",\n        \"ghcr.io/alexei-led/k8s-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\n### Connect to Azure AKS Clusters\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.azure:/home/appuser/.azure:ro\",\n        \"-e\", \"AZURE_SUBSCRIPTION=my-subscription-id\",\n        \"ghcr.io/alexei-led/k8s-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\n### Permissive Security Mode\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-v\", \"/Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro\",\n        \"-e\", \"K8S_MCP_SECURITY_MODE=permissive\",\n        \"ghcr.io/alexei-led/k8s-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\n\u003e For detailed security configuration options, see [Security Documentation](./docs/security.md).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexei-led%2Fk8s-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexei-led%2Fk8s-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexei-led%2Fk8s-mcp-server/lists"}