mcpField
K
Kubernetes MCP Server

Kubernetes MCP Server

Local
github.com/endo-sysCloud & Infra0Updated 77w ago

About Kubernetes MCP Server

Kubernetes MCP Server exposes Kubernetes cluster operations to MCP clients, allowing cluster management through natural-language requests. It covers workloads, services, namespaces, and nodes, with metrics and maintenance operations.

Key features

  1. 01Filter and inspect pods
  2. 02Read pod logs and metrics
  3. 03Scale and manage deployment rollouts
  4. 04Inspect and expose services
  5. 05Create and manage namespaces
  6. 06Inspect and maintain nodes

Use cases

  1. 01Check pods and read their logs
  2. 02Scale a deployment or restart its rollout
  3. 03Expose a deployment as a service
  4. 04Drain a node for maintenance

MCP support

The MCP server makes Kubernetes operations available as tools to MCP clients, which can use natural language to request cluster actions.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

  1. Clone this repository
  2. Install dependencies:
    pip install -r requirements.txt
    

Usage

Running the Server
  1. Development mode with MCP Inspector:

    python -m mcp.inspector src/k8s_mcp_server.py
    
  2. Install in Claude Desktop:

    python -m mcp.install src/k8s_mcp_server.py
    
  3. 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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.