Cloud Native 15 min read

Connect Cursor to Harvester with Model Context Protocol (MCP) on Windows

This guide walks you through installing the Harvester MCP server on Windows, configuring it with a kubeconfig, and integrating it into Cursor's MCP settings so you can query and generate Kubernetes commands directly from your editor.

Ops Development Stories
Ops Development Stories
Ops Development Stories
Connect Cursor to Harvester with Model Context Protocol (MCP) on Windows

1. Overview of MCP and Harvester MCP

1.1 Model Context Protocol (MCP)

MCP is a protocol defined by Anthropic that standardises how large language models interact with external systems such as databases, Git repositories, Kubernetes clusters, or hyper‑converged platforms. An MCP deployment consists of two parts:

MCP Server : wraps a target system (e.g., Harvester, Kubernetes, Git, DB) and exposes a set of tools/resources.

MCP Client : a client application (Claude Desktop, Cursor, VS Code extensions, etc.) that consumes the server.

The model can view and operate the wrapped system via the exposed tools.

The main benefit is that a single MCP server can be accessed by any MCP‑compatible client.

1.2 Harvester MCP

Harvester is a hyper‑converged platform built on Kubernetes + KubeVirt for managing virtual machines, images, networks, and storage. The community provides a Harvester MCP Server that connects to a Harvester cluster using a kubeconfig file and exposes read‑only tools:

List / Get: Nodes, Namespaces, Pods

Harvester resources (List / Get only): VirtualMachine, Image, Volume, Network

✅ List nodes, VMs, images, networks, etc.
❌ No create / delete / power‑on/off for VMs yet.
❌ Only stdio mode; no HTTP/SSE endpoint.

Consequently the server is best used as an “observability + query” layer rather than a full automation console.

2. Prerequisites

A Harvester cluster reachable via its web UI.

A Windows development machine with:

Cursor (MCP support enabled).

Go 1.20+ installed and added to PATH.

2.1 Install Go on Windows

Ensure the Go binary directory (e.g., D:\Program Files\Go\bin) is in PATH.

Configure module mode and a fast proxy (optional but recommended for China mainland):

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

3. Install Harvester MCP Server

3.1 One‑line installation (recommended)

Run the following command in PowerShell or CMD:

go install github.com/starbops/harvester-mcp-server/cmd/harvester-mcp-server@latest
Note: the package path must include /cmd/harvester-mcp-server ; otherwise the Go tool reports “module found but does not contain package”.

The compiled binary ( harvester-mcp-server.exe) will be placed in %GOPATH%\bin.

3.2 Manual build (alternative)

If network conditions are poor, clone the repository and build locally:

git clone https://github.com/starbops/harvester-mcp-server.git
cd harvester-mcp-server
go build -o harvester-mcp-server.exe .\cmd\harvester-mcp-server

Move the resulting harvester-mcp-server.exe to a convenient location.

4. Prepare Harvester kubeconfig

The MCP server uses a kubeconfig file to authenticate to the Harvester cluster. Two common ways to obtain it:

4.1 Download from the Harvester Web UI (recommended)

Open the Harvester management page and log in.

In the user menu → Support, click “Download kubeconfig”.

Save the file, e.g., C:\Users\your-username\.kube\harvester.yaml.

The file usually contains a server address reachable from the workstation, so no further changes are required.

4.2 Copy from a Harvester node

On a Harvester node the kubeconfig is typically at /etc/rancher/rke2/rke2.yaml. After copying it locally you may need to adjust the server field (replace https://127.0.0.1:6443 with the node’s IP or VIP) or create an SSH tunnel: ssh -L 6443:127.0.0.1:6443 root@node-ip For testing environments you can also set insecure-skip-tls-verify: true in the kubeconfig.

5. Configure MCP in Cursor (stdio mode)

Cursor reads an mcp.json file to discover MCP servers.

5.1 Open the global MCP configuration

Open Settings in Cursor.

Locate the “MCP” section.

Click “Open global mcp.json” (or “Add new global MCP server”).

{
  "mcpServers": {}
}

5.2 Add Harvester MCP entry

Assume the server binary is at D:\go\bin\harvester-mcp-server.exe and the kubeconfig at D:\go\bin\rke2.yaml. Add the following JSON under "mcpServers" (use double backslashes for Windows paths):

{
  "mcpServers": {
    "harvester": {
      "type": "stdio",
      "command": "D:\\go\\bin\\harvester-mcp-server.exe",
      "args": [
        "--kubeconfig", "D:\\go\\bin\\rke2.yaml",
        "--log-level", "info"
      ]
    }
  }
}

Save the file and enable the harvester server in Cursor’s MCP settings.

When a model requests Harvester information, Cursor launches the harvester-mcp-server.exe process locally.

The process connects to the cluster using the supplied kubeconfig.

The model can then invoke the exposed tools (list VMs, get YAML, etc.).

6. Querying the cluster from Cursor

After configuration, start a new chat in Cursor and inform the model that Harvester tools are available, e.g.:

You can access my Harvester cluster via MCP. List all VMs and their namespaces for me.

Typical queries include:

List nodes with CPU/memory usage.

List VMs in a specific namespace.

Show the full YAML of a VM (e.g., test-wanger).

Generate a kubectl command or YAML for creating or copying a VM.

7. Limitations – read‑only behaviour

7.1 Supported operations

Pods: List / Get / Delete

VirtualMachines: List / Get only

Images, Volumes, Networks: List only

7.2 Why write actions fail

The current Harvester MCP implementation does not include Create, Patch, or Delete tools for VirtualMachines. Consequently the model can only generate kubectl snippets (e.g., kubectl patch vm …) which must be executed manually.

7.3 Work‑around

Use Cursor + Harvester MCP to retrieve information and let the model generate the appropriate kubectl command or YAML.

Copy the generated command/YAML into a terminal that has access to the Harvester kubeconfig and run it yourself.

If you need true write capability, fork the MCP repository and implement tools such as start_vm, stop_vm (modify spec.runStrategy) or create_vm_from_yaml that apply the resources.

8. HTTP access note

The Harvester MCP server only supports stdio mode; it does not expose an HTTP or Server‑Sent Events endpoint. This makes it suitable for desktop/IDE clients (Cursor, Claude Desktop, VS Code extensions) that can spawn a local process and communicate via stdin/stdout.

Platforms that require HTTP/SSE (e.g., Dify) cannot connect directly. An additional gateway that translates stdio to HTTP/SSE would be needed.

9. Conclusion

Combining Cursor with Harvester MCP provides a powerful “operations assistant” that can read live cluster state and generate exact kubectl commands or VirtualMachine YAML snippets, reducing the time spent looking up documentation.

Read‑only data is fetched directly from the cluster, eliminating hallucinated answers.

The workflow accelerates command and YAML creation.

Actual creation, deletion, or power‑on/off still requires manual execution of the generated commands.

When the community adds write support and an HTTP gateway, the workflow could evolve into a fully conversational, end‑to‑end cluster management experience.

cloud-nativeMCPKubernetesGoDevOpsCursorHarvester
Ops Development Stories
Written by

Ops Development Stories

Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.