Get the FREE Ultimate OpenClaw Setup Guide →

rancher

MCP server for Rancher - Kubernetes management and deployment platform

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lokimcpuniverse-rancher-mcp-server python -m rancher_mcp \
  --env RANCHER_API_URL="https://<your-rancher-server>" \
  --env RANCHER_API_TOKEN="Your Rancher API token"

How to use

This MCP server provides an integration layer between Rancher and GenAI applications. It exposes Rancher APIs through the MCP framework, enabling model-driven interactions with your Kubernetes cluster, deployments, and resources via MCP requests. Once running, you can configure environment variables for authenticating with your Rancher instance and then use the MCP endpoints to query resources, manage deployments, or trigger actions from your GenAI workflows. The server is designed with comprehensive error handling and retry logic to ensure reliable operation in production environments.

How to install

Prerequisites:

  • Python 3.8+ and pip
  • Git

Option A: Install from PyPI

  1. Install the package from PyPI:
    pip install rancher-mcp-server
    
  2. Run the MCP server (module-based entry point):
    python -m rancher_mcp
    

Option B: Install from source

  1. Clone the repository:
    git clone https://github.com/LokiMCPUniverse/rancher-mcp-server.git
    cd rancher-mcp-server
    
  2. Install in editable mode:
    pip install -e .
    
  3. Run the MCP server:
    python -m rancher_mcp
    

Configuration:

  • Create or set a .env file or export environment variables for Rancher authentication as described in the README (e.g., RANCHER_API_TOKEN and RANCHER_API_URL).

Additional notes

Notes and tips:

  • Ensure your Rancher API token has sufficient permissions for the operations you intend to perform.
  • Set RANCHER_API_URL to the base URL of your Rancher server (e.g., https:// rancher.example.com).
  • The server reads configuration from environment variables; consider using a .env file for local development.
  • If you encounter authentication errors, verify token scope and Rancher server URL reachability.
  • For production deployments, consider enabling rate limiting and retry backoffs as supported by the MCP framework.

Related MCP Servers

Sponsor this space

Reach thousands of developers