Get the FREE Ultimate OpenClaw Setup Guide →

rancher

MCP server from futuretea/rancher-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio futuretea-rancher-mcp-server npx -y @futuretea/rancher-mcp-server@latest --rancher-server-url https://your-rancher-server.com --rancher-token your-token

How to use

This Rancher MCP Server provides a centralized Model Context Protocol (MCP) interface over the Rancher API, allowing you to manage multiple Kubernetes clusters through Rancher with a unified set of tools. It exposes a suite of capabilities via the Steve API for Kubernetes resources (CRUD operations on pods, deployments, services, ConfigMaps, Secrets, CRDs, etc.), advanced features like patching, describing with events, filtering and searching resources, querying container logs, multi-pod log aggregation, and viewing rollout histories. It also offers Rancher-specific resource discovery through Norman API for clusters and projects, along with security controls to restrict write operations and sensitive data visibility. Output formats include table, YAML, and JSON, with configurable output filtering and pagination to tailor responses to your needs. The server supports multiple platforms and ships as a Node-based MCP server via an npm package, executable through npx or in your preferred tooling.

To use it, install and run the server using your Rancher server URL and a valid bearer token (or access key/secret). The CLI flags and environment variables let you enable/disable features, set the listening port, configure output formats, and control sensitive data exposure. Once running, you can access endpoints such as /healthz for health checks, /mcp for streamable MCP operations, and /sse for Server-Sent Events-based streaming. The toolset is designed to work with kubernetes and rancher toolchains, enabling safe, auditable multi-cluster management across your Rancher-managed environments.

How to install

Prerequisites:

  • Node.js (version 14+ recommended) and npm/yarn installed on your system
  • Access to a Rancher server with a valid API token
  • (Optional) Docker if you prefer containerized usage

Install and run using npx (recommended):

  1. Ensure you have Node.js and npm installed
  2. Run the MCP server via npx (no global install required):
npx @futuretea/rancher-mcp-server@latest --rancher-server-url https://your-rancher-server.com --rancher-token your-token

Configure via environment variables (optional):

  • RANCHER_MCP_PORT
  • RANCHER_MCP_RANCHER_SERVER_URL
  • RANCHER_MCP_RANCHER_TOKEN

Alternatively, if you prefer a local install (not required):

npm install -g @futuretea/rancher-mcp-server@latest
rancher-mcp-server --rancher-server-url https://your-rancher-server.com --rancher-token your-token

For VS Code / Claude Code integration, you can store the configuration in a mcp.json file as shown in the README:

{
  "servers": {
    "rancher": {
      "command": "npx",
      "args": [
        "-y",
        "@futuretea/rancher-mcp-server@latest",
        "--rancher-server-url",
        "https://your-rancher-server.com",
        "--rancher-token",
        "your-token"
      ]
    }
  }
}

Additional notes

Tips and known considerations:

  • Security: The server supports a global show_sensitive_data flag to mask sensitive data by default. Consider enabling it in production and using per-tool overrides if needed.
  • Output and filtering: Use output_filters to remove verbose fields (e.g., metadata.managedFields) for cleaner responses. Adjust list_output (json, table, yaml) to fit downstream tooling.
  • Access controls: Use read_only and disable_destructive to prevent unintended changes during audits or in CI environments.
  • Environment prefix: When using environment variables, prefix with RANCHER_MCP_ (e.g., RANCHER_MCP_RANCHER_TOKEN) to match the documented convention.
  • Port and URLs: If deploying behind a reverse proxy, supply sse-base-url so clients can correctly connect via the public URL.
  • Toolsets: By default, the toolsets include kubernetes and rancher; enable or disable specific tools as needed for your environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers