mcpField
K
Kubernetes MCP Server

Kubernetes MCP Server

Local
github.com/wasilakCloud & Infra0Updated 76w ago

About Kubernetes MCP Server

Kubernetes MCP Server is an experimental server for AI chat interfaces that need to inspect and manage Kubernetes clusters. It exposes kubectl commands through a single tool, using the configured kubeconfig and permissions.

Key features

  1. 01Run kubectl commands through one tool
  2. 02Discover and describe cluster resources
  3. 03Inspect logs and resource states
  4. 04Create or modify Kubernetes resources
  5. 05Review cluster configuration for security issues

Use cases

  1. 01List pods in a namespace
  2. 02Investigate cluster issues using logs and status
  3. 03Get assistance with resource changes
  4. 04Check cluster configuration for potential security issues

MCP support

The MCP server exposes a single `kubectl` tool to MCP clients, allowing execution of kubectl commands against the configured Kubernetes cluster.

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

An experimental Model Context Protocol (MCP) server that exposes Kubernetes functionality to AI chat interfaces through kubectl. This project demonstrates how to integrate Kubernetes with AI assistants, allowing them to help analyze and manage your cluster resources using familiar kubectl commands.

Overview

This project is built on top of the amazing mcpr project by @conikeec, which provides a protocol for AI assistants to interact with external tools and services.

The server provides a single kubectl tool that can execute any kubectl command, giving AI assistants full access to your Kubernetes cluster's capabilities.

Use Cases

  • Resource Discovery: Ask your AI assistant to list and describe resources using kubectl commands
  • Troubleshooting: Have the AI help analyze logs and resource states using kubectl
  • Resource Management: Get AI assistance in creating or modifying resources
  • Documentation: Ask the AI to explain what a particular resource does in your cluster
  • Security Analysis: Have the AI help identify potential security issues in your cluster configuration

Example Interaction

User: Can you show me all pods in the default namespace?
AI: I'll check that for you...
[Uses the kubectl tool with command "get pods -n default"]
Here are the pods in the default namespace:
NAME                     READY   STATUS    RESTARTS   AGE
nginx-7c658794b9-2j4k5   1/1     Running   0          2d

Future Possibilities

The current implementation provides a foundation for many powerful interactions:

  • Complex troubleshooting scenarios using multiple kubectl commands
  • Automated resource analysis and recommendations
  • Interactive debugging sessions
  • Security scanning and recommendations
  • Performance optimization suggestions

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/mcp-kubernetes.git
cd mcp-kubernetes
  1. Build the project:
cargo build --release
  1. Configure your AI assistant to use the server (instructions depend on your AI platform)

Requirements

  • Rust 1.70 or later
  • kubectl installed and configured
  • Kubernetes cluster with appropriate permissions
  • kubeconfig configured for your cluster

Configuration

The server uses your default kubeconfig and kubectl installation. Make sure you have the necessary permissions to execute the commands you want to run.

Security Considerations

Since this server allows execution of arbitrary kubectl commands, it's important to:

  1. Run it with appropriate RBAC permissions
  2. Consider implementing command validation or whitelisting
  3. Monitor and audit command execution
  4. Use it in a controlled environment

Acknowledgments

This project is built on top of the mcpr project by @conikeec. Many thanks to the author for creating this excellent protocol and implementation.

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.