- Kubernetes MCP Server
Kubernetes MCP Server
Content
Kubernetes MCP Server
This is a Model Context Protocol (MCP) server that provides comprehensive Kubernetes functionality through the MCP Python SDK. It allows you to interact with your Kubernetes cluster using natural language through an MCP client.
Features
The server provides a wide range of Kubernetes operations organized into logical modules:
Pod Operations
- Get pods with filtering and output format options
- Describe specific pods
- Get pod logs with various options
- Execute commands in pods
- Get pod metrics
Deployment Operations
- Get deployments with filtering and output format options
- Describe specific deployments
- Scale deployments
- Manage deployment rollouts (status, history, restart, undo)
- Get deployment metrics
Service Operations
- Get services with filtering and output format options
- Describe specific services
- Expose deployments as services
- Port forward to services
Namespace Operations
- Get namespaces with filtering
- Describe specific namespaces
- Create and delete namespaces
- Get namespace resource quotas
Cluster Operations
- Get cluster information
- Get and describe nodes
- Manage node scheduling (cordon/uncordon)
- Drain nodes for maintenance
- Get cluster metrics
Prerequisites
- Python 3.7+
- kubectl installed and configured
- Access to a Kubernetes cluster
- MCP client (e.g., Claude Desktop)
Installation
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
Usage
Running the Server
-
Development mode with MCP Inspector:
python -m mcp.inspector src/k8s_mcp_server.py -
Install in Claude Desktop:
python -m mcp.install src/k8s_mcp_server.py -
Run directly:
python src/k8s_mcp_server.py
Using the Tools
Once connected through an MCP client, you can use natural language to interact with your Kubernetes cluster. For example:
- "Get all pods in the default namespace"
- "Describe the deployment named 'nginx' in the 'web' namespace"
- "Get logs from the 'frontend' pod in the 'production' namespace"
- "Scale the 'backend' deployment to 3 replicas"
- "Create a new namespace called 'staging' with label environment=staging"
Project Structure
src/
├── k8s_mcp_server.py # Main server entry point
├── k8s_tools/ # Tool modules
│ ├── __init__.py
│ ├── pod_tools.py # Pod-related tools
│ ├── deployment_tools.py # Deployment-related tools
│ ├── service_tools.py # Service-related tools
│ ├── namespace_tools.py # Namespace-related tools
│ └── cluster_tools.py # Cluster-related tools
└── requirements.txt # Project dependencies
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.