Skip to content

Add an MCP server exposing KubePlus kubectl plugins for AI agent integration #1477

Description

@devdattakulkarni

KubePlus ships a set of kubectl kubeplus plugins (metrics collection, provider/consumer kubeconfig management, resource composition inspection, etc.) that currently require direct CLI usage. As AI agent frameworks (kagent, Claude, and others) adopt the Model Context Protocol (MCP) as the standard way to expose tools to LLMs, KubePlus would benefit from an MCP server that wraps these plugins, enabling natural-language queries against KubePlus-managed instances.

Motivation:
Platform teams and ISVs using KubePlus for MIMT (multi-instance multi-tenancy) increasingly want conversational/agent-based interfaces for day-2 operations (status checks, metrics retrieval, instance health).
KubePlus's CRD-based model already tracks which pods, PVCs, and other resources belong to a single logical instance — information generic Kubernetes tools don't have. An MCP server is the natural way to expose that operator-native context to any MCP-compatible agent (kagent, Claude Desktop, custom agents), not just one specific integration.
Lowers the barrier for adopters to build custom monitoring, chatops, or diagnostic tooling on top of KubePlus without reimplementing plugin-wrapping logic from scratch.

Proposed scope (v1, read-only/observability-focused):
Wrap the following kubectl kubeplus plugin commands as individual MCP tools:
metrics — collect CPU/memory/storage/network metrics for a given CRD instance
list/describe instance(s) for a given CRD
resource composition / related-resources lookup for a given instance (pods, PVCs, services tied to that instance)
license status lookup (instance count/expiry against defined CRD licenses), if applicable

Each tool takes structured arguments (CRD name, instance name, namespace) matching the plugin's existing CLI parameters, with schemas/docstrings precise enough for reliable LLM tool-selection.
Package as a deployable container (kmcp/FastMCP or Go MCP SDK pattern) runnable as a standard Kubernetes Deployment alongside the KubePlus operator.

Document required RBAC (ServiceAccount/Role) scoped to read-only access on KubePlus CRDs and owned resources.

Out of scope for v1:
Write operations (creating/deleting/modifying instances) — v1 stays read-only to minimize risk surface for early adopters wiring this into agents.
Any specific agent implementation — that's tracked separately (see #[RCA agent issue]).

Location:
New top-level directory in this repo: mcp-server/, released independently as kubeplus-mcp-server-vX.Y.Z, following the same independent-versioning pattern already used for kubeplus-kubectl-plugins-vX.Y.Z.

Open question:
Go vs. Python for the server implementation — Go aligns with the existing operator codebase; Python/FastMCP is faster to prototype and iterate on. Leaning Python for v1 given faster iteration, with a Go rewrite possible later if this graduates to a heavier-use component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions