Cover image
Try Now
2025-03-31

这是MCP Kubernetes服务器。

3 years

Works with Finder

2

Github Watches

1

Github Forks

5

Github Stars

MCP Kubernetes Server

smithery badge

This is an MCP (Model Context Protocol) server for Kubernetes that provides control over Kubernetes clusters through interactions with LLMs.

Overview

This client allows you to perform common Kubernetes operations through MCP tools. It wraps kubectl commands to provide a simple interface for managing Kubernetes resources. The Model Context Protocol (MCP) enables seamless interaction between language models and Kubernetes operations.

What is MCP?

Model Context Protocol (MCP) is a framework that enables Language Models to interact with external tools and services in a structured way. It provides:

  • A standardized way to expose functionality to language models
  • Context management for operations
  • Tool discovery and documentation
  • Type-safe interactions between models and tools

Usage Examples

  • Create a new deployment for me with name nginx-app and image nginx:latest in the production namespace with 3 replicas.
  • Update the deployment nginx-app to version 1.19 in the production namespace.
  • Scale the deployment nginx-app to 5 replicas in the production namespace.
  • Get me the pods in the production namespace.
  • Get me all namespaces in the cluster.
  • Get me all nodes in the cluster.
  • Get me all services in the cluster.
  • Get me all deployments in the cluster.
  • Get me all jobs in the cluster.
  • Get me all cronjobs in the cluster.
  • Get me all statefulsets in the cluster.
  • Get me all daemonsets in the cluster.
  • What is the current context.
  • list all contexts.
  • switch to context .
  • Get me the logs of pod in the production namespace.
  • Get me the events in the production namespace.
  • annotate pod with key1=value1 in the production namespace.
  • remove annotation key1 from pod in the production namespace.
  • add label key1=value1 to pod in the production namespace.
  • remove label key1 from pod in the production namespace.
  • expose deployment nginx-app in the production namespace on port 80.
  • port-forward pod,deployment,service with name in the production namespace to local port 8080.
  • delete pod, deployment, service, job, cronjob, statefulset, daemonset with name in the production namespace.

Upcoming Features

  • Create cluster role.
  • delete cluster role.
  • create cluster role binding.
  • delete cluster role binding.
  • create namespace.
  • delete namespace.
  • create service account.
  • delete service account.
  • create role.
  • delete role.
  • create role binding.a
  • delete role binding.

LLM Integration

This MCP client is designed to work seamlessly with Large Language Models (LLMs). The functions are decorated with @mcp.tool(), making them accessible to LLMs through the Model Context Protocol framework.

Example LLM Prompts

LLMs can interact with your Kubernetes cluster using natural language. Here are some example prompts:

  • "Create a new nginx deployment with 3 replicas in the production namespace"
  • "Scale the nginx-app deployment to 5 replicas"
  • "Update the image of nginx-app to version 1.19"

The LLM will interpret these natural language requests and call the appropriate MCP functions with the correct parameters.

Benefits of LLM Integration

  1. Natural Language Interface: Manage Kubernetes resources using conversational language
  2. Reduced Command Complexity: No need to remember exact kubectl syntax
  3. Error Prevention: LLMs can validate inputs and provide helpful error messages
  4. Context Awareness: LLMs can maintain context across multiple operations
  5. Structured Interactions: MCP ensures type-safe and documented interactions between LLMs and tools

Requirements

  • Kubernetes cluster access configured via kubectl
  • Python 3.x
  • MCP framework installed and configured

Security Note

When using this client with LLMs, ensure that:

  • Proper access controls are in place for your Kubernetes cluster
  • The MCP server is running in a secure environment
  • API access is properly authenticated and authorized

Usage with Claude Desktop

{
    "mcpServers": {
        "Kubernetes": {
            "command": "uv",
            "args": [
                "--directory",
                "~/mcp/mcp-k8s-server",
                "run",
                "kubernetes.py"
            ]
        }
    }
}

Contributing

We welcome contributions to the MCP Kubernetes Server! If you'd like to contribute:

  1. Fork the repository
  2. Create a new branch for your feature (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Write or update tests as needed
  5. Commit your changes (git commit -m 'Add some amazing feature')
  6. Push to your branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

For major changes, please open an issue first to discuss what you would like to change.

Installing via Smithery

To install Kubernetes Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @abhijeetka/mcp-k8s-server --client claude

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    2 (1)
    Avatar
    user_62tUha7B
    2025-04-16

    The mcp-k8s-server by abhijeetka is a fantastic tool for Kubernetes enthusiasts. It's easy to set up and integrates seamlessly into my workflow. The detailed documentation and welcoming community make it a joy to use. Highly recommend giving it a try! Check it out at https://github.com/abhijeetka/mcp-k8s-server.