rancher-mcp-server is a Model Context Protocol (MCP) server for the Rancher ecosystem, covering multi-cloud multi-cluster Kubernetes, Harvester HCI (virtual machines, storage, networking), and Fleet GitOps scenarios. It enables MCP-capable clients (such as Cursor, Claude Desktop, Claude Code) to operate the Rancher management plane via tool calls.
Main capabilities are divided by toolset:
- Harvester toolset: list/get virtual machines, images, volumes, networks, hosts; perform virtual machine operations; addon listing and enable/disable.
- Rancher toolset: access clusters and projects via Steve (management proxy); handle schemas, users, tokens, authentication configs, global role bindings, cluster registration tokens, node drivers, cloud credentials, catalogs, cluster repos, feature flags, settings, audit (if exposed) via the Norman management API (/v3); provide support bundle and generic actions when writes are enabled.
- Kubernetes toolset: list/get/create/patch/delete resources by apiVersion/kind; describe (resources and events), events, capacity.
- Helm toolset: list/get/history releases; install, upgrade, rollback, uninstall; repository list.
- Fleet toolset: GitRepo list/get/create; Bundle list; Fleet cluster list; drift detection.
Usage: Rancher API uses the same Bearer Token for Steve (/k8s/clusters/...) and Norman (/v3/...), with no CLI wrapper. Can be added to .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global); after saving, restart Cursor and confirm in Settings → Tools & MCP that rancher is listed and enabled. Can also be added to Claude Desktop's claude_desktop_config.json. Environment variables can be used to replace parameters; to enable write operations, add --read-only=false; delete-type operations also require --disable-destructive=false (the default value). Supports Streamable HTTP transport; add --transport and --port; the default MCP path is /mcp, connect to http://localhost:8080/mcp or server base address + /mcp, preferably supported by Claude Code; Cursor support may vary. Can also be built from source as a Go binary and referenced directly in the MCP configuration.
Security and configuration: read-only by default, supports --disable-destructive, sensitive data masking (Norman token/credential fields are masked by default unless --show-sensitive-data). Configuration can be via flags, environment variables (RANCHER_MCP_*) or files (YAML/TOML).
Typical scenarios: querying and managing Rancher multi-cluster, Harvester virtual machine lifecycle, Helm releases and Fleet GitOps repositories in MCP clients such as Cursor or Claude Code.
Preparation and setup: requires a Rancher API Token (log in to the Rancher UI, top-right avatar → Account & API Keys or API & Keys, create an API Key then copy it once, format similar to token-abc12:xyz...), used as --rancher-token or RANCHER_MCP_RANCHER_TOKEN. Harvester tools require a cluster ID on each call (e.g. c-tx8rn): you can open the Harvester cluster in the Rancher UI under Cluster Management and get it from the .../c/<cluster-id>/... in the URL; or use the API (Steve) curl -s -H "Authorization: Bearer YOUR_TOKEN" "https://YOUR_RANCHER_URL/k8s/clusters/local/v1/management.cattle.io.clusters" | jq '.data[] | {name: .metadata.name}'; Norman schemas query: curl -s -H "Authorization: Bearer YOUR_TOKEN" "https://YOUR_RANCHER_URL/v3/schemas" | jq '.data[0:5].id'.
Docker (Streamable HTTP): HTTP server mode uses GitHub Container Registry (ghcr.io) container images; stdio mode for Cursor/Claude uses npm. After running the server and exposing the port, the client connects to the MCP endpoint http://localhost:8080/mcp,例如 claude mcp add -t http rancher http://localhost:8080/mcp。
Supported platforms: macOS (Apple Silicon and Intel), Linux (x64 and ARM64).
Limitations and notes: Harvester list tools accept cluster (required), namespace, format (json|table), limit (default 100), continue (pagination token); write tools require read_only: false. Creating a KubeOVN VPC external network VM requires using harvester_vm_create and configuring network (the overlay network NAD associated with the KubeOVN subnet; first harvester_network_create with type=kubeovn, then harvester_subnet_create with provider={network}.{namespace}.ovn, vpc=<vpc-name>, nat_outgoing=true), interface_type (KubeOVN recommends managedtap, or bridge, using Multus as the primary network), subnet (optional KubeOVN subnet name, used for the ovn.kubernetes.io/logical_switch annotation). Rancher tools use the management cluster (local) and have no cluster parameter. Norman tools discover types and collection URLs via rancher_norman_schema_list / rancher_norman_schema_get (e.g., schema ids: user, token, cluster). rancher_cluster_repo_list / get first try Norman /v3/clusterrepos; if 404, fall back to the local cluster's catalog.cattle.io/v1 ClusterRepo (via Steve/Kubernetes), trying namespaces cattle-global-data, fleet-default, fleet-local, cattle-fleet-system; on success the JSON contains "_source":"kubernetes_api_fallback"; if all fail, it still returns 200-style JSON with "_source":"unavailable" and the error from each attempt, not a hard MCP error. rancher_catalog_list / get returns "_source":"unavailable" if Norman /v3/catalogs is not registered (404). rancher_audit_log_list returns "_source":"unavailable" and _http_status if 404/405. When ClusterRepo is unavailable in all cases, you can use kubernetes_list (cluster is local, api_version is catalog.cattle.io/v1, kind is ClusterRepo) or Helm/Fleet tools. All Helm tool calls require cluster (Rancher cluster ID); install/upgrade require chart, release, with optional repo_url, version, values (JSON). Fleet tools use the management cluster (local), with optional namespace (default fleet-default); list tools support format, limit, continue; fleet_gitrepo_create requires name, repo, with optional branch, paths; fleet_gitrepo_action supports pause, unpause, disablePolling, enablePolling, forceUpdate; fleet_gitrepo_clone can copy an existing GitRepo's spec to a new name. All Kubernetes tool calls require cluster; list/get support namespace, format (json|table), limit, continue; create/patch/delete are controlled by read_only and disable_destructive; kubernetes_logs does not support follow (streaming); you can use tail_lines and since_seconds to limit output; in some Rancher/proxy setups pod logs may return 503 or stream errors.