mcp-kubernetes

command module
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

MCP Kubernetes

An MCP (Model Context Protocol) server that provides comprehensive Kubernetes management capabilities through structured tools and interfaces.

Overview

This project implements an MCP server for Kubernetes operations, providing a standardized interface for AI agents and tools to interact with Kubernetes clusters. It supports multi-cluster operations, non-destructive mode, and comprehensive resource management.

Architecture

Project Structure
cmd/mcp-kubernetes/           # Main application entrypoint
internal/k8s/                 # Kubernetes client and helpers
internal/server/              # MCP server logic and ServerContext
internal/tools/               # MCP tool implementations
├── context/                  # Context management tools
├── resource/                 # Resource management tools
├── pod/                      # Pod operations tools
└── cluster/                  # Cluster management tools
internal/security/            # Security enhancements
internal/util/                # Utility functions
pkg/                          # Public packages
test/integration/             # Integration tests
docs/                         # Tool documentation
Key Features
  • Multi-cluster Support: Manage multiple Kubernetes clusters seamlessly
  • Non-destructive Mode: Safe operations with validation and confirmation
  • Comprehensive Tool Set: Full range of kubectl operations
  • ServerContext Pattern: Decoupled, testable architecture
  • Security First: Authentication, authorization, and secure credential handling
Supported Operations
Context Management
  • List available contexts
  • Get current context
  • Switch between contexts
Resource Management
  • Get, list, create, apply, delete resources
  • Describe resources and patch operations
  • Scale deployments and other scalable resources
Pod Operations
  • View logs with filtering and streaming
  • Execute commands in pods
  • Port forwarding capabilities
Cluster Management
  • API resource discovery
  • Cluster health monitoring

Development

Prerequisites
  • Go 1.21+
  • Access to Kubernetes clusters
Building
go build -o mcp-kubernetes ./cmd/mcp-kubernetes
Testing
# Run unit tests
make test

# Run integration tests
make test-integration

# Test coverage
make coverage

Configuration

The server supports various configuration options for cluster access, security settings, and operational modes. See the documentation in docs/ for detailed configuration instructions.

License

This project is part of Giant Swarm's infrastructure tooling.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd provides the command-line interface for mcp-kubernetes.
Package cmd provides the command-line interface for mcp-kubernetes.
internal
k8s
Package k8s provides interfaces and types for Kubernetes operations.
Package k8s provides interfaces and types for Kubernetes operations.
server
Package server provides the ServerContext pattern and related infrastructure for the MCP Kubernetes server.
Package server provides the ServerContext pattern and related infrastructure for the MCP Kubernetes server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL