MCP ExplorerExplorer

K8s Mcp Server

@MayukhSoboon a year ago
1 MIT
FreeCommunity
AI Systems
"MCP server for all of your needs in Kubernetes ☸️"

Overview

What is K8s Mcp Server

k8s-mcp-server is a backend system designed to provide an interactive and extensible interface for managing Kubernetes resources, retrieving and analyzing logs, and formatting logs for export through the Model Context Protocol (MCP).

Use cases

Use cases for k8s-mcp-server include managing Kubernetes resources, retrieving logs from specific pods, searching logs for patterns, and exporting logs in different formats for reporting or analysis.

How to use

To use k8s-mcp-server, clone the repository, build the binary using Go, and run the server. You can start the server with the command ‘./k8s-mcp-server serve’ and access help with ‘./k8s-mcp-server --help’.

Key features

Key features include CRUD operations on Kubernetes resources (such as Pods, Services, Namespaces, Deployments), log retrieval and pattern searching, log formatting and exporting in multiple formats (Plaintext, JSON, CSV, NDJSON), and an extensible architecture for future enhancements.

Where to use

k8s-mcp-server can be used in various fields where Kubernetes is deployed, including cloud-native applications, microservices architectures, and DevOps environments that require efficient resource management and log analysis.

Content

Kubernetes MCP Server

A backend system that provides an interactive and extensible interface for managing Kubernetes resources, retrieving and analyzing logs, and formatting logs for export through the Model Context Protocol (MCP).

Features

  • CRUD operations on Kubernetes resources (Pods, Services, Namespaces, Deployments, etc.)
  • Log retrieval and pattern searching
  • Log formatting and exporting in multiple formats (Plaintext, JSON, CSV, NDJSON)
  • Extensible architecture for future enhancements

Requirements

  • Go 1.24+
  • Kubernetes cluster access
  • kubectl configured

Installation

# Clone the repository
git clone https://github.com/mayukhsarkar/k8s-mcp-server.git
cd k8s-mcp-server

# Build the binary
go build -o k8s-mcp-server

# Run the server
./k8s-mcp-server serve

Usage

# Start the MCP server
./k8s-mcp-server serve

# Get help
./k8s-mcp-server --help

API Documentation

The MCP server exposes HTTP endpoints for interacting with Kubernetes resources and logs.

Kubernetes Operations

  • POST /api/v1/resources/{resource_type} - Create a resource
  • GET /api/v1/resources/{resource_type} - List resources
  • GET /api/v1/resources/{resource_type}/{name} - Get resource details
  • DELETE /api/v1/resources/{resource_type}/{name} - Delete a resource

Log Operations

  • GET /api/v1/logs/{namespace}/{pod} - Get logs from a pod
  • GET /api/v1/logs/search - Search logs with pattern matching
  • GET /api/v1/logs/export - Export logs in various formats

License

MIT

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers