1. Conduid
  2. Developer Tools
  3. Kubectl Go MCP Server
MCP server · Developer Tools

Kubectl Go MCP Server

MCP server for secure Kubernetes Interaction via kubectl commands. Enables AI assistants like GitHub Copilot to safely interact with K8s clusters with robust validation and security.

64Good

Scored yesterday · breakdown

About Kubectl Go MCP Server

Kubectl Go MCP Server is an MCP server published by Joelayo in the Developer Tools category: mCP server for secure Kubernetes Interaction via kubectl commands. Enables AI assistants like GitHub Copilot to safely interact with K8s clusters with robust validation and security.

The repository has 1 stars and 0 forks, with the last commit 8 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/Joelayo/kubectl-go-mcp-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Kubectl Go MCP Server

Powered by Claude · Grounded in docs

I know everything about Kubectl Go MCP Server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository yesterday. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.1.1v0.1.1 · 24 Jun 2025Release v0.1.1 See CHANGELOG for details. Changelog 9b3a441 Hotfix: Remove 'node' from blocked patterns to allow 'kubectl get nodes' commands b5868b8 fix: update links in README for releases and issue tracking Installation Instructions For…
v0.1.0v0.1.0 · 23 Jun 2025Release v0.1.0 See CHANGELOG for details. Changelog d3ea37d downgrade Trivy action version from 0.30.4 to 0.28.0 for compatibility a6c2d78 enhance Trivy vulnerability scanning with improved permissions and fallback artifact handling…

README

kubectl-go-mcp-server

A Model Context Protocol (MCP) server that provides Kubernetes cluster interaction capabilities through kubectl commands. This server enables MCP-compatible clients (like VS Code with Copilot) to execute kubectl commands and retrieve Kubernetes cluster information safely and securely.

Features

  • Kubernetes Integration: Execute kubectl commands through MCP interface
  • Interactive Command Protection: Prevents execution of interactive commands that could hang
  • Resource Modification Detection: Identifies commands that modify cluster resources
  • Robust Security: Multiple validation layers to prevent command injection and unsafe operations
  • Configurable Kubeconfig: Support for custom kubeconfig paths
  • Standard Go Project Layout: Following Go best practices for maintainability
  • Cobra CLI Integration: Professional command-line interface with subcommands

Architecture

kubectl-go-mcp-server acts as a bridge between MCP clients (like VS Code with Copilot) and Kubernetes clusters through kubectl commands:

VS Code/Copilot → MCP Client → kubectl-go-mcp-server → kubectl → Kubernetes Cluster

Key Components

  • MCP Server: Handles JSON-RPC communication and tool registration
  • kubectl Tool: Validates and executes kubectl commands safely
  • Security Layer: Prevents interactive commands and command injection

For detailed architecture information, see docs/architecture.md.

pkg/
├── types/          # 🔧 Core interfaces and data structures
│   ├── Tool        # Interface for all MCP tools
│   ├── Schema      # JSON schema definitions
│   └── ExecResult  # Command execution results
│
├── kubectl/        # 🎯 kubectl-specific implementation
│   ├── KubectlTool # Main tool implementation
│   ├── Validation  # Command safety checks
│   └── Execution   # kubectl command runner
│
internal/
├── mcp/           # 🌐 MCP protocol implementation
│   ├── Server     # MCP server and protocol handling
│   ├── Tools      # Tool registry and management
│   └── Protocol   # JSON-RPC message handling
│
└── config/        # ⚙️ Configuration management
    ├── Config     # Application configuration
    └── Defaults   # Default settings

Extension Points

The architecture is designed for extensibility:

  1. New Tools: Implement the Tool interface to add new capabilities
  2. Custom Validation: Add validation layers for specific use cases
  3. Protocol Extensions: Extend MCP handling for additional features
  4. Output Formatters: Add custom result processing

Performance Considerations

  • Concurrent Safety: All components are designed for concurrent access
  • Resource Management: Proper cleanup and resource disposal
  • Timeout Handling: Configurable timeouts for all operations
  • Memory Efficiency: Streaming and buffered I/O for large outputs

Installation

Prerequisites

  • Go 1.23 or later
  • kubectl installed and configured
  • Access to a Kubernetes cluster

Build from Source

# Clone the repository
git clone https://github.com/Joelayo/kubectl-go-mcp-server.git
cd kubectl-go-mcp-server

# Build the binary
make build

# Or install directly
make install

Download Binary

Download the latest release from the releases page for your platform.

Usage

Standalone

# Run with default kubeconfig
./kubectl-go-mcp-server

# Run with custom kubeconfig
./kubectl-go-mcp-server --kubeconfig /path/to/kubeconfig

# Show version
./kubectl-go-mcp-server version

VS Code Integration

To use with VS Code and Copilot, add this MCP server to your VS Code settings:

{
  "mcp": {
    "servers": {
      "kubectl-go-mcp-server": {
        "type": "stdio",
        "command": "/path/to/kubectl-go-mcp-server",
        "env": {}
      }
    }
  }
}

For platform-specific installation details, see the examples directory.

Available Tools

The MCP server provides the following tool:

kubectl

Execute kubectl commands with comprehensive validation and safety checks.

Parameters:

  • command (required): The complete kubectl command to execute (including 'kubectl' prefix)
  • modifies_resource (optional): Indicates if the command modifies resources ("yes", "no", "unknown")

Example:

{
  "name": "kubectl",
  "arguments": {
    "command": "kubectl get pods -o json",
    "modifies_resource": "no"
  }
}

Safety Features:

  • Interactive Command Detection: Prevents hanging on interactive commands like kubectl exec -it, kubectl edit, kubectl port-forward
  • Resource Modification Tracking: Automatically detects destructive operations
  • Command Validation: Ensures only valid kubectl commands are executed

Security

This server implements multiple security layers including command validation, injection prevention, and interactive command blocking. For detailed security information, see:

Development

See CONTRIBUTING.md for development setup, workflow, and contribution guidelines.

Quick Start for Developers

# Install dependencies and build
make deps && make build

# Run tests
make test

# Format and lint code  
make fmt && make lint

Troubleshooting

Common Issues

  • Server not responding: Verify kubectl is installed and kubeconfig is accessible
  • Interactive command errors: Use non-interactive alternatives (see Security Overview)
  • Permission denied: Check kubectl permissions and cluster connectivity

For detailed debugging information, the server logs all tool calls, validation results, and errors.

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.

README fetched from the repository yesterday. The original is authoritative.

Questions

About Kubectl Go MCP Server

How do I install Kubectl Go MCP Server?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Kubectl Go MCP Server safe to use with an AI agent?

Its trust score is 64 out of 100 (good). It passes 5 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Kubectl Go MCP Server still maintained?

The last commit was 8 months ago and 3 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.