kubectl-mcp-server 1.14.0__tar.gz → 1.15.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. kubectl_mcp_server-1.15.0/PKG-INFO +1026 -0
  2. kubectl_mcp_server-1.15.0/README.md +968 -0
  3. kubectl_mcp_server-1.15.0/kubectl_mcp_server.egg-info/PKG-INFO +1026 -0
  4. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/__init__.py +1 -1
  5. kubectl_mcp_server-1.15.0/kubectl_mcp_tool/k8s_config.py +511 -0
  6. kubectl_mcp_server-1.15.0/kubectl_mcp_tool/tools/cluster.py +589 -0
  7. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/core.py +157 -60
  8. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/cost.py +97 -41
  9. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/deployments.py +173 -56
  10. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/diagnostics.py +40 -13
  11. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/helm.py +133 -46
  12. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/networking.py +106 -32
  13. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/operations.py +176 -50
  14. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/pods.py +162 -50
  15. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/security.py +89 -36
  16. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/storage.py +35 -16
  17. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/setup.py +1 -1
  18. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_browser.py +2 -2
  19. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_tools.py +10 -9
  20. kubectl_mcp_server-1.14.0/PKG-INFO +0 -780
  21. kubectl_mcp_server-1.14.0/README.md +0 -722
  22. kubectl_mcp_server-1.14.0/kubectl_mcp_server.egg-info/PKG-INFO +0 -780
  23. kubectl_mcp_server-1.14.0/kubectl_mcp_tool/k8s_config.py +0 -289
  24. kubectl_mcp_server-1.14.0/kubectl_mcp_tool/tools/cluster.py +0 -315
  25. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/LICENSE +0 -0
  26. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_server.egg-info/SOURCES.txt +0 -0
  27. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_server.egg-info/dependency_links.txt +0 -0
  28. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_server.egg-info/entry_points.txt +0 -0
  29. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_server.egg-info/requires.txt +0 -0
  30. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_server.egg-info/top_level.txt +0 -0
  31. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/__main__.py +0 -0
  32. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/auth/__init__.py +0 -0
  33. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/auth/config.py +0 -0
  34. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/auth/scopes.py +0 -0
  35. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/auth/verifier.py +0 -0
  36. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/cli/__init__.py +0 -0
  37. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/cli/__main__.py +0 -0
  38. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/cli/cli.py +0 -0
  39. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/cli/errors.py +0 -0
  40. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/cli/output.py +0 -0
  41. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/diagnostics.py +0 -0
  42. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/mcp_server.py +0 -0
  43. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/prompts/__init__.py +0 -0
  44. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/prompts/prompts.py +0 -0
  45. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/resources/__init__.py +0 -0
  46. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/resources/resources.py +0 -0
  47. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/__init__.py +0 -0
  48. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/browser.py +0 -0
  49. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/tools/ui.py +0 -0
  50. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/utils/__init__.py +0 -0
  51. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/kubectl_mcp_tool/utils/helpers.py +0 -0
  52. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/setup.cfg +0 -0
  53. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/__init__.py +0 -0
  54. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/conftest.py +0 -0
  55. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_auth.py +0 -0
  56. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_cli.py +0 -0
  57. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_prompts.py +0 -0
  58. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_resources.py +0 -0
  59. {kubectl_mcp_server-1.14.0 → kubectl_mcp_server-1.15.0}/tests/test_server.py +0 -0
@@ -0,0 +1,1026 @@
1
+ Metadata-Version: 2.4
2
+ Name: kubectl-mcp-server
3
+ Version: 1.15.0
4
+ Summary: A Model Context Protocol (MCP) server for Kubernetes with 127+ tools, 8 resources, and 8 prompts
5
+ Home-page: https://github.com/rohitg00/kubectl-mcp-server
6
+ Author: Rohit Ghumare
7
+ Author-email: ghumare64@gmail.com
8
+ Project-URL: Bug Tracker, https://github.com/rohitg00/kubectl-mcp-server/issues
9
+ Project-URL: Documentation, https://github.com/rohitg00/kubectl-mcp-server#readme
10
+ Project-URL: Source, https://github.com/rohitg00/kubectl-mcp-server
11
+ Keywords: kubernetes,mcp,model-context-protocol,kubectl,helm,ai-assistant,claude,cursor,windsurf,fastmcp,devops,cloud-native,mcp-ui
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Intended Audience :: Developers
22
+ Classifier: Intended Audience :: System Administrators
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: fastmcp>=3.0.0b1
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: fastapi>=0.100.0
29
+ Requires-Dist: uvicorn>=0.22.0
30
+ Requires-Dist: starlette>=0.27.0
31
+ Requires-Dist: kubernetes>=28.1.0
32
+ Requires-Dist: PyYAML>=6.0.1
33
+ Requires-Dist: requests>=2.31.0
34
+ Requires-Dist: urllib3>=2.1.0
35
+ Requires-Dist: websocket-client>=1.7.0
36
+ Requires-Dist: jsonschema>=4.20.0
37
+ Requires-Dist: cryptography>=42.0.2
38
+ Requires-Dist: rich>=13.0.0
39
+ Requires-Dist: aiohttp>=3.8.0
40
+ Requires-Dist: aiohttp-sse>=2.1.0
41
+ Provides-Extra: ui
42
+ Requires-Dist: mcp-ui-server>=0.5.0; extra == "ui"
43
+ Provides-Extra: all
44
+ Requires-Dist: mcp-ui-server>=0.5.0; extra == "all"
45
+ Dynamic: author
46
+ Dynamic: author-email
47
+ Dynamic: classifier
48
+ Dynamic: description
49
+ Dynamic: description-content-type
50
+ Dynamic: home-page
51
+ Dynamic: keywords
52
+ Dynamic: license-file
53
+ Dynamic: project-url
54
+ Dynamic: provides-extra
55
+ Dynamic: requires-dist
56
+ Dynamic: requires-python
57
+ Dynamic: summary
58
+
59
+ # Kubectl MCP Server
60
+
61
+ **Control your entire Kubernetes infrastructure through natural language conversations with AI.**
62
+
63
+ Talk to your clusters like you talk to a DevOps expert. Debug crashed pods, optimize costs, deploy applications, audit security, manage Helm charts, and visualize dashboards, all through natural language in your favorite AI assistant or agents.
64
+
65
+ [![GitHub Stars](https://img.shields.io/github/stars/rohitg00/kubectl-mcp-server?style=flat&logo=github)](https://github.com/rohitg00/kubectl-mcp-server)
66
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
67
+ [![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/)
68
+ [![Kubernetes](https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=flat&logo=kubernetes&logoColor=white)](https://kubernetes.io/)
69
+ [![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io)
70
+ [![PyPI](https://img.shields.io/pypi/v/kubectl-mcp-server?color=blue&label=PyPI)](https://pypi.org/project/kubectl-mcp-server/)
71
+ [![npm](https://img.shields.io/npm/v/kubectl-mcp-server?color=green&label=npm)](https://www.npmjs.com/package/kubectl-mcp-server)
72
+ [![Docker](https://img.shields.io/docker/pulls/rohitghumare64/kubectl-mcp-server.svg)](https://hub.docker.com/r/rohitghumare64/kubectl-mcp-server)
73
+ [![Tests](https://img.shields.io/badge/tests-216%20passed-success)](https://github.com/rohitg00/kubectl-mcp-server)
74
+ [![agentregistry](https://img.shields.io/badge/agentregistry-verified-blue?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE1Ljk5MiA2LjAzN2wtMy4wMjEtLjQzOS0xLjM1LTIuNzM2Yy0uMzQ2LS43MDItMS41MDQtLjcwMi0xLjg1IDBMOC40MjEgNS41OTggNS40IDYuMDM3Yy0uNzc2LjExMy0xLjA4OCAxLjA1My0uNTI4IDEuNTkzbDIuMTg2IDIuMTI5LS41MTYgMy4wMWMtLjEzMy43NzUuNjgyIDEuMzY2IDEuMzc4Ljk5OGwyLjcwMi0xLjQyIDIuNzAyIDEuNDJjLjY5Ni4zNjggMS41MTEtLjIyMyAxLjM3OC0uOTk4bC0uNTE2LTMuMDEgMi4xODYtMi4xMjljLjU2LS41NCAwLjI0OC0xLjQ4LS41MjgtMS41OTN6Ii8+PC9zdmc+)](https://aregistry.ai)
75
+
76
+ ---
77
+
78
+ ## Installation
79
+
80
+ ### Quick Start with npx (Recommended - Zero Install)
81
+
82
+ ```bash
83
+ # Run directly without installation - works instantly!
84
+ npx -y kubectl-mcp-server
85
+
86
+ # Or install globally for faster startup
87
+ npm install -g kubectl-mcp-server
88
+ ```
89
+
90
+ ### Or install with pip (Python)
91
+
92
+ ```bash
93
+ # Standard installation
94
+ pip install kubectl-mcp-server
95
+
96
+ # With interactive UI dashboards (recommended)
97
+ pip install kubectl-mcp-server[ui]
98
+ ```
99
+ ---
100
+
101
+ ## 📑 Table of Contents
102
+
103
+ - [What Can You Do?](#what-can-you-do)
104
+ - [Why kubectl-mcp-server?](#why-kubectl-mcp-server)
105
+ - [Live Demos](#live-demos)
106
+ - [Installation](#installation)
107
+ - [Quick Start with npx](#quick-start-with-npx-recommended---zero-install)
108
+ - [Install with pip](#or-install-with-pip-python)
109
+ - [Docker](#docker)
110
+ - [Getting Started](#getting-started)
111
+ - [Quick Setup with Your AI Assistant](#quick-setup-with-your-ai-assistant)
112
+ - [All Supported AI Assistants](#all-supported-ai-assistants)
113
+ - [Complete Feature Set](#complete-feature-set)
114
+ - [Using the CLI](#using-the-cli)
115
+ - [Advanced Configuration](#advanced-configuration)
116
+ - [Optional Features](#optional-interactive-dashboards-6-ui-tools)
117
+ - [Interactive Dashboards](#optional-interactive-dashboards-6-ui-tools)
118
+ - [Browser Automation](#optional-browser-automation-26-tools)
119
+ - [Enterprise](#enterprise-oauth-21-authentication)
120
+ - [Integrations & Ecosystem](#integrations--ecosystem)
121
+ - [In-Cluster Deployment](#in-cluster-deployment)
122
+ - [Multi-Cluster Support](#multi-cluster-support)
123
+ - [Architecture](#architecture)
124
+ - [Development & Testing](#development--testing)
125
+ - [Contributing](#contributing)
126
+ - [Support & Community](#support--community)
127
+
128
+ ---
129
+
130
+ ## What Can You Do?
131
+
132
+ Simply ask your AI assistant in natural language:
133
+
134
+ 💬 **"Why is my pod crashing?"**
135
+ - Instant crash diagnosis with logs, events, and resource analysis
136
+ - Root cause identification with actionable recommendations
137
+
138
+ 💬 **"Deploy a Redis cluster with 3 replicas"**
139
+ - Creates deployment with best practices
140
+ - Configures services, persistent storage, and health checks
141
+
142
+ 💬 **"Show me which pods are wasting resources"**
143
+ - AI-powered cost optimization analysis
144
+ - Resource recommendations with potential savings
145
+
146
+ 💬 **"Which services can't reach the database?"**
147
+ - Network connectivity diagnostics with DNS resolution
148
+ - Service chain tracing from ingress to pods
149
+
150
+ 💬 **"Audit security across all namespaces"**
151
+ - RBAC permission analysis
152
+ - Secret security scanning and pod security policies
153
+
154
+ 💬 **"Show me the cluster dashboard"**
155
+ - Interactive HTML dashboards with live metrics
156
+ - Visual timeline of events and resource usage
157
+
158
+ **131 powerful tools** | **8 workflow prompts** | **8 data resources** | **Works with all major AI assistants**
159
+
160
+ ## Why kubectl-mcp-server?
161
+
162
+ - **🚀 Stop context-switching** - Manage Kubernetes directly from your AI assistant conversations
163
+ - **🧠 AI-powered diagnostics** - Get intelligent troubleshooting, not just raw data
164
+ - **💰 Built-in cost optimization** - Identify waste and get actionable savings recommendations
165
+ - **🔒 Enterprise-ready** - OAuth 2.1 auth, RBAC validation, non-destructive mode, secret masking
166
+ - **⚡ Zero learning curve** - Natural language instead of memorizing kubectl commands
167
+ - **🌐 Universal compatibility** - Works with Claude, Cursor, Windsurf, Copilot, and 15+ other AI tools
168
+ - **📊 Visual insights** - Interactive dashboards and browser automation for web-based tools
169
+ - **☸️ Production-grade** - Deploy in-cluster with kMCP, 216 passing tests, active maintenance
170
+
171
+ From debugging crashed pods to optimizing cluster costs, kubectl-mcp-server is your AI-powered DevOps companion.
172
+
173
+ ## Live Demos
174
+
175
+ ### Claude Desktop
176
+ ![Claude MCP](./docs/claude/claude-mcp.gif)
177
+
178
+ ### Cursor AI
179
+ ![Cursor MCP](./docs/cursor/cursor-mcp.gif)
180
+
181
+ ### Windsurf
182
+ ![Windsurf MCP](./docs/windsurf/windsurf-mcp.gif)
183
+
184
+ ## Installation
185
+
186
+ ### Quick Start with npx (Recommended - Zero Install)
187
+
188
+ ```bash
189
+ # Run directly without installation - works instantly!
190
+ npx -y kubectl-mcp-server
191
+
192
+ # Or install globally for faster startup
193
+ npm install -g kubectl-mcp-server
194
+ ```
195
+
196
+ ### Or install with pip (Python)
197
+
198
+ ```bash
199
+ # Standard installation
200
+ pip install kubectl-mcp-server
201
+
202
+ # With interactive UI dashboards (recommended)
203
+ pip install kubectl-mcp-server[ui]
204
+ ```
205
+
206
+ ### Prerequisites
207
+ - **Python 3.9+** (for pip installation)
208
+ - **Node.js 14+** (for npx installation)
209
+ - **kubectl** installed and configured
210
+ - Access to a Kubernetes cluster
211
+
212
+ ### Docker
213
+
214
+ ```bash
215
+ # Pull and run with Docker
216
+ docker pull rohitghumare64/kubectl-mcp-server:latest
217
+
218
+ # Run with stdio transport
219
+ docker run -i -v $HOME/.kube:/root/.kube:ro rohitghumare64/kubectl-mcp-server:latest
220
+
221
+ # Run with HTTP transport
222
+ docker run -p 8000:8000 -v $HOME/.kube:/root/.kube:ro rohitghumare64/kubectl-mcp-server:latest --transport sse
223
+ ```
224
+
225
+ ## Getting Started
226
+
227
+ ### 1. Test the Server (Optional)
228
+
229
+ Before integrating with your AI assistant, verify the installation:
230
+
231
+ ```bash
232
+ # Check if kubectl is configured
233
+ kubectl cluster-info
234
+
235
+ # Test the MCP server directly
236
+ kubectl-mcp-server info
237
+
238
+ # List all available tools
239
+ kubectl-mcp-server tools
240
+
241
+ # Try calling a tool
242
+ kubectl-mcp-server call get_pods '{"namespace": "kube-system"}'
243
+ ```
244
+
245
+ ### 2. Connect to Your AI Assistant
246
+
247
+ Choose your favorite AI assistant and add the configuration:
248
+
249
+ ## Quick Setup with Your AI Assistant
250
+
251
+ ### Claude Desktop
252
+
253
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
254
+
255
+ ```json
256
+ {
257
+ "mcpServers": {
258
+ "kubernetes": {
259
+ "command": "npx",
260
+ "args": ["-y", "kubectl-mcp-server"]
261
+ }
262
+ }
263
+ }
264
+ ```
265
+
266
+ ### Cursor AI
267
+
268
+ Add to `~/.cursor/mcp.json`:
269
+
270
+ ```json
271
+ {
272
+ "mcpServers": {
273
+ "kubernetes": {
274
+ "command": "npx",
275
+ "args": ["-y", "kubectl-mcp-server"]
276
+ }
277
+ }
278
+ }
279
+ ```
280
+
281
+ ### Windsurf
282
+
283
+ Add to `~/.config/windsurf/mcp.json`:
284
+
285
+ ```json
286
+ {
287
+ "mcpServers": {
288
+ "kubernetes": {
289
+ "command": "npx",
290
+ "args": ["-y", "kubectl-mcp-server"]
291
+ }
292
+ }
293
+ }
294
+ ```
295
+
296
+ ### Using Python Instead of npx
297
+
298
+ ```json
299
+ {
300
+ "mcpServers": {
301
+ "kubernetes": {
302
+ "command": "python",
303
+ "args": ["-m", "kubectl_mcp_tool.mcp_server"],
304
+ "env": {
305
+ "KUBECONFIG": "/path/to/.kube/config"
306
+ }
307
+ }
308
+ }
309
+ }
310
+ ```
311
+
312
+ **More integrations**: GitHub Copilot, Goose, Gemini CLI, Roo Code, and [15+ other clients](#mcp-client-compatibility) —> see [full configuration guide](#all-supported-ai-assistants) below.
313
+
314
+ ### 3. Restart Your AI Assistant
315
+
316
+ After adding the configuration, restart your AI assistant **(GitHub Copilot, Claude Code,Claude Desktop, Cursor, etc.)** to load the MCP server.
317
+
318
+ ### 4. Try These Commands
319
+
320
+ Start a conversation with your AI assistant and try these:
321
+
322
+ **Troubleshooting:**
323
+ ```
324
+ "Show me all pods in the kube-system namespace"
325
+ "Why is the nginx-deployment pod crashing?"
326
+ "Diagnose network connectivity issues in the default namespace"
327
+ ```
328
+
329
+ **Deployments:**
330
+ ```
331
+ "Create a deployment for nginx with 3 replicas"
332
+ "Scale my frontend deployment to 5 replicas"
333
+ "Roll back the api-server deployment to the previous version"
334
+ ```
335
+
336
+ **Cost & Optimization:**
337
+ ```
338
+ "Which pods are using the most resources?"
339
+ "Show me idle resources that are wasting money"
340
+ "Analyze cost optimization opportunities in the production namespace"
341
+ ```
342
+
343
+ **Security:**
344
+ ```
345
+ "Audit RBAC permissions in all namespaces"
346
+ "Check for insecure secrets and configurations"
347
+ "Show me pods running with privileged access"
348
+ ```
349
+
350
+ **Helm:**
351
+ ```
352
+ "List all Helm releases in the cluster"
353
+ "Install Redis from the Bitnami chart repository"
354
+ "Show me the values for my nginx-ingress Helm release"
355
+ ```
356
+
357
+ **Multi-Cluster:**
358
+ ```
359
+ "List all available Kubernetes contexts"
360
+ "Switch to the production cluster context"
361
+ "Show me cluster information and version"
362
+ ```
363
+
364
+ ## MCP Client Compatibility
365
+
366
+ Works seamlessly with **all MCP-compatible AI assistants**:
367
+
368
+ | Client | Status | Client | Status |
369
+ |--------|--------|--------|--------|
370
+ | Claude Desktop | ✅ Native | Claude Code | ✅ Native |
371
+ | Cursor | ✅ Native | Windsurf | ✅ Native |
372
+ | GitHub Copilot | ✅ Native | OpenAI Codex | ✅ Native |
373
+ | Gemini CLI | ✅ Native | Goose | ✅ Native |
374
+ | Roo Code | ✅ Native | Kilo Code | ✅ Native |
375
+ | Amp | ✅ Native | Trae | ✅ Native |
376
+ | OpenCode | ✅ Native | Kiro CLI | ✅ Native |
377
+ | Antigravity | ✅ Native | Clawdbot | ✅ Native |
378
+ | Droid (Factory) | ✅ Native | Any MCP Client | ✅ Compatible |
379
+
380
+ ## All Supported AI Assistants
381
+
382
+ ### Claude Code
383
+
384
+ Add to `~/.config/claude-code/mcp.json`:
385
+
386
+ ```json
387
+ {
388
+ "mcpServers": {
389
+ "kubernetes": {
390
+ "command": "npx",
391
+ "args": ["-y", "kubectl-mcp-server"]
392
+ }
393
+ }
394
+ }
395
+ ```
396
+
397
+ ### GitHub Copilot (VS Code)
398
+
399
+ Add to VS Code `settings.json`:
400
+
401
+ ```json
402
+ {
403
+ "mcp": {
404
+ "servers": {
405
+ "kubernetes": {
406
+ "command": "npx",
407
+ "args": ["-y", "kubectl-mcp-server"]
408
+ }
409
+ }
410
+ }
411
+ }
412
+ ```
413
+
414
+ ### Goose
415
+
416
+ Add to `~/.config/goose/config.yaml`:
417
+
418
+ ```yaml
419
+ extensions:
420
+ kubernetes:
421
+ command: npx
422
+ args:
423
+ - -y
424
+ - kubectl-mcp-server
425
+ ```
426
+
427
+ ### Gemini CLI
428
+
429
+ Add to `~/.gemini/settings.json`:
430
+
431
+ ```json
432
+ {
433
+ "mcpServers": {
434
+ "kubernetes": {
435
+ "command": "npx",
436
+ "args": ["-y", "kubectl-mcp-server"]
437
+ }
438
+ }
439
+ }
440
+ ```
441
+
442
+ ### Roo Code / Kilo Code
443
+
444
+ Add to `~/.config/roo-code/mcp.json` or `~/.config/kilo-code/mcp.json`:
445
+
446
+ ```json
447
+ {
448
+ "mcpServers": {
449
+ "kubernetes": {
450
+ "command": "npx",
451
+ "args": ["-y", "kubectl-mcp-server"]
452
+ }
453
+ }
454
+ }
455
+ ```
456
+
457
+ ## Complete Feature Set
458
+
459
+ ### 131 MCP Tools for Complete Kubernetes Management
460
+
461
+ | Category | Tools |
462
+ |----------|-------|
463
+ | **Pods** | `get_pods`, `get_logs`, `get_pod_events`, `check_pod_health`, `exec_in_pod`, `cleanup_pods`, `get_pod_conditions`, `get_previous_logs` |
464
+ | **Deployments** | `get_deployments`, `create_deployment`, `scale_deployment`, `kubectl_rollout`, `restart_deployment` |
465
+ | **Workloads** | `get_statefulsets`, `get_daemonsets`, `get_jobs`, `get_replicasets` |
466
+ | **Services & Networking** | `get_services`, `get_ingress`, `get_endpoints`, `diagnose_network_connectivity`, `check_dns_resolution`, `trace_service_chain` |
467
+ | **Storage** | `get_persistent_volumes`, `get_pvcs`, `get_storage_classes` |
468
+ | **Config** | `get_configmaps`, `get_secrets`, `get_resource_quotas`, `get_limit_ranges` |
469
+ | **Cluster** | `get_nodes`, `get_namespaces`, `get_cluster_info`, `get_cluster_version`, `health_check`, `get_node_metrics`, `get_pod_metrics` |
470
+ | **RBAC & Security** | `get_rbac_roles`, `get_cluster_roles`, `get_service_accounts`, `audit_rbac_permissions`, `check_secrets_security`, `get_pod_security_info`, `get_admission_webhooks` |
471
+ | **CRDs** | `get_crds`, `get_priority_classes` |
472
+ | **Helm Releases** | `helm_list`, `helm_status`, `helm_history`, `helm_get_values`, `helm_get_manifest`, `helm_get_notes`, `helm_get_hooks`, `helm_get_all` |
473
+ | **Helm Charts** | `helm_show_chart`, `helm_show_values`, `helm_show_readme`, `helm_show_crds`, `helm_show_all`, `helm_search_repo`, `helm_search_hub` |
474
+ | **Helm Repos** | `helm_repo_list`, `helm_repo_add`, `helm_repo_remove`, `helm_repo_update` |
475
+ | **Helm Operations** | `install_helm_chart`, `upgrade_helm_chart`, `uninstall_helm_chart`, `helm_rollback`, `helm_test`, `helm_template`, `helm_template_apply` |
476
+ | **Helm Development** | `helm_create`, `helm_lint`, `helm_package`, `helm_pull`, `helm_dependency_list`, `helm_dependency_update`, `helm_dependency_build`, `helm_version`, `helm_env` |
477
+ | **Context** | `get_current_context`, `switch_context`, `list_contexts`, `list_kubeconfig_contexts` |
478
+ | **Diagnostics** | `diagnose_pod_crash`, `detect_pending_pods`, `get_evicted_pods`, `compare_namespaces` |
479
+ | **Operations** | `kubectl_apply`, `kubectl_create`, `kubectl_describe`, `kubectl_patch`, `delete_resource`, `kubectl_cp`, `backup_resource`, `label_resource`, `annotate_resource`, `taint_node`, `wait_for_condition` |
480
+ | **Autoscaling** | `get_hpa`, `get_pdb` |
481
+ | **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` |
482
+ | **Advanced** | `kubectl_generic`, `kubectl_explain`, `get_api_resources`, `port_forward`, `get_resource_usage`, `node_management` |
483
+ | **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` |
484
+
485
+ ### MCP Resources
486
+
487
+ Access Kubernetes data as browsable resources:
488
+
489
+ | Resource URI | Description |
490
+ |--------------|-------------|
491
+ | `kubeconfig://contexts` | List all available kubectl contexts |
492
+ | `kubeconfig://current-context` | Get current active context |
493
+ | `namespace://current` | Get current namespace |
494
+ | `namespace://list` | List all namespaces |
495
+ | `cluster://info` | Get cluster information |
496
+ | `cluster://nodes` | Get detailed node information |
497
+ | `cluster://version` | Get Kubernetes version |
498
+ | `cluster://api-resources` | List available API resources |
499
+ | `manifest://deployments/{ns}/{name}` | Get deployment YAML |
500
+ | `manifest://services/{ns}/{name}` | Get service YAML |
501
+ | `manifest://pods/{ns}/{name}` | Get pod YAML |
502
+ | `manifest://configmaps/{ns}/{name}` | Get ConfigMap YAML |
503
+ | `manifest://secrets/{ns}/{name}` | Get secret YAML (data masked) |
504
+ | `manifest://ingresses/{ns}/{name}` | Get ingress YAML |
505
+
506
+ ### MCP Prompts
507
+
508
+ Pre-built workflow prompts for common Kubernetes operations:
509
+
510
+ | Prompt | Description |
511
+ |--------|-------------|
512
+ | `troubleshoot_workload` | Comprehensive troubleshooting guide for pods/deployments |
513
+ | `deploy_application` | Step-by-step deployment workflow |
514
+ | `security_audit` | Security scanning and RBAC analysis workflow |
515
+ | `cost_optimization` | Resource optimization and cost analysis workflow |
516
+ | `disaster_recovery` | Backup and recovery planning workflow |
517
+ | `debug_networking` | Network debugging for services and connectivity |
518
+ | `scale_application` | Scaling guide with HPA/VPA best practices |
519
+ | `upgrade_cluster` | Kubernetes cluster upgrade planning |
520
+
521
+ ### Key Capabilities
522
+
523
+ - 🤖 **131 Powerful Tools** - Complete Kubernetes management from pods to security
524
+ - 🎯 **8 AI Workflow Prompts** - Pre-built workflows for common operations
525
+ - 📊 **8 MCP Resources** - Browsable Kubernetes data exposure
526
+ - 🎨 **6 Interactive Dashboards** - HTML UI tools for visual cluster management
527
+ - 🌐 **26 Browser Tools** - Web automation with cloud provider support
528
+ - ⚡ **Multi-Transport** - stdio, SSE, HTTP, streamable-http
529
+ - 🔐 **Security First** - Non-destructive mode, secret masking, RBAC validation
530
+ - 🏥 **Advanced Diagnostics** - AI-powered troubleshooting and cost optimization
531
+ - ☸️ **Multi-Cluster** - Target any cluster via context parameter in every tool
532
+ - 🎡 **Full Helm v3** - Complete chart lifecycle management
533
+ - 🔧 **Powerful CLI** - Shell-friendly tool discovery and direct calling
534
+ - 🐳 **Cloud Native** - Deploy in-cluster with kMCP or kagent
535
+
536
+ ## Using the CLI
537
+
538
+ The built-in CLI lets you explore and test tools without an AI assistant:
539
+
540
+ ```bash
541
+ # List all tools with descriptions
542
+ kubectl-mcp-server tools -d
543
+
544
+ # Search for pod-related tools
545
+ kubectl-mcp-server grep "*pod*"
546
+
547
+ # Show specific tool schema
548
+ kubectl-mcp-server tools get_pods
549
+
550
+ # Call a tool directly
551
+ kubectl-mcp-server call get_pods '{"namespace": "kube-system"}'
552
+
553
+ # Pipe JSON from stdin
554
+ echo '{"namespace": "default"}' | kubectl-mcp-server call get_pods
555
+
556
+ # Check dependencies
557
+ kubectl-mcp-server doctor
558
+
559
+ # Show/switch Kubernetes context
560
+ kubectl-mcp-server context
561
+ kubectl-mcp-server context minikube
562
+
563
+ # List resources and prompts
564
+ kubectl-mcp-server resources
565
+ kubectl-mcp-server prompts
566
+
567
+ # Show server info
568
+ kubectl-mcp-server info
569
+ ```
570
+
571
+ ### CLI Features
572
+
573
+ - **Structured errors**: Actionable error messages with suggestions
574
+ - **Colorized output**: Human-readable with JSON mode for scripting (`--json`)
575
+ - **NO_COLOR support**: Respects `NO_COLOR` environment variable
576
+ - **Stdin support**: Pipe JSON arguments to commands
577
+
578
+ ## Advanced Configuration
579
+
580
+ ### Transport Modes
581
+
582
+ The server supports multiple transport protocols:
583
+
584
+ ```bash
585
+ # stdio (default) - Best for Claude Desktop, Cursor, Windsurf
586
+ kubectl-mcp-server
587
+ # or: python -m kubectl_mcp_tool.mcp_server
588
+
589
+ # SSE - Server-Sent Events for web clients
590
+ kubectl-mcp-server --transport sse --port 8000
591
+
592
+ # HTTP - Standard HTTP for REST clients
593
+ kubectl-mcp-server --transport http --port 8000
594
+
595
+ # streamable-http - For agentgateway integration
596
+ kubectl-mcp-server --transport streamable-http --port 8000
597
+ ```
598
+
599
+ **Transport Options:**
600
+ - `--transport`: Choose from `stdio`, `sse`, `http`, `streamable-http` (default: `stdio`)
601
+ - `--host`: Bind address (default: `0.0.0.0`)
602
+ - `--port`: Port for network transports (default: `8000`)
603
+ - `--non-destructive`: Enable read-only mode (blocks delete, apply, create operations)
604
+
605
+ ### Environment Variables
606
+
607
+ **Core Settings:**
608
+
609
+ | Variable | Description | Default |
610
+ |----------|-------------|---------|
611
+ | `KUBECONFIG` | Path to kubeconfig file | `~/.kube/config` |
612
+ | `MCP_DEBUG` | Enable verbose logging | `false` |
613
+ | `MCP_LOG_FILE` | Log file path | None (stdout) |
614
+
615
+ **Authentication (Enterprise):**
616
+
617
+ | Variable | Description | Default |
618
+ |----------|-------------|---------|
619
+ | `MCP_AUTH_ENABLED` | Enable OAuth 2.1 authentication | `false` |
620
+ | `MCP_AUTH_ISSUER` | OAuth 2.0 Authorization Server URL | - |
621
+ | `MCP_AUTH_JWKS_URI` | JWKS endpoint URL | Auto-derived |
622
+ | `MCP_AUTH_AUDIENCE` | Expected token audience | `kubectl-mcp-server` |
623
+ | `MCP_AUTH_REQUIRED_SCOPES` | Required OAuth scopes | `mcp:tools` |
624
+
625
+ **Browser Automation (Optional):**
626
+
627
+ | Variable | Description | Default |
628
+ |----------|-------------|---------|
629
+ | `MCP_BROWSER_ENABLED` | Enable browser automation tools | `false` |
630
+ | `MCP_BROWSER_PROVIDER` | Cloud provider (browserbase/browseruse) | None |
631
+ | `MCP_BROWSER_PROFILE` | Persistent profile path | None |
632
+ | `MCP_BROWSER_CDP_URL` | Remote CDP WebSocket URL | None |
633
+ | `MCP_BROWSER_PROXY` | Proxy server URL | None |
634
+
635
+ ## Optional: Interactive Dashboards (6 UI Tools)
636
+
637
+ Get beautiful HTML dashboards for visual cluster management.
638
+
639
+ **Installation:**
640
+
641
+ ```bash
642
+ # Install with UI support
643
+ pip install kubectl-mcp-server[ui]
644
+ ```
645
+
646
+ **6 Dashboard Tools:**
647
+ - 📊 `show_pods_dashboard_ui` - Real-time pod status table
648
+ - 📝 `show_pod_logs_ui` - Interactive log viewer with search
649
+ - 🎯 `show_cluster_overview_ui` - Complete cluster dashboard
650
+ - ⚡ `show_events_timeline_ui` - Events timeline with filtering
651
+ - 📄 `show_resource_yaml_ui` - YAML viewer with syntax highlighting
652
+ - 📸 `render_k8s_dashboard_screenshot` - Export dashboards as PNG
653
+
654
+ **Features:**
655
+ - 🎨 Dark theme optimized for terminals (Catppuccin)
656
+ - 🔄 Graceful fallback to JSON for incompatible clients
657
+ - 🖼️ Screenshot rendering for universal compatibility
658
+ - 🚀 Zero external dependencies
659
+
660
+ **Works With**: Goose, LibreChat, Nanobot (full HTML UI) | Claude Desktop, Cursor, others (JSON + screenshots)
661
+
662
+ ## Optional: Browser Automation (26 Tools)
663
+
664
+ Automate web-based Kubernetes operations with [agent-browser](https://github.com/vercel-labs/agent-browser) integration.
665
+
666
+ **Quick Setup:**
667
+
668
+ ```bash
669
+ # Install agent-browser
670
+ npm install -g agent-browser
671
+ agent-browser install
672
+
673
+ # Enable browser tools
674
+ export MCP_BROWSER_ENABLED=true
675
+ kubectl-mcp-server
676
+ ```
677
+
678
+ **What You Can Do:**
679
+ - 🌐 Test deployed apps via Ingress URLs
680
+ - 📸 Screenshot Grafana, ArgoCD, or any K8s dashboard
681
+ - ☁️ Automate cloud console operations (EKS, GKE, AKS)
682
+ - 🏥 Health check web applications
683
+ - 📄 Export monitoring dashboards as PDF
684
+ - 🔐 Test authentication flows with persistent sessions
685
+
686
+ **26 Available Tools**: `browser_open`, `browser_screenshot`, `browser_click`, `browser_fill`, `browser_test_ingress`, `browser_screenshot_grafana`, `browser_health_check`, and [19 more](https://github.com/rohitg00/kubectl-mcp-server#browser-tools)
687
+
688
+ **Advanced Features**:
689
+ - Cloud providers: Browserbase, Browser Use
690
+ - Persistent browser profiles
691
+ - Remote CDP connections
692
+ - Session management
693
+
694
+ ## Enterprise: OAuth 2.1 Authentication
695
+
696
+ Secure your MCP server with OAuth 2.1 authentication (RFC 9728).
697
+
698
+ ```bash
699
+ export MCP_AUTH_ENABLED=true
700
+ export MCP_AUTH_ISSUER=https://your-idp.example.com
701
+ export MCP_AUTH_AUDIENCE=kubectl-mcp-server
702
+ kubectl-mcp-server --transport http --port 8000
703
+ ```
704
+
705
+ **Supported Identity Providers**: Okta, Auth0, Keycloak, Microsoft Entra ID, Google OAuth, and any OIDC-compliant provider.
706
+
707
+ **Use Case**: Multi-tenant environments, compliance requirements, audit logging.
708
+
709
+ ## Integrations & Ecosystem
710
+
711
+ ### Docker MCP Toolkit
712
+
713
+ Works with [Docker MCP Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/):
714
+
715
+ ```bash
716
+ docker mcp server add kubectl-mcp-server mcp/kubectl-mcp-server:latest
717
+ docker mcp server configure kubectl-mcp-server --volume "$HOME/.kube:/root/.kube:ro"
718
+ docker mcp server enable kubectl-mcp-server
719
+ docker mcp client connect claude
720
+ ```
721
+
722
+ ### agentregistry
723
+
724
+ Install from the centralized [agentregistry](https://aregistry.ai):
725
+
726
+ ```bash
727
+ # Install arctl CLI
728
+ curl -fsSL https://raw.githubusercontent.com/agentregistry-dev/agentregistry/main/scripts/install.sh | bash
729
+
730
+ # Install kubectl-mcp-server
731
+ arctl mcp install io.github.rohitg00/kubectl-mcp-server
732
+ ```
733
+
734
+ **Available via**: PyPI (`uvx`), npm (`npx`), OCI (`docker.io/rohitghumare64/kubectl-mcp-server`)
735
+
736
+ ### agentgateway
737
+
738
+ Route to multiple MCP servers through [agentgateway](https://github.com/agentgateway/agentgateway):
739
+
740
+ ```bash
741
+ # Start with streamable-http
742
+ kubectl-mcp-server --transport streamable-http --port 8000
743
+
744
+ # Configure gateway
745
+ cat > gateway.yaml <<EOF
746
+ binds:
747
+ - port: 3000
748
+ listeners:
749
+ - routes:
750
+ - backends:
751
+ - mcp:
752
+ targets:
753
+ - name: kubectl-mcp-server
754
+ mcp:
755
+ host: http://localhost:8000/mcp
756
+ EOF
757
+
758
+ # Start gateway
759
+ agentgateway --config gateway.yaml
760
+ ```
761
+
762
+ Connect clients to `http://localhost:3000/mcp` for unified access to all 131 tools.
763
+
764
+ ## In-Cluster Deployment
765
+
766
+ ### Option 1: kMCP (Recommended)
767
+
768
+ Deploy with [kMCP](https://github.com/kagent-dev/kmcp) - a control plane for MCP servers:
769
+
770
+ ```bash
771
+ # Install kMCP
772
+ curl -fsSL https://raw.githubusercontent.com/kagent-dev/kmcp/refs/heads/main/scripts/get-kmcp.sh | bash
773
+ kmcp install
774
+
775
+ # Deploy kubectl-mcp-server (easiest)
776
+ kmcp deploy package --deployment-name kubectl-mcp-server \
777
+ --manager npx --args kubectl-mcp-server
778
+
779
+ # Or with Docker image
780
+ kmcp deploy --file deploy/kmcp/kmcp.yaml --image rohitghumare64/kubectl-mcp-server:latest
781
+ ```
782
+
783
+ See [kMCP quickstart](https://kagent.dev/docs/kmcp/quickstart) for details.
784
+
785
+ ### Option 2: Standard Kubernetes
786
+
787
+ Deploy with kubectl/kustomize:
788
+
789
+ ```bash
790
+ # Using kustomize (recommended)
791
+ kubectl apply -k deploy/kubernetes/
792
+
793
+ # Or individual manifests
794
+ kubectl apply -f deploy/kubernetes/namespace.yaml
795
+ kubectl apply -f deploy/kubernetes/rbac.yaml
796
+ kubectl apply -f deploy/kubernetes/deployment.yaml
797
+ kubectl apply -f deploy/kubernetes/service.yaml
798
+
799
+ # Access via port-forward
800
+ kubectl port-forward -n kubectl-mcp svc/kubectl-mcp-server 8000:8000
801
+ ```
802
+
803
+ See [deploy/](deploy/) directory for all manifests and configuration options.
804
+
805
+ ### Option 3: kagent (AI Agent Framework)
806
+
807
+ Integrate with [kagent](https://github.com/kagent-dev/kagent) - a CNCF Kubernetes-native AI agent framework:
808
+
809
+ ```bash
810
+ # Install kagent
811
+ brew install kagent
812
+ kagent install --profile demo
813
+
814
+ # Register as ToolServer
815
+ kubectl apply -f deploy/kagent/toolserver-stdio.yaml
816
+
817
+ # Open dashboard
818
+ kagent dashboard
819
+ ```
820
+
821
+ Your AI agents now have access to all 131 Kubernetes tools. See [kagent quickstart](https://kagent.dev/docs/kagent/getting-started/quickstart).
822
+
823
+ ## Architecture
824
+
825
+ ```
826
+ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
827
+ │ AI Assistant │────▶│ MCP Server │────▶│ Kubernetes API │
828
+ │ (Claude/Cursor) │◀────│ (kubectl-mcp) │◀────│ (kubectl) │
829
+ └─────────────────┘ └──────────────────┘ └─────────────────┘
830
+ ```
831
+
832
+ The MCP server implements the [Model Context Protocol](https://github.com/modelcontextprotocol/spec), translating natural language requests into kubectl operations.
833
+
834
+ ### Modular Structure
835
+
836
+ ```
837
+ kubectl_mcp_tool/
838
+ ├── mcp_server.py # Main server (FastMCP, transports)
839
+ ├── tools/ # 131 MCP tools organized by category
840
+ │ ├── pods.py # Pod management & diagnostics
841
+ │ ├── deployments.py # Deployments, StatefulSets, DaemonSets
842
+ │ ├── core.py # Namespaces, ConfigMaps, Secrets
843
+ │ ├── cluster.py # Context/cluster management
844
+ │ ├── networking.py # Services, Ingress, NetworkPolicies
845
+ │ ├── storage.py # PVCs, StorageClasses, PVs
846
+ │ ├── security.py # RBAC, ServiceAccounts, PodSecurity
847
+ │ ├── helm.py # Complete Helm v3 operations
848
+ │ ├── operations.py # kubectl apply/patch/describe/etc
849
+ │ ├── diagnostics.py # Metrics, namespace comparison
850
+ │ ├── cost.py # Resource optimization & cost analysis
851
+ │ └── ui.py # MCP-UI interactive dashboards
852
+ ├── resources/ # 8 MCP Resources for data exposure
853
+ ├── prompts/ # 8 MCP Prompts for workflows
854
+ └── cli/ # CLI interface
855
+ ```
856
+
857
+ ## Multi-Cluster Support
858
+
859
+ Seamlessly manage multiple Kubernetes clusters through natural language. **Every tool** supports an optional `context` parameter to target any cluster without switching contexts.
860
+
861
+ ### Context Parameter (v1.15.0)
862
+
863
+ All 131 tools accept an optional `context` parameter to target specific clusters:
864
+
865
+ **Talk to your AI assistant:**
866
+ ```
867
+ "List pods in the production cluster"
868
+ "Get deployments from staging context"
869
+ "Show logs from the api-pod in the dev cluster"
870
+ "Compare namespaces between production and staging clusters"
871
+ ```
872
+
873
+ **Direct tool calls with context:**
874
+ ```bash
875
+ # Target a specific cluster context
876
+ kubectl-mcp-server call get_pods '{"namespace": "default", "context": "production"}'
877
+
878
+ # Get deployments from staging
879
+ kubectl-mcp-server call get_deployments '{"namespace": "app", "context": "staging"}'
880
+
881
+ # Install Helm chart to production cluster
882
+ kubectl-mcp-server call install_helm_chart '{"name": "redis", "chart": "bitnami/redis", "namespace": "cache", "context": "production"}'
883
+
884
+ # Compare resources across clusters
885
+ kubectl-mcp-server call compare_namespaces '{"namespace1": "prod-ns", "namespace2": "staging-ns", "context": "production"}'
886
+ ```
887
+
888
+ ### Context Management
889
+
890
+ **Talk to your AI assistant:**
891
+ ```
892
+ "List all available Kubernetes contexts"
893
+ "Switch to the production cluster"
894
+ "Show me details about the staging context"
895
+ "What's the current cluster I'm connected to?"
896
+ ```
897
+
898
+ **Or use the CLI directly:**
899
+ ```bash
900
+ kubectl-mcp-server context # Show current context
901
+ kubectl-mcp-server context production # Switch context
902
+ kubectl-mcp-server call list_contexts_tool # List all contexts via MCP
903
+ ```
904
+
905
+ ### How It Works
906
+
907
+ - If `context` is omitted, the tool uses your current kubectl context
908
+ - If `context` is specified, the tool targets that cluster directly
909
+ - Response includes `"context": "production"` or `"context": "current"` for clarity
910
+ - Works with all kubeconfig setups and respects `KUBECONFIG` environment variable
911
+ - No need to switch contexts for cross-cluster operations
912
+
913
+ ## Development & Testing
914
+
915
+ ### Setup Development Environment
916
+
917
+ ```bash
918
+ # Clone the repository
919
+ git clone https://github.com/rohitg00/kubectl-mcp-server.git
920
+ cd kubectl-mcp-server
921
+
922
+ # Create virtual environment
923
+ python -m venv venv
924
+ source venv/bin/activate # On Windows: venv\Scripts\activate
925
+
926
+ # Install development dependencies
927
+ pip install -r requirements-dev.txt
928
+ ```
929
+
930
+ ### Running Tests
931
+
932
+ ```bash
933
+ # Run all tests
934
+ pytest tests/ -v
935
+
936
+ # Run specific test file
937
+ pytest tests/test_tools.py -v
938
+
939
+ # Run with coverage
940
+ pytest tests/ --cov=kubectl_mcp_tool --cov-report=html
941
+
942
+ # Run only unit tests
943
+ pytest tests/ -v -m unit
944
+ ```
945
+
946
+ ### Test Structure
947
+
948
+ ```
949
+ tests/
950
+ ├── __init__.py # Test package
951
+ ├── conftest.py # Shared fixtures and mocks
952
+ ├── test_tools.py # Unit tests for 131 MCP tools
953
+ ├── test_resources.py # Tests for 8 MCP Resources
954
+ ├── test_prompts.py # Tests for 8 MCP Prompts
955
+ └── test_server.py # Server initialization tests
956
+ ```
957
+
958
+ **216 tests covering**: tool registration, resource exposure, prompt generation, server initialization, non-destructive mode, secret masking, error handling, transport methods, CLI commands, and browser automation.
959
+
960
+ ### Code Quality
961
+
962
+ ```bash
963
+ # Format code
964
+ black kubectl_mcp_tool tests
965
+
966
+ # Sort imports
967
+ isort kubectl_mcp_tool tests
968
+
969
+ # Lint
970
+ flake8 kubectl_mcp_tool tests
971
+
972
+ # Type checking
973
+ mypy kubectl_mcp_tool
974
+ ```
975
+
976
+ ## Contributing
977
+
978
+ We ❤️ contributions! Whether it's bug reports, feature requests, documentation improvements, or code contributions.
979
+
980
+ **Ways to contribute:**
981
+ - 🐛 Report bugs via [GitHub Issues](https://github.com/rohitg00/kubectl-mcp-server/issues)
982
+ - 💡 Suggest features or improvements
983
+ - 📝 Improve documentation
984
+ - 🔧 Submit pull requests
985
+ - ⭐ Star the project if you find it useful!
986
+
987
+ **Development setup**: See [Development & Testing](#development--testing) section above.
988
+
989
+ **Before submitting a PR:**
990
+ 1. Run tests: `pytest tests/ -v`
991
+ 2. Format code: `black kubectl_mcp_tool tests`
992
+ 3. Check linting: `flake8 kubectl_mcp_tool tests`
993
+
994
+ ## Support & Community
995
+
996
+ - 📖 [Documentation](https://github.com/rohitg00/kubectl-mcp-server#readme)
997
+ - 💬 [GitHub Discussions](https://github.com/rohitg00/kubectl-mcp-server/discussions)
998
+ - 🐛 [Issue Tracker](https://github.com/rohitg00/kubectl-mcp-server/issues)
999
+ - 🎯 [Feature Requests](https://github.com/rohitg00/kubectl-mcp-server/issues/new)
1000
+ - 🌟 [agentregistry Profile](https://aregistry.ai)
1001
+
1002
+ ## License
1003
+
1004
+ MIT License - see [LICENSE](LICENSE) for details.
1005
+
1006
+ ## Links & Resources
1007
+
1008
+ **Package Repositories:**
1009
+ - 🐍 [PyPI Package](https://pypi.org/project/kubectl-mcp-server/)
1010
+ - 📦 [npm Package](https://www.npmjs.com/package/kubectl-mcp-server)
1011
+ - 🐳 [Docker Hub](https://hub.docker.com/r/rohitghumare64/kubectl-mcp-server)
1012
+
1013
+ **Project:**
1014
+ - 🔧 [GitHub Repository](https://github.com/rohitg00/kubectl-mcp-server)
1015
+ - 🐛 [Issue Tracker](https://github.com/rohitg00/kubectl-mcp-server/issues)
1016
+ - 📋 [Changelog](https://github.com/rohitg00/kubectl-mcp-server/releases)
1017
+
1018
+ **Ecosystem:**
1019
+ - 📚 [Model Context Protocol](https://modelcontextprotocol.io)
1020
+ - ☸️ [Kubernetes Documentation](https://kubernetes.io/docs)
1021
+
1022
+ ---
1023
+
1024
+ **Made with ❤️ for the Kubernetes and AI community**
1025
+
1026
+ If **kubectl-mcp-server** makes your DevOps life easier, give it a ⭐ on [GitHub](https://github.com/rohitg00/kubectl-mcp-server)!