mcp-kubernetes-server
Provides natural language processing and API access to Kubernetes clusters for managing resources like pods, deployments, and namespaces.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-kubernetes-servershow me all pods"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Kubernetes MCP Server
A lightweight MCP server that provides natural language processing and API access to Kubernetes clusters, combining both kubectl commands and Kubernetes Python client.
https://github.com/user-attachments/assets/48e061cd-3e85-40ff-ab04-a1a2b9bbd152
✨ Features
Natural Language Interface: Convert plain English queries to kubectl commands
List pods and deployments across all namespaces
Fallback to general resource listing for unsupported queries
Full CRUD Operations:
🆕 Create/Delete namespaces, pods, and deployments via API endpoints
🔍 Inspect cluster resources
✏️ Modify labels, annotations, and deployment configurations
🗑️ Graceful deletion
📊 Scale deployments
Dual Execution Mode:
kubectlcommand integrationKubernetes Python client (official SDK)
Advanced Capabilities:
Namespace validation (DNS-1123 compliant)
Label filtering
Grace period control
Automatic command fallback
Resource management (CPU, memory)
Environment variable configuration
Related MCP server: MCP Remote Server for Kubernetes
📦 Installation
Prerequisites
Python 3.11+
Kubernetes cluster access
kubectlconfigured locallyUV installed
# Clone repository
git clone https://github.com/ductnn/mcp-kubernetes-server.git
cd mcp-kubernetes-server
# Create virtual environment
uv venv .venv
# Activate (Unix)
source .venv/bin/activate
# Install dependencies
uv pip install -r requirements.txt🚀 Usage
Natural Language Processing
The server supports basic natural language queries for listing resources:
# List all pods
result = nl_processor.process("Show me all pods")
# List all deployments
result = nl_processor.process("Show me all deployments")
# Query with namespace
result = nl_processor.process("Show me all resources", "kube-system")For more complex operations, use the dedicated API endpoints:
# Create a pod
pod_service.create_pod(
name="my-pod",
namespace="default",
image="nginx:latest",
labels={"app": "my-app"}
)
# Create a deployment
deployment_service.create_deployment(
name="my-deployment",
namespace="default",
image="nginx:latest",
replicas=3
)
# Delete a namespace
namespace_service.delete("my-namespace", force=True)API Endpoints
The server provides RESTful endpoints for all operations:
/api/pods- Pod operations/api/deployments- Deployment operations/api/namespaces- Namespace operations/api/cluster- Cluster operations/api/nlp- Natural language processing
🤖 Usage with AI Assistants
Claude Desktop
Open your Claude Desktop and choose
Settings-> choose modeDeveloper->Edit configand open fileclaude_desktop_config.jsonand edit:
{
"mcpServers": {
"kubernetes": {
"command": "/path-to-your-uv/uv",
"args": [
"--directory",
"/path-you-project/", // Example for me /Users/ductn/mcp-kubernetes-server
"run",
"main.py"
]
}
}
}Then, restart your Claude Desktop and play :)
🧪 Testing
Run the test suite:
# Run all tests
pytest
# Run specific test file
pytest tests/unit/test_pod_service.py
# Run with coverage
pytest --cov=.📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server that enables interaction with Kubernetes/Minikube clusters through natural language, allowing AI agents like Codename Goose to manage Kubernetes resources via the Model Context Protocol.Last updated2MIT
- Alicense-qualityDmaintenanceProvides Kubernetes cluster management capabilities through natural language via MCP protocol over HTTP/SSE. Supports Pod, Service, Deployment operations, log retrieval, and resource management with JWT authentication and RBAC permissions.Last updated1MIT
- Alicense-qualityDmaintenanceAn MCP server that enables AI assistants to interact with Kubernetes clusters by translating natural language into kubectl and Helm operations. It allows users to query, manage, and diagnose Kubernetes resources and cluster states through a seamless integration.Last updated19Apache 2.0
- Alicense-qualityBmaintenanceAn MCP server that lets AI assistants safely inspect and operate on Kubernetes clusters through natural conversation.Last updatedMIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ductnn/mcp-kubernetes-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server