Get the FREE Ultimate OpenClaw Setup Guide →

harvester

Model Context Protocol (MCP) server for Harvester HCI

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio starbops-harvester-mcp-server ./bin/harvester-mcp-server \
  --env LOG_LEVEL="debug|info|warn|error (default: info)" \
  --env KUBECONFIG="Path to kubeconfig file (optional; server will fall back to in-cluster config if running in cluster)"

How to use

Harvester MCP Server enables AI assistants like Claude Desktop and Cursor to interact with Harvester clusters via the MCP protocol. It translates natural language commands into Kubernetes/Harvester API operations, formats results into human-readable text, and returns them to the AI client for presentation. The server exposes tools for both Kubernetes core resources (Pods, Deployments, Services, Namespaces, Nodes, etc.) and Harvester-specific resources (Virtual Machines, Images, Volumes, Networks), with standardized formatters to produce concise lists and detailed views optimized for LLM consumption.

To use the server, run it with access to a kubeconfig for your Harvester cluster (or run inside a cluster to use in-cluster configuration). Then configure your MCP client (e.g., Claude Desktop) to point at the Harvester MCP Server endpoint. Once connected, you can ask high-level questions like: “List all virtual machines in the default namespace” or “Show details for the pod named rancher-789c976c6-xbvmd in cattle-system.” The MCP server will handle request parsing, resource handling, formatting, and response delivery, providing human-friendly outputs suitable for AI assistants to present to users.

How to install

Prerequisites:

  • Go 1.23+ installed on your machine
  • Access to a Harvester cluster with a kubeconfig file (or run inside a Kubernetes cluster with proper permissions)

From Source

  1. Clone the repository:
git clone https://github.com/starbops/harvester-mcp-server.git
cd harvester-mcp-server
  1. Build the server binary:
make build
  1. Run the server (requires kubeconfig or in-cluster config):
./bin/harvester-mcp-server

Using Go install

go install github.com/starbops/harvester-mcp-server/cmd/harvester-mcp-server@latest
  1. Run the installed binary (if installed via Go install):
harvester-mcp-server

Optional with kubeconfig path or log level:

harvester-mcp-server --kubeconfig=/path/to/kubeconfig.yaml --log-level=debug

Additional notes

Tips and considerations:

  • Ensure your kubeconfig has sufficient privileges to read the resources you want to query (rbac considerations).
  • The server automatically discovers kubeconfig in this order: in-cluster config, --kubeconfig flag, KUBECONFIG env var, default ~/.kube/config.
  • If you plan to run inside a Kubernetes cluster, consider running with appropriate service account permissions and configuring network access for your MCP clients.
  • When using Claude Desktop or similar tools, add the Harvester MCP server under the mcpServers section with the correct command path and, optionally, kubeconfig and log level.
  • If you add new resources, register their tooling in the MCP server (types.go mappings, formatters, and server registration).
  • For debugging, run with --log-level=debug and inspect the formatted outputs for any adjustments needed in formatter logic.

Related MCP Servers

Sponsor this space

Reach thousands of developers