RG

reza-gholizade/k8s-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

189 stars 45 forks 品質 85 トレンド 37MIT

reza-gholizade/k8s-mcp-serverは、https://github.com/reza-gholizade/k8s-mcp-server.からインポートされたMCPサーバー候補です。

概要

reza-gholizade/k8s-mcp-serverは、https://github.com/reza-gholizade/k8s-mcp-server.からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

Kubernetesモデルコンテキストプロトコル(MCP)サーバーで、標準化されたインターフェースを通じてKubernetesクラスターとやり取りするためのツールを提供します。

ホスト展開

Fronteir AIでホスト型デプロイメントが利用可能です。

特徴

  • API リソース探索:Kubernetesクラスター内の利用可能なすべてのAPIリソースを取得しましょう。
  • リソースリスト:任意のタイプのリソースをリストアップし、任意の名前空間とラベルフィルタリングを利用できます。
  • リソース詳細:特定のKubernetesリソースに関する詳細な情報を取得します。
  • リソース説明:kubectl describeに似たKubernetesリソースの包括的な説明を得られます。
  • ポッドログ:特定のポッドからログを取得する(特定のコンテナから、または指定がなければすべてのコンテナからも)。
  • ノードメトリクス:特定のノードのリソース使用量指標を取得します。
  • ポッドメトリクス:特定のポッドのCPUおよびメモリメトリクスを取得します。
  • イベントリストング:名前空間内または特定のリソース内のイベントを一覧表示します。
  • リソースの作成/更新:新しいKubernetesリソースを作成したり、YAMLやJSONマニフェストから既存のリソースを更新します。
  • リソース削除:提供された名前空間と種類に基づいてKubernetesクラスター内のリソースを削除します。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Kubernetes MCP Server

A Kubernetes Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface.

Hosted deployment

A hosted deployment is available on Fronteir AI.

Features

  • API Resource Discovery: Get all available API resources in your Kubernetes cluster.
  • Resource Listing: List resources of any type with optional namespace and label filtering.
  • Resource Details: Get detailed information about specific Kubernetes resources.
  • Resource Description: Get comprehensive descriptions of Kubernetes resources, similar to kubectl describe.
  • Pod Logs: Retrieve logs from specific pods (optionally from a specific container, or all containers if unspecified).
  • Node Metrics: Get resource usage metrics for specific nodes.
  • Pod Metrics: Get CPU and Memory metrics for specific pods.
  • Event Listing: List events within a namespace or for a specific resource.
  • Resource Creation/Updating: Create new Kubernetes resources or update existing ones from a YAML or JSON manifest.
  • Resource Deletion: It deletes a resource in the Kubernetes cluster based on the provided namespace and kind.
  • Standardized Interface: Uses the MCP protocol for consistent tool interaction.
  • Flexible Configuration: Supports different Kubernetes contexts and resource scopes.
  • Multiple Modes: Run in stdio mode for CLI tools, sse mode, or streamable-http mode for web applications, and --readonly for no change in the cluster.
  • Security: Runs as non-root user in Docker containers for enhanced security.

Prerequisites

  • Go 1.23 or later
  • Access to a Kubernetes cluster
  • kubectl configured with appropriate cluster access

Installation

  1. Clone the repository:

    git clone https://github.com/reza-gholizade/k8s-mcp-server.git
    cd k8s-mcp-server
    
  2. Install dependencies:

    go mod download
    
  3. Build the server:

    go build -o k8s-mcp-server .
    

Usage

Starting the Server

The server can run in three modes, configurable via command-line flags or environment variables.

Stdio Mode (for CLI integrations)

This mode uses standard input/output for communication.

./k8s-mcp-server --mode stdio

Or using environment variables:

SERVER_MODE=stdio ./k8s-mcp-server

SSE Mode (for web applications)

This mode starts an HTTP server with Server-Sent Events support.

HTTP transports require a bearer token and listen on loopback by default:

MCP_AUTH_TOKEN="$(openssl rand -hex 32)" ./k8s-mcp-server --mode sse

Specify a port:

MCP_AUTH_TOKEN="your-random-secret" ./k8s-mcp-server --mode sse --port 9090

Or using environment variables:

SERVER_MODE=sse SERVER_PORT=9090 MCP_AUTH_TOKEN="your-random-secret" ./k8s-mcp-server
GitHub で README 全文を見る

インストール

docker run -p 8080:8080 -v ~/.kube/config:/home/appuser/.kube/config:ro ginnux/k8s-mcp-server:latest
MCP 初心者?mcpskill.org のガイドから始めましょう →