Pod Operations: Get logs, execute commands, and set up port forwarding
Model Context Protocol (MCP) server for Kubernetes
स्टार
2
टूल
—
अपटाइम
—
Context Management: List, get, and switch between Kubernetes contexts
Cluster Information: Get API resources and cluster health status
Multiple Authentication Modes: Support for kubeconfig, in-cluster, OAuth 2.1, and federated multi-cluster authentication
Multi-Cluster Support: Federation with Cluster API (CAPI) for managing workload clusters from a management cluster
Multiple Transport Types: Support for stdio and streamable HTTP
Safety Features: Non-destructive mode, dry-run capability, and operation restrictions
OAuth 2.1 Support: Secure token-based authentication with Dex OIDC (default) and Google OAuth providers
Production-Grade Observability: OpenTelemetry instrumentation with Prometheus metrics and distributed tracing
Installation
go install github.com/giantswarm/mcp-kubernetes@latest
Usage
Basic Usage
# Start the MCP server with default settings (stdio transport, kubeconfig authentication)
mcp-kubernetes serve
# Start with debug logging
mcp-kubernetes serve --debug
# Start with in-cluster authentication (when running as a pod in Kubernetes)
mcp-kubernetes serve --in-cluster
Authentication Modes
The server supports multiple authentication modes:
Kubeconfig Authentication (Default)
Uses standard kubeconfig file authentication. The server will look for kubeconfig in the default locations (~/.kube/config) or use the KUBECONFIG environment variable.
# Use default kubeconfig
mcp-kubernetes serve
# Use specific kubeconfig (via environment variable)
KUBECONFIG=/path/to/kubeconfig mcp-kubernetes serve
In-Cluster Authentication
Uses service account token when running inside a Kubernetes pod. This mode automatically uses the mounted service account credentials.
See docs/oauth.md for detailed OAuth setup and configuration.
Federation (Multi-Cluster with CAPI)
Enables access to multiple workload clusters through a management cluster using Cluster API (CAPI). The server discovers workload clusters dynamically and uses user impersonation for RBAC enforcement on each cluster.
For organizations where workload cluster API servers are configured with OIDC authentication, an alternative authentication mode forwards the user's SSO token directly to workload clusters instead of using impersonation:
# Helm values for SSO passthrough mode
capiMode:
enabled: true
workloadClusterAuth:
mode: "sso-passthrough" # Instead of default "impersonation"
caSecretSuffix: "-ca" # CA-only secrets (no admin credentials needed)
Aspect
Impersonation (default)
SSO Passthrough
ServiceAccount privileges
High (kubeconfig secrets)
Low (CA secrets only)
Kubeconfig secret access
Required
Not required
WC API server requirements
None
OIDC configuration required
Audit trail
Shows impersonated user
Shows direct OIDC user
Fallback behavior
N/A
None (by design)
Important: There is no automatic fallback between modes. If SSO passthrough fails (e.g., WC API server rejects the token), the operation fails. This is intentional - mixing modes would require maintaining access to admin credentials, defeating the security benefit.
active_port_forward_sessions - Active port-forward sessions gauge
See docs/observability.md for detailed metrics documentation, Prometheus queries, and alerting examples.
Transport Types
Standard I/O (Default)
For local development and direct integration with MCP clients:
mcp-kubernetes serve --transport stdio
Streamable HTTP (Recommended for Production)
For network-accessible deployments. The HTTP transports refuse to start without
authentication: OAuth 2.1 (see docs/oauth.md) or a static
bearer token of at least 32 characters, which every request to /mcp must send
as Authorization: Bearer <token>:
The sse transport authenticates with the bearer token only.
Configuration Options
# Safety and operation modes
--non-destructive # Enable non-destructive mode (default: true)
--dry-run # Enable dry run mode (default: false)
# Performance tuning
--qps-limit 20.0 # QPS limit for Kubernetes API calls
--burst-limit 30 # Burst limit for Kubernetes API calls
# Authentication
--in-cluster # Use in-cluster authentication instead of kubeconfig
--enable-oauth # Enable OAuth 2.1 authentication (for HTTP transports)
--oauth-base-url string # OAuth base URL (e.g., https://mcp.example.com)
--google-client-id string # Google OAuth Client ID
--google-client-secret string # Google OAuth Client Secret
--registration-token string # OAuth client registration access token
--allow-public-registration # Allow unauthenticated OAuth client registration
# Debugging
--debug # Enable debug logging
# Transport-specific options
--transport string # Transport type: stdio or streamable-http
--http-addr :8080 # HTTP server address (for streamable-http)
--http-endpoint /mcp # HTTP endpoint path (default: /mcp)
--max-request-size 5242880 # Largest request body in bytes, larger gets 413 (default: 5 MiB, env MAX_REQUEST_SIZE)
--disable-streaming # Disable streaming for streamable-http transport
Running in Kubernetes
The recommended way to deploy mcp-kubernetes in a Kubernetes cluster is using the Helm chart, which handles RBAC, Ingress, TLS, and OAuth configuration.
The endpoint path is configurable via mcpKubernetes.httpEndpoint in the Helm values (default: /mcp).
Available Tools
Every tool's description and input schema, as a model reads them: docs/tools.md (generated with make tools-doc, kept current by a test).
The MCP server provides the following tools. The 15 tools that previously had a kubernetes_ prefix remain invokable under their old kubernetes_<name> names as deprecated backward-compat aliases, but are hidden from tools/list so new clients only see the bare names below. The aliases will be removed in a future release; please migrate.
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
सवाल
MCP Kubernetes कैसे इंस्टॉल करें?
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
क्या MCP Kubernetes के लिए API key चाहिए?
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
MCP Kubernetes कौन सा ट्रांसपोर्ट इस्तेमाल करता है?
MCP Kubernetes stdio पर लोकल चलता है।
MCP Kubernetes की पिछली जाँच कब हुई थी?
पिछली जाँच 2026-11-09 को हुई। Model Context Protocol (MCP) server for Kubernetes