
MCP Kubernetes
Enables advanced management of Kubernetes clusters through natural language interactions. Supports querying, managing, and monitoring pods, deployments, nodes, and logs across multiple contexts and namespaces.
README
MCP Kubernetes
Model Context Protocol server for Kubernetes operations.
Description
This project implements an MCP (Model Context Protocol) server for advanced management of Kubernetes clusters. It provides tools to query, manage, and monitor resources such as pods, deployments, nodes, and logs, with support for multiple contexts and namespaces.
Features
- 🟢 Pod Management:
- 📦 List pods by namespace and context.
- 🔍 Retrieve complete pod details, including events, containers, volumes, and status.
- 🚀 Deployment Management:
- 📦 List deployments by namespace and context.
- 📈 Scale replicas and rollout (restart) deployments.
- 📝 Query detailed deployment status.
- 🖥️ Node Management:
- 🗂️ List nodes with capacity, status, roles, and cluster summary.
- 📄 Pod Logs:
- 📝 Retrieve logs from specific pods and containers, with options for previous logs and line count.
- 🔄 Multi-context Support:
- 🔎 Query and switch Kubernetes contexts.
- ⚙️ Set default context.
- ⚙️ Configuration and Logging:
- 🛠️ Utilities for loading Kubernetes configuration and structured logging.
Installation
pip install -r requirements.txt
Usage
Run the MCP server:
python src/mcp_kubernetes/main.py
API Examples
The tools are exposed as MCP functions and can be invoked from compatible clients:
- Get pods:
get_pods(context="my-context", namespace="default")
- Pod details:
get_pod_details(environment="prod", pod_name="nginx-123", namespace="default", context="my-context")
- Get deployments:
get_deployments(context="my-context", namespace="default")
- Scale deployment:
scale_deployment(namespace="default", deployment_name="web", replicas=5)
- Rollout deployment:
rollout_deployment(namespace="default", deployment_name="web")
- Get nodes:
get_nodes(context="my-context")
- Get logs:
get_logs(context="my-context", environment="prod", pod_name="nginx-123", namespace="default", container="nginx")
- Available contexts:
get_available_contexts()
- Change context:
set_default_context(context="other-context")
Project Structure
src/mcp_kubernetes/main.py
: Main entry point for the MCP server.src/mcp_kubernetes/config.py
: Configuration and logging utilities.src/mcp_kubernetes/tools/
: Kubernetes tools modules:deployments.py
: Deployment management.pods.py
: Pod management and details.nodes.py
: Node information and summary.logs.py
: Pod log retrieval.
Contributing
Contributions are welcome! Please open an issue or pull request for suggestions and improvements.
License
MIT License. See the LICENSE file
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.