Kubernetes
Kubernetes MCP server with the top30 tools
Kubernetes MCP Server (FastMCP)
This project provides a Kubernetes MCP (Model Context Protocol) server built using FastMCP and the official Kubernetes Python client. It exposes a wide range of Kubernetes management and inspection tools as MCP tools, making it easy to interact with your Kubernetes or OpenShift cluster programmatically or via GitHub Copilot.
use https://gitingest.com/jlowin/fastmcp download the above and feed it as a context to your copilot chat
prompt to build a mcp server: build a kubernet mcp server with top 30 kubernetes tools using the jlowin-fastmcp-8a5edab282632443.txt file. Make the functions dynamic so that it works for all cases even when the user does not provide a namespace or resource name.
Features
The MCP server exposes the following Kubernetes operations as MCP tools:
- Pod Management: List, describe, and get logs for pods
- Deployment Management: List, scale, and inspect deployments
- Service Management: List and get details of services
- Namespace Management: List, create, and delete namespaces
- Node Management: List and describe nodes
- ConfigMap & Secret Management: List and get ConfigMaps and Secrets
- Persistent Volumes & Claims: List PVs and PVCs, get PVC details
- Job & CronJob Management: List and get jobs and cronjobs
- Ingress Management: List and get ingresses
- DaemonSet, StatefulSet, ReplicaSet Management: List and get details for each
- Event Management: List and get cluster events
All tools support filtering by namespace where applicable.
Prerequisites
- Python 3.x
- fastmcp
- kubernetes Python client
- kubectl (for cluster access)
- Access to a Kubernetes or OpenShift cluster (kubeconfig or in-cluster config)
Installation
-
Install Python dependencies:
pip install fastmcp kubernetes -
Ensure
pythonandfastmcpare in your system PATH. -
Install and configure
kubectland connect to your cluster. -
(Optional) Update your
mcp.jsonto add the MCP server endpoint:"kubernetes-local": { "name": "Kubernetes MCP Server", "url": "http://localhost:8000/mcp/" }
Usage
-
Start the MCP server:
python kube_mcp_server.py -
The server will run on
http://0.0.0.0:8000/mcp/by default. -
You can now interact with your Kubernetes cluster using MCP tools (e.g., via GitHub Copilot or any MCP client).
Example MCP Tools
list_pods(namespace=None)get_pod_logs(pod_name=None, namespace=None)describe_pod(pod_name=None, namespace=None)list_deployments(namespace=None)scale_deployment(deployment_name, replicas, namespace)list_services(namespace=None)get_service(service_name=None, namespace=None)list_namespaces()create_namespace(namespace)delete_namespace(namespace)list_nodes()describe_node(node_name=None)list_configmaps(namespace=None)get_configmap(configmap_name=None, namespace=None)list_secrets(namespace=None)get_secret(secret_name=None, namespace=None)list_persistent_volumes()list_persistent_volume_claims(namespace=None)get_pvc(pvc_name=None, namespace=None)list_jobs(namespace=None)get_job(job_name=None, namespace=None)list_cronjobs(namespace=None)get_cronjob(cronjob_name=None, namespace=None)list_ingresses(namespace=None)get_ingress(ingress_name=None, namespace=None)list_daemonsets(namespace=None)get_daemonset(daemonset_name=None, namespace=None)list_statefulsets(namespace=None)get_statefulset(statefulset_name=None, namespace=None)list_events(namespace=None)get_event(event_name=None, namespace=None)list_replicasets(namespace=None)get_replicaset(replicaset_name=None, namespace=None)
Notes
Example prompt:
- get me the pods running on the vp1099 namespace.
- scale down all pods in the vp1099 namespace to 1 replica.
- The server will attempt to use your local kubeconfig, or fall back to in-cluster config if running inside a cluster.
- Make sure your
kubectlcontext is set to the desired cluster/namespace. - You can extend the server by adding more MCP tools using the
@mcp.tooldecorator. - Gitingest support: You can use gitingest to ingest and interact with GitHub repositories directly through MCP, enabling advanced code search and automation workflows alongside your Kubernetes operations.
License
MIT License
Server Terkait
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Health Microservice API
A FastAPI microservice for health-related operations, featuring JWT authentication and a PostgreSQL database with Alembic migrations.
Remote MCP Server on Cloudflare
An example of a remote MCP server deployable on Cloudflare Workers, featuring customizable tools and no authentication.
Devcontainers
Integrates with the devcontainers CLI to manage development containers. Requires Docker.
Databutton
An MCP server for initial app planning and creating a good starting point for an app.
SEO & Web Analysis MCP Server
Lighthouse audits, PageSpeed analysis, SSL checks, tech stack detection, WHOIS and DNS queries
Godot MCP
MCP server for interacting with the Godot game engine, providing tools for editing, running, debugging, and managing scenes in Godot projects.
GXtract
GXtract is a MCP server designed to integrate with VS Code and other compatible editors. It provides a suite of tools for interacting with the GroundX platform, enabling you to leverage its powerful document understanding capabilities directly within your development environment.
Second Opinion
Review commits and codebases using external LLMs like OpenAI, Google Gemini, and Mistral.
MCP Chart Server
Generates TradingView chart visualizations using the Chart-IMG API.
Repo Map
An MCP server (and command-line tool) to provide a dynamic map of chat-related files from the repository with their function prototypes and related files in order of relevance. Based on the "Repo Map" functionality in Aider.chat