{"id":26937350,"url":"https://github.com/rohitg00/kubectl-mcp-server","last_synced_at":"2026-01-27T13:03:03.424Z","repository":{"id":284024066,"uuid":"953587943","full_name":"rohitg00/kubectl-mcp-server","owner":"rohitg00","description":"A Model Context Protocol (MCP) server for Kubernetes. Install: npx kubectl-mcp-server or pip install kubectl-mcp-tool","archived":false,"fork":false,"pushed_at":"2026-01-22T01:05:50.000Z","size":99628,"stargazers_count":755,"open_issues_count":1,"forks_count":147,"subscribers_count":10,"default_branch":"main","last_synced_at":"2026-01-22T08:58:19.162Z","etag":null,"topics":["ai","deployment","devops","genai","kubernetes","kubernetes-cluster","kubernetes-tools","llms","mcp","mcp-server","npm","pypi"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/kubectl-mcp-server","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/rohitg00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["rohitg00"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2025-03-23T17:49:07.000Z","updated_at":"2026-01-22T06:06:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"546d8719-fb76-4124-a99b-bc3a9c58037a","html_url":"https://github.com/rohitg00/kubectl-mcp-server","commit_stats":null,"previous_names":["rohitg00/kubectl-mcp-server"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/rohitg00/kubectl-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitg00%2Fkubectl-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitg00%2Fkubectl-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitg00%2Fkubectl-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitg00%2Fkubectl-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohitg00","download_url":"https://codeload.github.com/rohitg00/kubectl-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitg00%2Fkubectl-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: 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","deployment","devops","genai","kubernetes","kubernetes-cluster","kubernetes-tools","llms","mcp","mcp-server","npm","pypi"],"created_at":"2025-04-02T13:15:09.183Z","updated_at":"2026-01-27T13:03:03.400Z","avatar_url":"https://github.com/rohitg00.png","language":"Python","funding_links":["https://github.com/sponsors/rohitg00"],"categories":["Cloud Infrastructure","Cloud \u0026 Infrastructure","Cloud \u0026 DevOps MCP Servers","📚 Projects (1974 total)","MCP 服务器精选列表","🤖 AI/ML","サーバー実装","Python","Task and Project Management","Servers","Table of Contents","Developer Tools","☁️ Cloud Platforms","Containerised MCP Servers","Cloud Platforms","MCP Servers","MCP Servers \u0026 Protocol","☁️ Cloud Platforms (38 servers)","Server Implementations"],"sub_categories":["🐳 Container Orchestration","Kubernetes","MCP Servers","☁️ 云平台与服务集成 (AWS, Cloudflare, Azure, K8s, etc.)","☁️ \u003ca name=\"cloud-platforms\"\u003e\u003c/a\u003eクラウドプラットフォーム","Developer Tools","AI Services","How to Submit","DevOps \u0026 Infrastructure","Cloud \u0026 DevOps","☁️ \u003ca name=\"cloud-platforms\"\u003e\u003c/a\u003eCloud Platforms"],"readme":"# Kubectl MCP Server\n\nA Model Context Protocol (MCP) server for Kubernetes that enables AI assistants like Claude, Cursor, and others to interact with Kubernetes clusters through natural language.\n\n[![GitHub Stars](https://img.shields.io/github/stars/rohitg00/kubectl-mcp-server?style=flat\u0026logo=github)](https://github.com/rohitg00/kubectl-mcp-server)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/)\n[![Kubernetes](https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=flat\u0026logo=kubernetes\u0026logoColor=white)](https://kubernetes.io/)\n[![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io)\n[![PyPI](https://img.shields.io/pypi/v/kubectl-mcp-server?color=blue\u0026label=PyPI)](https://pypi.org/project/kubectl-mcp-server/)\n[![npm](https://img.shields.io/npm/v/kubectl-mcp-server?color=green\u0026label=npm)](https://www.npmjs.com/package/kubectl-mcp-server)\n[![Docker](https://img.shields.io/docker/pulls/rohitghumare64/kubectl-mcp-server.svg)](https://hub.docker.com/r/rohitghumare64/kubectl-mcp-server)\n[![Tests](https://img.shields.io/badge/tests-187%20passed-success)](https://github.com/rohitg00/kubectl-mcp-server)\n[![agentregistry](https://img.shields.io/badge/agentregistry-verified-blue?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE1Ljk5MiA2LjAzN2wtMy4wMjEtLjQzOS0xLjM1LTIuNzM2Yy0uMzQ2LS43MDItMS41MDQtLjcwMi0xLjg1IDBMOC40MjEgNS41OTggNS40IDYuMDM3Yy0uNzc2LjExMy0xLjA4OCAxLjA1My0uNTI4IDEuNTkzbDIuMTg2IDIuMTI5LS41MTYgMy4wMWMtLjEzMy43NzUuNjgyIDEuMzY2IDEuMzc4Ljk5OGwyLjcwMi0xLjQyIDIuNzAyIDEuNDJjLjY5Ni4zNjggMS41MTEtLjIyMyAxLjM3OC0uOTk4bC0uNTE2LTMuMDEgMi4xODYtMi4xMjljLjU2LS41NCAwLjI0OC0xLjQ4LS41MjgtMS41OTN6Ii8+PC9zdmc+)](https://aregistry.ai)\n\n## MCP Client Compatibility\n\nWorks with all MCP-compatible AI assistants:\n\n| Client | Status | Client | Status |\n|--------|--------|--------|--------|\n| Claude Desktop | ✅ Native | Claude Code | ✅ Native |\n| Cursor | ✅ Native | Windsurf | ✅ Native |\n| GitHub Copilot | ✅ Native | OpenAI Codex | ✅ Native |\n| Gemini CLI | ✅ Native | Goose | ✅ Native |\n| Roo Code | ✅ Native | Kilo Code | ✅ Native |\n| Amp | ✅ Native | Trae | ✅ Native |\n| OpenCode | ✅ Native | Kiro CLI | ✅ Native |\n| Antigravity | ✅ Native | Clawdbot | ✅ Native |\n| Droid (Factory) | ✅ Native | Any MCP Client | ✅ Compatible |\n\n## Live Demos\n\n### Claude Desktop\n![Claude MCP](./docs/claude/claude-mcp.gif)\n\n### Cursor AI\n![Cursor MCP](./docs/cursor/cursor-mcp.gif)\n\n### Windsurf\n![Windsurf MCP](./docs/windsurf/windsurf-mcp.gif)\n\n## Features\n\n### 127 MCP Tools for Complete Kubernetes Management\n\n| Category | Tools |\n|----------|-------|\n| **Pods** | `get_pods`, `get_logs`, `get_pod_events`, `check_pod_health`, `exec_in_pod`, `cleanup_pods`, `get_pod_conditions`, `get_previous_logs` |\n| **Deployments** | `get_deployments`, `create_deployment`, `scale_deployment`, `kubectl_rollout`, `restart_deployment` |\n| **Workloads** | `get_statefulsets`, `get_daemonsets`, `get_jobs`, `get_replicasets` |\n| **Services \u0026 Networking** | `get_services`, `get_ingress`, `get_endpoints`, `diagnose_network_connectivity`, `check_dns_resolution`, `trace_service_chain` |\n| **Storage** | `get_persistent_volumes`, `get_pvcs`, `get_storage_classes` |\n| **Config** | `get_configmaps`, `get_secrets`, `get_resource_quotas`, `get_limit_ranges` |\n| **Cluster** | `get_nodes`, `get_namespaces`, `get_cluster_info`, `get_cluster_version`, `health_check`, `get_node_metrics`, `get_pod_metrics` |\n| **RBAC \u0026 Security** | `get_rbac_roles`, `get_cluster_roles`, `get_service_accounts`, `audit_rbac_permissions`, `check_secrets_security`, `get_pod_security_info`, `get_admission_webhooks` |\n| **CRDs** | `get_crds`, `get_priority_classes` |\n| **Helm Releases** | `helm_list`, `helm_status`, `helm_history`, `helm_get_values`, `helm_get_manifest`, `helm_get_notes`, `helm_get_hooks`, `helm_get_all` |\n| **Helm Charts** | `helm_show_chart`, `helm_show_values`, `helm_show_readme`, `helm_show_crds`, `helm_show_all`, `helm_search_repo`, `helm_search_hub` |\n| **Helm Repos** | `helm_repo_list`, `helm_repo_add`, `helm_repo_remove`, `helm_repo_update` |\n| **Helm Operations** | `install_helm_chart`, `upgrade_helm_chart`, `uninstall_helm_chart`, `helm_rollback`, `helm_test`, `helm_template`, `helm_template_apply` |\n| **Helm Development** | `helm_create`, `helm_lint`, `helm_package`, `helm_pull`, `helm_dependency_list`, `helm_dependency_update`, `helm_dependency_build`, `helm_version`, `helm_env` |\n| **Context** | `get_current_context`, `switch_context`, `list_contexts`, `list_kubeconfig_contexts` |\n| **Diagnostics** | `diagnose_pod_crash`, `detect_pending_pods`, `get_evicted_pods`, `compare_namespaces` |\n| **Operations** | `kubectl_apply`, `kubectl_create`, `kubectl_describe`, `kubectl_patch`, `delete_resource`, `kubectl_cp`, `backup_resource`, `label_resource`, `annotate_resource`, `taint_node`, `wait_for_condition` |\n| **Autoscaling** | `get_hpa`, `get_pdb` |\n| **Cost Optimization** | `get_resource_recommendations`, `get_idle_resources`, `get_resource_quotas_usage`, `get_cost_analysis`, `get_overprovisioned_resources`, `get_resource_trends`, `get_namespace_cost_allocation`, `optimize_resource_requests` |\n| **Advanced** | `kubectl_generic`, `kubectl_explain`, `get_api_resources`, `port_forward`, `get_resource_usage`, `node_management` |\n| **UI Dashboards** | `show_pod_logs_ui`, `show_pods_dashboard_ui`, `show_resource_yaml_ui`, `show_cluster_overview_ui`, `show_events_timeline_ui`, `render_k8s_dashboard_screenshot` |\n\n### MCP Resources (FastMCP 3)\n\nAccess Kubernetes data as browsable resources:\n\n| Resource URI | Description |\n|--------------|-------------|\n| `kubeconfig://contexts` | List all available kubectl contexts |\n| `kubeconfig://current-context` | Get current active context |\n| `namespace://current` | Get current namespace |\n| `namespace://list` | List all namespaces |\n| `cluster://info` | Get cluster information |\n| `cluster://nodes` | Get detailed node information |\n| `cluster://version` | Get Kubernetes version |\n| `cluster://api-resources` | List available API resources |\n| `manifest://deployments/{ns}/{name}` | Get deployment YAML |\n| `manifest://services/{ns}/{name}` | Get service YAML |\n| `manifest://pods/{ns}/{name}` | Get pod YAML |\n| `manifest://configmaps/{ns}/{name}` | Get ConfigMap YAML |\n| `manifest://secrets/{ns}/{name}` | Get secret YAML (data masked) |\n| `manifest://ingresses/{ns}/{name}` | Get ingress YAML |\n\n### MCP Prompts (FastMCP 3)\n\nPre-built workflow prompts for common Kubernetes operations:\n\n| Prompt | Description |\n|--------|-------------|\n| `troubleshoot_workload` | Comprehensive troubleshooting guide for pods/deployments |\n| `deploy_application` | Step-by-step deployment workflow |\n| `security_audit` | Security scanning and RBAC analysis workflow |\n| `cost_optimization` | Resource optimization and cost analysis workflow |\n| `disaster_recovery` | Backup and recovery planning workflow |\n| `debug_networking` | Network debugging for services and connectivity |\n| `scale_application` | Scaling guide with HPA/VPA best practices |\n| `upgrade_cluster` | Kubernetes cluster upgrade planning |\n\n### Key Capabilities\n\n- **Enhanced CLI**: 8 new subcommands for tool discovery, direct calling, and diagnostics\n- **Multi-Transport Support**: stdio, SSE, HTTP/streamable-http\n- **AI Assistant Integration**: Claude Desktop, Claude Code, Cursor, Windsurf\n- **Multi-Cluster**: Context switching between clusters\n- **Security**: Non-destructive mode, secrets masking, RBAC validation\n- **Diagnostics**: Pod crash analysis, network connectivity testing, DNS resolution checks\n- **Helm v3**: Full Helm chart lifecycle management\n- **Cost Optimization**: Resource recommendations, idle resource detection, usage analysis\n- **FastMCP 3**: MCP Resources and Prompts for enhanced AI workflows\n- **MCP-UI Support**: Interactive HTML dashboards for compatible hosts (Goose, LibreChat)\n- **Browser Automation**: 26 tools with cloud provider support (Browserbase, Browser Use)\n\n## CLI Usage\n\nkubectl-mcp-server now includes a powerful CLI for shell-friendly operation:\n\n```bash\n# List all tools with descriptions\nkubectl-mcp-server tools -d\n\n# Search for pod-related tools\nkubectl-mcp-server grep \"*pod*\"\n\n# Show specific tool schema\nkubectl-mcp-server tools get_pods\n\n# Call a tool directly\nkubectl-mcp-server call get_pods '{\"namespace\": \"kube-system\"}'\n\n# Pipe JSON from stdin\necho '{\"namespace\": \"default\"}' | kubectl-mcp-server call get_pods\n\n# Check dependencies\nkubectl-mcp-server doctor\n\n# Show/switch Kubernetes context\nkubectl-mcp-server context\nkubectl-mcp-server context minikube\n\n# List resources and prompts\nkubectl-mcp-server resources\nkubectl-mcp-server prompts\n\n# Show server info\nkubectl-mcp-server info\n```\n\n### CLI Features\n\n- **Structured errors**: Actionable error messages with suggestions\n- **Colorized output**: Human-readable with JSON mode for scripting (`--json`)\n- **NO_COLOR support**: Respects `NO_COLOR` environment variable\n- **Stdin support**: Pipe JSON arguments to commands\n\n## Installation\n\n### Prerequisites\n- Python 3.9+\n- kubectl CLI installed and configured\n- Access to a Kubernetes cluster\n\n### npm / npx (Recommended)\n\n```bash\n# Run directly without installation\nnpx kubectl-mcp-server\n\n# Or install globally\nnpm install -g kubectl-mcp-server\n```\n\n### pip (Python)\n\n```bash\npip install kubectl-mcp-server\n\n# With MCP-UI support (interactive dashboards)\npip install kubectl-mcp-server[ui]\n\n# Legacy alias (still works for backward compatibility)\npip install kubectl-mcp-tool\n```\n\n### Docker\n\n```bash\n# Pull the latest image\ndocker pull rohitghumare64/kubectl-mcp-server:latest\n\n# Run with stdio transport\ndocker run -i -v $HOME/.kube:/root/.kube:ro rohitghumare64/kubectl-mcp-server:latest\n\n# Run with SSE transport\ndocker run -p 8000:8000 -v $HOME/.kube:/root/.kube:ro rohitghumare64/kubectl-mcp-server:latest --transport sse\n```\n\n## Quick Start\n\n### Claude Desktop\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kubectl-mcp-server\"]\n    }\n  }\n}\n```\n\n### Claude Code\n\nAdd to `~/.config/claude-code/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kubectl-mcp-server\"]\n    }\n  }\n}\n```\n\n### Cursor AI\n\nAdd to `~/.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kubectl-mcp-server\"]\n    }\n  }\n}\n```\n\n### Windsurf\n\nAdd to `~/.config/windsurf/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kubectl-mcp-server\"]\n    }\n  }\n}\n```\n\n### GitHub Copilot (VS Code)\n\nAdd to VS Code `settings.json`:\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"kubernetes\": {\n        \"command\": \"npx\",\n        \"args\": [\"-y\", \"kubectl-mcp-server\"]\n      }\n    }\n  }\n}\n```\n\n### Goose\n\nAdd to `~/.config/goose/config.yaml`:\n\n```yaml\nextensions:\n  kubernetes:\n    command: npx\n    args:\n      - -y\n      - kubectl-mcp-server\n```\n\n### Gemini CLI\n\nAdd to `~/.gemini/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kubectl-mcp-server\"]\n    }\n  }\n}\n```\n\n### Roo Code / Kilo Code\n\nAdd to `~/.config/roo-code/mcp.json` or `~/.config/kilo-code/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kubectl-mcp-server\"]\n    }\n  }\n}\n```\n\n### Using Python Directly\n\nIf you prefer Python over npx:\n\n```json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"kubectl_mcp_tool.mcp_server\"],\n      \"env\": {\n        \"KUBECONFIG\": \"/path/to/.kube/config\"\n      }\n    }\n  }\n}\n```\n\n## Transport Modes\n\n```bash\n# stdio (default) - for Claude Desktop, Cursor, etc.\npython -m kubectl_mcp_tool.mcp_server\n\n# SSE - Server-Sent Events\npython -m kubectl_mcp_tool.mcp_server --transport sse --port 8000\n\n# HTTP\npython -m kubectl_mcp_tool.mcp_server --transport http --port 8000\n```\n\n### Options\n- `--transport`: `stdio`, `sse`, `http`, `streamable-http` (default: `stdio`)\n- `--host`: Host to bind (default: `0.0.0.0`)\n- `--port`: Port for network transports (default: `8000`)\n- `--non-destructive`: Block destructive operations (delete, apply, create)\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `KUBECONFIG` | Path to kubeconfig file (default: `~/.kube/config`) |\n| `MCP_DEBUG` | Set to `1` for verbose logging |\n| `MCP_LOG_FILE` | Path to log file |\n\n### Authentication (Enterprise)\n\n| Variable | Description |\n|----------|-------------|\n| `MCP_AUTH_ENABLED` | Enable OAuth 2.1 authentication (default: `false`) |\n| `MCP_AUTH_ISSUER` | OAuth 2.0 Authorization Server URL |\n| `MCP_AUTH_JWKS_URI` | JWKS endpoint (optional, derived from issuer) |\n| `MCP_AUTH_AUDIENCE` | Expected token audience (default: `kubectl-mcp-server`) |\n| `MCP_AUTH_REQUIRED_SCOPES` | Required scopes (default: `mcp:tools`) |\n\n### Browser Automation (Optional)\n\n| Variable | Description |\n|----------|-------------|\n| `MCP_BROWSER_ENABLED` | Enable browser automation tools (default: `false`) |\n\n## MCP-UI Tools (Interactive Dashboards)\n\nEnable rich HTML dashboards in MCP-UI compatible hosts (Goose, LibreChat, Nanobot).\n\n### Installation\n\n```bash\n# Install with MCP-UI support\npip install kubectl-mcp-server[ui]\n```\n\n### 6 UI Dashboard Tools\n\n| Tool | Description |\n|------|-------------|\n| `show_pod_logs_ui` | Interactive log viewer with search and filtering |\n| `show_pods_dashboard_ui` | Pods table with status, restarts, and filtering |\n| `show_resource_yaml_ui` | YAML viewer with syntax highlighting |\n| `show_cluster_overview_ui` | Cluster dashboard with nodes, namespaces, workloads |\n| `show_events_timeline_ui` | Events timeline with severity filtering |\n| `render_k8s_dashboard_screenshot` | Render any dashboard as PNG screenshot |\n\n### Features\n\n- **Dark theme**: Catppuccin-style dark UI optimized for terminals\n- **Graceful fallback**: Returns JSON data if MCP-UI not supported\n- **Screenshot rendering**: Works with agent-browser for universal compatibility\n- **No external dependencies**: Pure HTML/CSS/JS dashboards\n\n### Compatibility\n\n| Host | MCP-UI Support | Fallback |\n|------|----------------|----------|\n| Goose | ✅ Full | - |\n| LibreChat | ✅ Full | - |\n| Nanobot | ✅ Full | - |\n| Claude Desktop | ❌ | JSON + Screenshot |\n| Cursor | ❌ | JSON + Screenshot |\n| Other MCP Clients | ❌ | JSON + Screenshot |\n\n## Browser Tools (Optional Module)\n\nEnable browser automation for web-based K8s operations using [agent-browser](https://github.com/vercel-labs/agent-browser).\n\n### Setup\n\n```bash\n# Install agent-browser\nnpm install -g agent-browser\nagent-browser install  # Download Chromium\n\n# Enable browser tools\nexport MCP_BROWSER_ENABLED=true\nkubectl-mcp-server\n```\n\n### 26 Browser Tools (agent-browser v0.7+)\n\n| Tool | Description |\n|------|-------------|\n| `browser_open` | Open URL in browser (with headers/session support) |\n| `browser_snapshot` | Get page accessibility tree |\n| `browser_click` | Click element by ref |\n| `browser_fill` | Fill form field |\n| `browser_screenshot` | Take screenshot |\n| `browser_get_text` | Get element text |\n| `browser_get_url` | Get current URL |\n| `browser_wait` | Wait for element/text/timeout |\n| `browser_close` | Close browser |\n| `browser_connect_cdp` | **NEW**: Connect to remote browser via CDP |\n| `browser_install` | **NEW**: Install Chromium browser |\n| `browser_set_provider` | **NEW**: Configure cloud provider (Browserbase/Browser Use) |\n| `browser_session_list` | **NEW**: List active browser sessions |\n| `browser_session_switch` | **NEW**: Switch to different session |\n| `browser_open_with_headers` | **NEW**: Open URL with auth headers |\n| `browser_set_viewport` | **NEW**: Set viewport or emulate device |\n| `browser_test_ingress` | Test K8s service via Ingress |\n| `browser_screenshot_service` | Screenshot K8s service UI |\n| `browser_screenshot_grafana` | Screenshot Grafana dashboard |\n| `browser_screenshot_argocd` | Screenshot ArgoCD app |\n| `browser_health_check` | Health check web app |\n| `browser_form_submit` | Fill and submit form |\n| `browser_session_save` | Save browser session |\n| `browser_session_load` | Load browser session |\n| `browser_open_cloud_console` | Open EKS/GKE/AKS console |\n| `browser_pdf_export` | Export page as PDF |\n\n### Browser v0.7 Features\n\n- **Cloud providers**: Browserbase, Browser Use\n- **Persistent profiles**: Keep cookies/storage across restarts\n- **Remote CDP**: Connect to existing browser instances\n- **Retry with exponential backoff**: Auto-retry transient errors\n\n#### Environment Variables\n\n| Variable | Description | Example |\n|----------|-------------|---------|\n| `MCP_BROWSER_ENABLED` | Enable browser tools | `true` |\n| `MCP_BROWSER_PROVIDER` | Cloud provider | `browserbase` / `browseruse` |\n| `MCP_BROWSER_PROFILE` | Persistent profile path | `~/.k8s-browser` |\n| `MCP_BROWSER_CDP_URL` | Remote CDP WebSocket | `wss://...` |\n| `MCP_BROWSER_PROXY` | Proxy server URL | `http://proxy:8080` |\n| `MCP_BROWSER_USER_AGENT` | Custom user agent | `Mozilla/5.0...` |\n| `MCP_BROWSER_SESSION` | Session name | `k8s-session` |\n| `MCP_BROWSER_HEADED` | Show browser window | `true` |\n\n### Use Cases\n\n- **Test deployed apps** via Ingress URLs\n- **Screenshot Grafana/ArgoCD** dashboards\n- **Automate cloud console** operations (EKS, GKE, AKS)\n- **Health check** web applications\n- **Export monitoring dashboards** as PDF\n\n## MCP Authorization (RFC 9728)\n\nFor enterprise deployments, kubectl-mcp-server supports OAuth 2.1 authentication.\n\n```bash\nexport MCP_AUTH_ENABLED=true\nexport MCP_AUTH_ISSUER=https://your-idp.example.com\nexport MCP_AUTH_AUDIENCE=kubectl-mcp-server\nkubectl-mcp-server --transport http --port 8000\n```\n\nSupported identity providers: **Okta**, **Auth0**, **Keycloak**, **Microsoft Entra ID**, **Google OAuth**, and any OIDC-compliant provider.\n\n## Docker MCP Toolkit\n\nCompatible with [Docker MCP Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/):\n\n```bash\n# Add server\ndocker mcp server add kubectl-mcp-server mcp/kubectl-mcp-server:latest\n\n# Configure kubeconfig\ndocker mcp server configure kubectl-mcp-server --volume \"$HOME/.kube:/root/.kube:ro\"\n\n# Enable and connect\ndocker mcp server enable kubectl-mcp-server\ndocker mcp client connect claude\n```\n\n## agentregistry\n\nkubectl-mcp-server is published to [agentregistry](https://github.com/agentregistry-dev/agentregistry), a centralized registry for MCP servers.\n\n### Install with arctl\n\n```bash\n# Install arctl CLI\ncurl -fsSL https://raw.githubusercontent.com/agentregistry-dev/agentregistry/main/scripts/install.sh | bash\n\n# Search for kubectl-mcp-server\narctl mcp search kubectl\n\n# Install the server\narctl mcp install io.github.rohitg00/kubectl-mcp-server\n```\n\n### Available Packages\n\n| Registry | Identifier |\n|----------|------------|\n| **PyPI** | `kubectl-mcp-server` (uvx) |\n| **npm** | `kubectl-mcp-server` (npx) |\n| **OCI** | `docker.io/rohitghumare64/kubectl-mcp-server` |\n\n### agentgateway Integration\n\nUse with [agentgateway](https://github.com/agentgateway/agentgateway) for unified MCP routing to multiple MCP servers.\n\n```bash\n# Start kubectl-mcp-server with streamable-http transport\nkubectl-mcp-server --transport streamable-http --port 8000\n```\n\nCreate `gateway.yaml`:\n\n```yaml\nbinds:\n- port: 3000\n  listeners:\n  - routes:\n    - backends:\n      - mcp:\n          targets:\n          - name: kubectl-mcp-server\n            mcp:\n              host: http://localhost:8000/mcp\n```\n\n```bash\n# Run agentgateway\nagentgateway --config gateway.yaml\n```\n\nConnect MCP clients to `http://localhost:3000/mcp`. All 127 tools are discoverable through the gateway.\n\n## Kubernetes Deployment\n\nDeploy kubectl-mcp-server directly in your Kubernetes cluster for centralized access.\n\n### kMCP Deployment (Recommended)\n\n[kMCP](https://github.com/kagent-dev/kmcp) is a development platform and control plane for MCP servers. See [kMCP quickstart](https://kagent.dev/docs/kmcp/quickstart).\n\n```bash\n# Install kmcp CLI\ncurl -fsSL https://raw.githubusercontent.com/kagent-dev/kmcp/refs/heads/main/scripts/get-kmcp.sh | bash\n\n# Install kmcp controller in your cluster\nhelm install kmcp-crds oci://ghcr.io/kagent-dev/kmcp/helm/kmcp-crds \\\n     --namespace kmcp-system --create-namespace\nkmcp install\n\n# Deploy kubectl-mcp-server using npx (easiest)\nkmcp deploy package --deployment-name kubectl-mcp-server \\\n   --manager npx --args kubectl-mcp-server\n\n# Or deploy using our Docker image with the MCPServer manifest\nkmcp deploy --file deploy/kmcp/kmcp.yaml --image rohitghumare64/kubectl-mcp-server:latest\n```\n\n### Standard Kubernetes Deployment\n\nDeploy using kubectl/kustomize without kMCP:\n\n```bash\n# Using kustomize (recommended)\nkubectl apply -k deploy/kubernetes/\n\n# Or apply individual manifests\nkubectl apply -f deploy/kubernetes/namespace.yaml\nkubectl apply -f deploy/kubernetes/rbac.yaml\nkubectl apply -f deploy/kubernetes/deployment.yaml\nkubectl apply -f deploy/kubernetes/service.yaml\n\n# Access via port-forward\nkubectl port-forward -n kubectl-mcp svc/kubectl-mcp-server 8000:8000\n```\n\n### MCPServer Custom Resource\n\nFor kMCP deployments, apply this MCPServer resource:\n\n```yaml\napiVersion: kagent.dev/v1alpha1\nkind: MCPServer\nmetadata:\n  name: kubectl-mcp-server\nspec:\n  deployment:\n    image: \"rohitghumare64/kubectl-mcp-server:latest\"\n    port: 8000\n  transportType: http\n  httpTransport:\n    targetPort: 8000\n    path: /mcp\n```\n\nSee [deploy/](deploy/) for full manifests and configuration options.\n\n### kagent Integration (AI Agents)\n\n[kagent](https://github.com/kagent-dev/kagent) is a Kubernetes-native AI agent framework (CNCF project). Register kubectl-mcp-server as a ToolServer to give your agents 127 K8s management tools.\n\n```bash\n# Install kagent\nbrew install kagent\nkagent install --profile demo\n\n# Register kubectl-mcp-server as a ToolServer\nkubectl apply -f deploy/kagent/toolserver-stdio.yaml\n\n# Open kagent dashboard and chat with your K8s agent\nkagent dashboard\n```\n\nSee [kagent quickstart](https://kagent.dev/docs/kagent/getting-started/quickstart) for full documentation.\n\n## Architecture\n\n```\n┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐\n│   AI Assistant  │────▶│   MCP Server     │────▶│  Kubernetes API │\n│ (Claude/Cursor) │◀────│ (kubectl-mcp)    │◀────│    (kubectl)    │\n└─────────────────┘     └──────────────────┘     └─────────────────┘\n```\n\nThe MCP server implements the [Model Context Protocol](https://github.com/modelcontextprotocol/spec), translating natural language requests into kubectl operations.\n\n### Modular Structure\n\n```\nkubectl_mcp_tool/\n├── mcp_server.py          # Main server (FastMCP, transports)\n├── tools/                  # 127 MCP tools organized by category\n│   ├── pods.py            # Pod management \u0026 diagnostics\n│   ├── deployments.py     # Deployments, StatefulSets, DaemonSets\n│   ├── core.py            # Namespaces, ConfigMaps, Secrets\n│   ├── cluster.py         # Context/cluster management\n│   ├── networking.py      # Services, Ingress, NetworkPolicies\n│   ├── storage.py         # PVCs, StorageClasses, PVs\n│   ├── security.py        # RBAC, ServiceAccounts, PodSecurity\n│   ├── helm.py            # Complete Helm v3 operations\n│   ├── operations.py      # kubectl apply/patch/describe/etc\n│   ├── diagnostics.py     # Metrics, namespace comparison\n│   ├── cost.py            # Resource optimization \u0026 cost analysis\n│   └── ui.py              # MCP-UI interactive dashboards\n├── resources/              # 8 MCP Resources for data exposure\n├── prompts/                # 8 MCP Prompts for workflows\n└── cli/                    # CLI interface\n```\n\n## Multi-Cluster Support\n\n```bash\n# List contexts\nlist_contexts\n\n# Switch cluster\nswitch_context --context_name production\n\n# Get context details\nget_context_details --context_name staging\n```\n\n## Development \u0026 Testing\n\n### Setup Development Environment\n\n```bash\n# Clone the repository\ngit clone https://github.com/rohitg00/kubectl-mcp-server.git\ncd kubectl-mcp-server\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install development dependencies\npip install -r requirements-dev.txt\n```\n\n### Running Tests\n\n```bash\n# Run all tests\npytest tests/ -v\n\n# Run specific test file\npytest tests/test_tools.py -v\n\n# Run with coverage\npytest tests/ --cov=kubectl_mcp_tool --cov-report=html\n\n# Run only unit tests\npytest tests/ -v -m unit\n```\n\n### Test Structure\n\n```\ntests/\n├── __init__.py          # Test package\n├── conftest.py          # Shared fixtures and mocks\n├── test_tools.py        # Unit tests for 121 MCP tools\n├── test_resources.py    # Tests for 8 MCP Resources\n├── test_prompts.py      # Tests for 8 MCP Prompts\n└── test_server.py       # Server initialization tests\n```\n\n**138 tests covering**: tool registration, resource exposure, prompt generation, server initialization, non-destructive mode, secret masking, error handling, and transport methods.\n\n### Code Quality\n\n```bash\n# Format code\nblack kubectl_mcp_tool tests\n\n# Sort imports\nisort kubectl_mcp_tool tests\n\n# Lint\nflake8 kubectl_mcp_tool tests\n\n# Type checking\nmypy kubectl_mcp_tool\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Links\n\n- [PyPI Package](https://pypi.org/project/kubectl-mcp-server/)\n- [npm Package](https://www.npmjs.com/package/kubectl-mcp-server)\n- [Docker Hub](https://hub.docker.com/r/rohitghumare64/kubectl-mcp-server)\n- [GitHub Issues](https://github.com/rohitg00/kubectl-mcp-server/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitg00%2Fkubectl-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohitg00%2Fkubectl-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitg00%2Fkubectl-mcp-server/lists"}