K8s_MCP

K8s_MCP

An Model Context Protocol server that lets language models directly manage and visualize Kubernetes clusters through safe, high-level operational tools.

Category
Visit Server

README

K8s_MCP

An Model Context Protocol server that lets language models directly manage and visualize Kubernetes clusters through safe, high-level operational tools.

<img width="1850" height="978" alt="image" src="https://github.com/user-attachments/assets/ce131ccf-53d1-4c1f-a539-3ad9cb5c1cec" />

🚀 AI'da Kullanım (Kurulum)

MCP server'ınızı Claude Desktop, Cursor veya diğer MCP destekleyen AI araçlarında kullanabilirsiniz.

1. Bağımlılıkları Kurun

# Python bağımlılıklarını kurun
pip install -r requirements.txt

# kubectl'in kurulu olduğundan emin olun
kubectl version --client

2. MCP Yapılandırması

Claude Desktop için:

  1. Claude Desktop'u açın

  2. MCP ayarları dosyasını bulun:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  3. Yapılandırma dosyasını düzenleyin:

{
  "mcpServers": {
    "k8s-mcp-server": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "cwd": "Your mcp server path here",
      "env": {
        "KUBECONFIG": ""
      }
    }
  }
}

Önemli: cwd yolunu kendi proje dizininize göre güncelleyin!

Cursor için:

Cursor zaten MCP desteğine sahip. Eğer Cursor kullanıyorsanız, MCP server otomatik olarak algılanabilir veya manuel olarak yapılandırmanız gerekebilir.

  1. Cursor ayarlarını açın
  2. MCP bölümüne gidin
  3. Yeni MCP server ekleyin:
    • Name: k8s-mcp-server
    • Command: python
    • Args: ["server.py"]
    • Working Directory: Proje dizininizin tam yolu

3. Test Edin

Claude Desktop veya Cursor'u yeniden başlatın ve AI'a şunu sorun:

"Kubernetes cluster'ımdaki pod'ları listele"

veya

"default namespace'indeki deployment'ları göster"

4. Kullanılabilir Komutlar

MCP server'ınız aşağıdaki komutları destekler:

  • Pod İşlemleri: list_pods, get_pod_logs, describe_pod
  • Deployment İşlemleri: list_deployments, scale_deployment, restart_deployment
  • YAML İşlemleri: apply_yaml, get_yaml
  • Event İzleme: list_events
  • Service İşlemleri: list_services, describe_service
  • Namespace İşlemleri: list_namespaces, create_namespace, delete_namespace
  • Node İşlemleri: list_nodes, describe_node, cluster_info, list_pods_by_node

Sorun Giderme

Problem: MCP server bağlanmıyor

  • Python'un PATH'te olduğundan emin olun
  • cwd yolunun doğru olduğunu kontrol edin
  • pip install -r requirements.txt komutunu çalıştırdığınızdan emin olun

Problem: Kubernetes bağlantı hatası

  • kubectl komutunun çalıştığını kontrol edin: kubectl cluster-info
  • KUBECONFIG ortam değişkeninin doğru ayarlandığından emin olun

Pod'ları Canlı Görüntüleme Platformları

Deployment'larınızı kurduktan sonra pod'ları canlı görmek için aşağıdaki platformları kullanabilirsiniz:

1. Kubernetes Dashboard (Resmi Web UI)

Kubernetes'in resmi web arayüzü. Pod'ları, deployment'ları, servisleri ve diğer kaynakları görsel olarak yönetebilirsiniz.

Kurulum (Otomatik Script):

# Windows PowerShell
.\open-dashboard.ps1

Kurulum (Manuel):

# Dashboard'u kurun
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml

# Service Account ve ClusterRoleBinding oluşturun
kubectl create serviceaccount dashboard-admin-sa -n kubernetes-dashboard
kubectl create clusterrolebinding dashboard-admin-sa --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-admin-sa

# Token'ı alın
kubectl -n kubernetes-dashboard create token dashboard-admin-sa

# Dashboard'a erişim için port-forward
kubectl port-forward -n kubernetes-dashboard service/kubernetes-dashboard 8443:443

Tarayıcıda https://localhost:8443 adresine gidin ve token ile giriş yapın.

2. Lens (Desktop Uygulaması)

Güçlü bir desktop uygulaması. Gerçek zamanlı pod durumları, log görüntüleme ve kaynak kullanımı grafikleri.

Kurulum:

  • Lens'i indirin ve kurun
  • Kubernetes cluster'ınıza bağlanın (kubeconfig dosyanızı seçin)
  • Tüm pod'ları, deployment'ları ve servisleri canlı görebilirsiniz

3. k9s (Terminal Tabanlı)

Terminal üzerinden hızlı ve etkili bir arayüz.

Kurulum:

# Windows (Chocolatey)
choco install k9s

# veya Scoop
scoop install k9s

# Kullanım
k9s

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured