Installation

Detailed installation instructions for Kyverno MCP

Installation Methods

Kyverno MCP can be installed using several methods depending on your operating system and preferences.

Prerequisites

  • Go 1.24 or higher (only for building from source)
  • Access to a Kubernetes cluster with a valid kubeconfig
  • Kyverno installed in your cluster (for policy operations)

The easiest way to install Kyverno MCP on macOS or Linux:

# Add the Nirmata tap
brew tap nirmata/tap

# Install Kyverno MCP
brew install kyverno-mcp

# Verify installation
kyverno-mcp --version

Option 2: Pre-built Binaries

Download pre-built binaries for your platform:

  1. Visit the Nirmata downloads page

  2. Download the appropriate binary for your platform:

    • kyverno-mcp-darwin-amd64 for macOS (Intel)
    • kyverno-mcp-darwin-arm64 for macOS (Apple Silicon)
    • kyverno-mcp-linux-amd64 for Linux (x86_64)
    • kyverno-mcp-windows-amd64.exe for Windows
  3. Make the binary executable (macOS/Linux):

chmod +x kyverno-mcp-*
  1. Move to a directory in your PATH:
sudo mv kyverno-mcp-* /usr/local/bin/kyverno-mcp

Option 3: Build from Source

If you prefer to build from source:

# Clone the repository
git clone https://github.com/nirmata/kyverno-mcp.git
cd kyverno-mcp

# Build the binary
go build -o kyverno-mcp ./cmd/kyverno-mcp

# Install to PATH
sudo mv kyverno-mcp /usr/local/bin/

Option 4: Docker

Run Kyverno MCP using Docker:

# Build the Docker image
docker build -t kyverno-mcp:latest .

# Run with mounted kubeconfig
docker run --rm -i \
  -v $HOME/.kube/config:/kube/config:ro \
  kyverno-mcp:latest -- \
  --kubeconfig /kube/config

For Docker Compose:

version: '3.8'
services:
  kyverno-mcp:
    image: kyverno-mcp:latest
    volumes:
      - ${HOME}/.kube/config:/kube/config:ro
    environment:
      - KUBECONFIG=/kube/config
    stdin_open: true
    tty: true

Verifying Installation

After installation, verify that Kyverno MCP is working correctly:

# Check version
kyverno-mcp --version

# Test with default kubeconfig
kyverno-mcp

# Test with specific kubeconfig
kyverno-mcp --kubeconfig=/path/to/kubeconfig

Platform-Specific Notes

macOS

  • If using Homebrew, updates are handled via brew upgrade kyverno-mcp
  • For Apple Silicon Macs, ensure you download the arm64 binary

Linux

  • Add the binary location to your $PATH in ~/.bashrc or ~/.zshrc
  • Consider creating a systemd service for HTTP mode

Windows

  • Add the executable location to your system PATH
  • Use PowerShell or Command Prompt to run the tool
  • Consider using Windows Subsystem for Linux (WSL) for better compatibility

Troubleshooting Installation

Permission Denied

If you get a “permission denied” error:

chmod +x kyverno-mcp

Command Not Found

If the command is not found after installation:

  1. Check if the binary is in your PATH: echo $PATH
  2. Add the directory to PATH: export PATH=$PATH:/path/to/directory

Kubeconfig Issues

If you encounter kubeconfig errors:

  1. Verify your kubeconfig exists: ls ~/.kube/config
  2. Test kubectl access: kubectl cluster-info
  3. Specify kubeconfig explicitly: kyverno-mcp --kubeconfig=/path/to/config

Next Steps