Rancher
Model Context Protocol (MCP) server for the Rancher ecosystem: multi-cluster Kubernetes, Harvester HCI (VMs, storage, networks), and Fleet GitOps.
What is Rancher?
Rancher is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server for the rancher ecosystem: multi-cluster kubernetes, harvester hci (vms, storage, networks), and fleet gitops.
Model Context Protocol (MCP) server for the Rancher ecosystem: multi-cluster Kubernetes, Harvester HCI (VMs, storage, networks), and Fleet GitOps.
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Model Context Protocol (MCP) server for the Rancher ecosyste
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx rancherConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Rancher
The Rancher MCP Server brings multi-cluster Kubernetes management, Harvester HCI infrastructure control, Helm release management, and Fleet GitOps operations into AI assistants through a Go-based MCP server. It supports five independent toolsets (rancher, kubernetes, harvester, helm, fleet), runs in read-only mode by default for safety, and can be deployed via npm or Docker.
Prerequisites
- Rancher 2.x instance accessible over HTTPS with a valid API token (obtain from Profile > Account & API Keys in the Rancher UI)
- Node.js 18+ for npx/npm installation, or Go 1.21+ to build from source, or Docker for containerized deployment
- Claude Desktop or another MCP-compatible client
- Rancher API token in the format token-xxxxx:yyyy
- Network access from the machine running Claude Desktop to the Rancher server URL
Obtain a Rancher API token
Log into the Rancher UI, navigate to your profile in the top-right corner, select Account & API Keys, and create a new API key. Copy the token in the format token-xxxxx:yyyy — you will need it for all configuration methods.
Install the package via npm (optional)
Install rancher-mcp-server globally with npm to avoid downloading it each time. Alternatively, npx with -y will download and run it on demand without a global install.
npm install -g rancher-mcp-server
# Or build from Go source:
git clone https://github.com/mrostamii/rancher-mcp-server.git
cd rancher-mcp-server
go build -o rancher-mcp-server ./cmd/rancher-mcp-serverConfigure Claude Desktop with inline flags
Add the rancher server to claude_desktop_config.json. Pass the server URL, token, and desired toolsets as command-line arguments. The server runs read-only by default.
{
"mcpServers": {
"rancher": {
"command": "npx",
"args": [
"-y", "rancher-mcp-server",
"--rancher-server-url", "https://rancher.example.com",
"--rancher-token", "token-xxxxx:yyyy",
"--toolsets", "harvester,rancher,kubernetes,fleet"
]
}
}
}Alternative: Configure with environment variables
Keep credentials out of the args array by passing them as environment variables. This is recommended for shared or version-controlled config files.
{
"mcpServers": {
"rancher": {
"command": "npx",
"args": ["-y", "rancher-mcp-server"],
"env": {
"RANCHER_MCP_RANCHER_SERVER_URL": "https://rancher.example.com",
"RANCHER_MCP_RANCHER_TOKEN": "token-xxxxx:yyyy",
"RANCHER_MCP_TOOLSETS": "rancher,kubernetes,helm,fleet,harvester"
}
}
}
}Enable write operations if needed
The server defaults to read-only mode. To allow resource creation and modification, set --read-only=false. To also allow deletions, add --disable-destructive=false.
# Add these args to enable writes:
"--read-only=false"
# Also add this to allow deletions:
"--disable-destructive=false"Restart Claude Desktop and verify
Restart Claude Desktop to activate the Rancher MCP server. Ask Claude to list Rancher clusters to confirm the connection is working.
Rancher Examples
Client configuration
claude_desktop_config.json entry for the Rancher MCP server using environment variables for credentials and all five toolsets enabled.
{
"mcpServers": {
"rancher": {
"command": "npx",
"args": ["-y", "rancher-mcp-server"],
"env": {
"RANCHER_MCP_RANCHER_SERVER_URL": "https://rancher.example.com",
"RANCHER_MCP_RANCHER_TOKEN": "token-xxxxx:yyyy",
"RANCHER_MCP_TOOLSETS": "rancher,kubernetes,harvester,helm,fleet",
"RANCHER_MCP_READ_ONLY": "true"
}
}
}
}Prompts to try
Sample prompts for managing Kubernetes clusters, Harvester VMs, Helm releases, and Fleet GitOps bundles through the Rancher MCP server.
- "List all Rancher clusters and their status"
- "Show me all running VMs in Harvester and their resource usage"
- "List all Helm releases in the production namespace of the local cluster"
- "Show me all Fleet bundles and which ones have drift detected"
- "Get all pods in the kube-system namespace of the downstream cluster"
- "List Rancher users and their assigned roles"Troubleshooting Rancher
Authentication error: 401 Unauthorized when connecting to Rancher
Verify the Rancher API token is in the correct format (token-xxxxx:yyyy). Tokens are shown only once when created in the Rancher UI — if lost, create a new one. Ensure the token has not expired and has sufficient permissions for the requested resources.
TLS certificate verification error connecting to Rancher
If your Rancher instance uses a self-signed or private CA certificate, add RANCHER_MCP_TLS_INSECURE=true to the env block. For production environments, configure the proper CA certificate on the machine running the MCP server instead.
Tools from a specific toolset (e.g., helm or fleet) are not appearing
Confirm the toolset name is included in RANCHER_MCP_TOOLSETS or the --toolsets argument. Valid values are: harvester, rancher, kubernetes, helm, fleet. The default is harvester only, so all other toolsets must be explicitly listed.
Frequently Asked Questions about Rancher
What is Rancher?
Rancher is a Model Context Protocol (MCP) server that model context protocol (mcp) server for the rancher ecosystem: multi-cluster kubernetes, harvester hci (vms, storage, networks), and fleet gitops. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Rancher?
Follow the installation instructions on the Rancher GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Rancher?
Rancher works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Rancher free to use?
Yes, Rancher is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Rancher Alternatives — Similar Cloud Services Servers
Looking for alternatives to Rancher? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Rancher in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Rancher?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.