What is K8s MCP Server?
K8s MCP Server is an AI-friendly Kubernetes access tool that supports enhanced port‑forward management, headless services, and kubectl‑inspired output formats. It is designed for AI agents and developers who need efficient, context‑aware interaction with Kubernetes clusters.
How to use K8s MCP Server?
Install dependencies with pip install -e ., set environment variables such as KUBECONFIG_URLS and PORT_FORWARD_CONFIG_URL, then run python main.py. The server provides MCP tools for reading, modifying, and discovering resources, along with port‑forward session management.
Key features of K8s MCP Server
- kubectl‑inspired output formats (table, wide, json, yaml, custom‑columns, jsonpath)
- Natural‑language resource kind discovery for CRDs and built‑in resources
- URL‑based port‑forward configuration via local files or GitHub Gists
- Headless service support with direct pod targeting via label selectors
- Token‑efficient AI‑optimized output and multi‑format config files (YAML, JSON, TOML)
- In‑memory port‑forward session tracking with list and teardown capabilities
Use cases of K8s MCP Server
- AI agents perform cluster overview, application debugging, and safe deployment updates
- Automated port‑forward setup for AI workflows (e.g., connecting to a Druid service in development)
- Resource cleanup and security audits using read‑only or modify tools
- Performance troubleshooting and disaster recovery with structured tool workflows
- Multi‑cluster resource discovery and exploration without manual kubectl commands
コメント