# Rancher MCP

> Rancher MCP gives your AI agent direct access to manage complex Kubernetes environments through the Rancher platform. You can query cluster health, list namespaces across multiple clusters, and diagnose individual pod failures—all from a simple chat prompt. It eliminates tedious context switching between CLI commands and UI dashboards.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** kubernetes, container-orchestration, cluster-management, devops, containers, infrastructure-monitoring

## Description

Managing container infrastructure usually means juggling command-line interfaces and web portals for every single cluster you own. This MCP changes that. It lets your AI agent interact with all the Kubernetes clusters managed under your Rancher control plane, turning complex operations into simple conversations. Need to know if a specific microservice deployment is running correctly? Just ask. The AI can check everything from listing available projects and namespaces to verifying the operational health of any workload or pod. All the data you need—cluster status, node lists, user accounts—is instantly accessible through your preferred client on Vinkius. You stop debugging in terminals; you start asking questions.

## Tools

### get_cluster
Retrieves specific operational details for one Kubernetes cluster.

### get_project
Gets the detailed information for a chosen Rancher project.

### list_apps
Lists all Helm applications that are installed within a specific project.

### list_catalogs
Retrieves a list of available Helm chart repositories (Catalogs).

### list_clusters
Generates an inventory listing all Kubernetes clusters managed by Rancher.

### list_namespaces
Lists the specific logical partitions (namespaces) tied to a project.

### list_nodes
Provides an inventory of every worker node within a specified cluster.

### list_projects
Lists the logical projects available inside a given cluster.

### list_users
Generates a list of all user accounts defined in the Rancher platform.

### list_workloads
Lists all Kubernetes workloads, such as Deployments and StatefulSets, within a project.

## Prompt Examples

**Prompt:** 
```
List all Kubernetes clusters managed by my Rancher instance.
```

**Response:** 
```
Through `list_clusters`, I have enumerated your environment. You have 2 visible instances: 'production-us-east' (State: Active) and 'staging-development' (State: Provisioning).
```

**Prompt:** 
```
Query the namespaces available inside cluster 'c-8xk9z'.
```

**Response:** 
```
I requested `list_namespaces` for the cluster ID 'c-8xk9z'. It contains several namespaces, including: 'default', 'kube-system', 'monitoring-setup', and 'frontend-tier'.
```

**Prompt:** 
```
Check the status of the 'auth-service' pod located in the 'backend-production' namespace on cluster 'c-lq4x2'.
```

**Response:** 
```
Checking pod metrics... Using `list_pods`, the 'auth-service' pod is marked 'Running', executing in the requested namespace. No crash loops were detected in its recent container history.
```

## Capabilities

### Identify Managed Clusters
Get a full inventory of every Kubernetes cluster connected to the Rancher platform.

### View Cluster Components
List all nodes and available logical projects within your managed clusters.

### Diagnose Pod Status
Check the current operational state of specific pods, including identifying crash loops or health issues.

### Audit Namespaces and Workloads
Explore logical partitions (namespaces) and list all deployed applications and workloads within a project.

### Check User Access
Retrieve a complete list of user accounts managed by the Rancher platform.

## Use Cases

### Troubleshooting a new deployment failure
A developer notices high error rates for the 'billing-api' service. Instead of manually checking logs and running `kubectl get pods`, they ask their agent to check the pod status using `list_pods`. The agent immediately reports that the pod is in a crash loop, pointing them straight to the failing container.

### Auditing resource sprawl
The administrator needs to know if a new team created unauthorized environments. They ask the agent to run `list_clusters` and then use `list_projects`. The system quickly returns all active project IDs, allowing them to flag any unexpected or unmanaged resources.

### Verifying service scope
A backend developer needs to know if a specific feature lives in the 'staging' environment. They query `list_namespaces` for the target cluster ID, confirming the existence of the necessary development partitions before starting their work.

### Onboarding new team members
A manager needs to give a new engineer an overview of who can access which resources. They ask the agent to run `list_users` and receive a clean, actionable list of all authenticated accounts in the platform.

## Benefits

- Stop context switching between dashboards. You can list all managed clusters and view their status instantly, bypassing the need to navigate through multiple UIs.
- Diagnose specific service failures fast. Use `list_workloads` or check pod metrics to pinpoint exactly which microservice is crashing within a namespace.
- Gain full visibility into your infrastructure. By running `list_nodes`, you can get an immediate inventory of every machine acting as a worker in any cluster.
- Understand project structure easily. Need to see what's deployed? Use `list_apps` or check the list from `list_namespaces` to map out service boundaries.
- Manage user access without logging in. Running `list_users` gives you an immediate roster of who has access to which part of your environment.

## How It Works

The bottom line is: you talk to your agent, it talks to Rancher, and you get a clear, summarized answer without writing any code.

1. Enable this MCP and configure it using your specific Rancher Server URL and the required Bearer Token for API access.
2. Instruct your AI client to perform a diagnostic task, such as listing all available clusters or checking a pod’s status.
3. The AI executes the query against the Rancher platform and returns structured data detailing the cluster state, namespaces, or workload metrics.

## Frequently Asked Questions

**How do I check if my pods are running using Rancher MCP?**
You use the `list_pods` tool to diagnose the status of any pod. This query tells you if a container is 'Running', or if it's stuck in a crash loop, saving you manual CLI checks.

**What is the difference between list_clusters and list_projects?**
`list_clusters` gives you an inventory of all physical clusters managed by Rancher. `list_projects` works within a single cluster to show logical groupings or boundaries for resources.

**Does Rancher MCP help me find the right namespace?**
Yes, running `list_namespaces` will enumerate all the logical partitions (namespaces) available inside your target project. This helps you confirm where a specific service is deployed.

**Can I list applications installed in a project?**
You use the `list_apps` tool to see every Helm application deployed within a given project boundary, giving you a quick inventory of your services.