Sponsored by Deepsite.site

rootcause

Created By
Yuvraj10 days ago
Overview

RootCause ๐Ÿงญ

Go MCP codecov

RootCause is a local-first MCP server that helps operators manage Kubernetes resources and identify the real root cause of failures through interoperable toolsets.

Built in Go for a fast, single-binary workflow that competes with npx-based MCP servers while staying kubeconfig-native. โšก

Mission statement: โ€œRootCause is a local-first MCP server that helps operators manage Kubernetes resources and identify the real root cause of failures through interoperable toolsets.โ€

Inspired by:


Contents


Why RootCause

  • Local-first: Uses your kubeconfig identity only. No API keys required.
  • Interoperable toolchains: K8s, Linkerd, Istio, and Karpenter share the same clients, evidence, and render logic.
  • Fast and portable: One static Go binary, stdio-first MCP transport.
  • Competitive by design: Go binary speed and distribution with parity vs npx-based MCP servers.
  • Debugging built-in: Structured reasoning with likely root causes, evidence, and next checks.
  • Plugin-ready: Clean SDK to add toolchains without duplicating K8s logic.
  • โญ Like it? Star the repo to help us grow and keep shipping.

Quick Start ๐Ÿš€

  1. Run the server:
go run ./cmd/rootcause --config config.example.toml
  1. Use your existing kubeconfig (default) or point to one:
  • Uses KUBECONFIG if set, otherwise ~/.kube/config.
  • Override with --kubeconfig and --context.
  1. Connect your MCP client using stdio.

RootCause is built for local development. No API keys are required in this version.


Installation

Homebrew:

brew install yindia/homebrew-yindia/rootcause

Curl install:

curl -fsSL https://raw.githubusercontent.com/yindia/rootcause/refs/heads/main/install.sh | sh

Go install:

go install ./cmd/rootcause

Or build a local binary:

go build -o rootcause ./cmd/rootcause

Supported OS: macOS, Linux, and Windows.

Windows build example:

go build -o rootcause.exe ./cmd/rootcause

Usage

Run with a config file:

rootcause --config config.toml

Enable a subset of toolchains:

rootcause --toolsets k8s,istio

Enable read-only mode:

rootcause --read-only

MCP Client Example (stdio)

rootcause --config config.toml

Point your MCP client to run the command above and use stdio transport.


MCP Client Setup

All MCP clients need the same three fields:

  • command: the RootCause binary
  • args: CLI flags (--config, --toolsets, etc.)
  • env: optional environment variables like KUBECONFIG

Codex CLI

Add an MCP server entry pointing to RootCause (format varies by client version). Example:

[mcp.servers.rootcause]
command = "rootcause"
args = ["--config", "/path/to/config.toml"]
env = { KUBECONFIG = "/path/to/kubeconfig" }

Claude Desktop

Add RootCause to the MCP servers section (use your local config path). Example:

{
  "mcpServers": {
    "rootcause": {
      "command": "rootcause",
      "args": ["--config", "/path/to/config.toml"],
      "env": { "KUBECONFIG": "/path/to/kubeconfig" }
    }
  }
}

GitHub Copilot (VS Code)

If your Copilot/VS Code build supports MCP servers, add a server entry with the RootCause command. Example:

"mcp.servers": {
  "rootcause": {
    "command": "rootcause",
    "args": ["--config", "/path/to/config.toml"],
    "env": { "KUBECONFIG": "/path/to/kubeconfig" }
  }
}

If the MCP settings key differs in your client, map the fields above to its configuration format.


Toolchains

Enabled by default:

  • k8s
  • linkerd
  • karpenter
  • istio
  • helm
  • aws

Optional toolchains return โ€œnot detectedโ€ when the control plane is absent. Additional toolchains can be registered via the plugin SDK; see PLUGINS.md.


Tools

See TOOLS.md for the full tool catalog, quick picker, and graph-first debugging flow references.


Safety Modes

  • --read-only: removes apply/patch/delete/exec tools from discovery.
  • --disable-destructive: removes delete and risky write tools unless allowlisted (create/scale/rollout remain available).

Config and Flags

rootcause --config config.example.toml --toolsets k8s,linkerd,istio,karpenter,helm,aws

Flags

  • --kubeconfig
  • --context
  • --toolsets (comma-separated)
  • --config
  • --read-only
  • --disable-destructive
  • --log-level

If --config is not set, RootCause will use the ROOTCAUSE_CONFIG environment variable when present.


AWS Credentials

The AWS IAM tools use the standard AWS credential chain and region resolution. Set AWS_REGION or AWS_DEFAULT_REGION (defaults to us-east-1), optionally select a profile with AWS_PROFILE or AWS_DEFAULT_PROFILE, and use any of the normal credential sources (env vars, shared config/credentials files, SSO, or instance metadata).


Kubeconfig Resolution

If --kubeconfig is not set, RootCause follows standard Kubernetes loading rules: it uses KUBECONFIG when present, otherwise defaults to ~/.kube/config.

Authentication and authorization use your kubeconfig identity only in this version.


Architecture Overview

RootCause is organized around shared Kubernetes plumbing and toolsets that reuse it.

  • Shared clients (typed, dynamic, discovery, RESTMapper) are created once in internal/kube and injected into all toolsets.
  • Common safeguards live in internal/policy (namespace vs cluster enforcement and tool allowlists) and internal/redact (token/secret redaction).
  • internal/evidence gathers events, owner chains, endpoints, and pod status summaries used by all toolsets.
  • internal/render enforces a consistent analysis output format (root causes, evidence, next checks, resources examined) and provides the shared describe helper.
  • Toolsets live under toolsets/ and register namespaced tools (k8s.*, linkerd.*, karpenter.*, istio.*, helm.*, aws.iam.*, aws.vpc.*) through a shared MCP registry.

The MCP server runs over stdio using the MCP Go SDK and is designed for local kubeconfig usage. Optional in-cluster deployment is intentionally out of scope for Phase 1.

Config Reload

Send SIGHUP to reload config and rebuild the tool registry. On Windows, SIGHUP is not supported; restart the process to reload config.


MCP Transport

RootCause uses MCP over stdio by default (required). HTTP/SSE is not implemented in Phase 1.


Future Cloud Readiness

AWS IAM support is now available. The toolset system is designed to add deeper cloud integrations (EKS/EC2/VPC/GCP/Azure) without changing the core MCP or shared Kubernetes libraries.


Collaboration ๐Ÿค

We welcome collaborators, reviewers, and plugin authors. If you want to add toolsets, improve heuristics, or build cloud integrations, open an issue or PR. Help us make RootCause the fastest, most interoperable Kubernetes MCP server in the ecosystem.


Development

  • Config example: config.toml
  • Plugin SDK guide: PLUGINS.md

Run unit tests:

go test ./...
Recommend Clients
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
LutraLutra is the first MCP compatible client built for everyone
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Continueโฉ Create, share, and use custom AI code assistants with our open-source IDE extensions and hub of models, rules, prompts, docs, and other building blocks
ChatWiseThe second fastest AI chatbotโ„ข
Cline โ€“ #1 on OpenRouterAutonomous coding agent right in your IDE, capable of creating/editing files, executing commands, using the browser, and more with your permission every step of the way.
CursorThe AI Code Editor
Roo Code (prev. Roo Cline)Roo Code (prev. Roo Cline) gives you a whole dev team of AI agents in your code editor.
HyperChatHyperChat is a Chat client that strives for openness, utilizing APIs from various LLMs to achieve the best Chat experience, as well as implementing productivity tools through the MCP protocol.
LINKAGOGO-MCP---BOOKMARK-MANAGERManage your LinkaGoGo bookmarks through any AI assistant that supports the Model Context Protocol (MCP). Search, add, organize, tag, move, and export bookmarks conversationally โ€” 16 tools for full bookmark and folder management. Connect via Claude.ai, Claude Desktop, or any MCP-compatible client.
ZedCode at the speed of thought โ€“ Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
DeepChatYour AI Partner on Desktop
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
chatmcpChatMCP is an AI chat client implementing the Model Context Protocol (MCP).
MCP ConnectEnables cloud-based AI services to access local Stdio based MCP servers via HTTP requests
y-cli ๐Ÿš€A Tiny Terminal Chat App for AI Models with MCP Client Support
A Sleek AI Assistant & MCP Client5ire is a cross-platform desktop AI assistant, MCP client. It compatible with major service providers, supports local knowledge base and tools via model context protocol servers .
Cherry Studio๐Ÿ’ Cherry Studio is a desktop client that supports for multiple LLM providers.
MCP PlaygroundCall MCP Server Tools Online
Refact.aiOpen-source AI Agent for VS Code and JetBrains that autonomously solves coding tasks end-to-end.