Skip to content

[PROPOSAL] Native MCP Server for AI-Driven Operator Development #5325

@vitorfloriano

Description

@vitorfloriano

What do you want to happen?

Summary

This proposal suggests integrating a native Model Context Protocol (MCP) server into the kubebuilder binary. This transforms Kubebuilder from a static CLI into a discoverable capability provider. By doing so, we can eliminate the manual overhead of managing AGENTS.md files and custom prompts, allowing MCP-compliant AI assistants (Cursor, Claude Code, Copilot, etc.) to discover Kubebuilder’s commands, best practices, and project context directly through a standardized protocol.

The Problem: "Instruction Rot" & Context Friction

Currently, to get high-quality assistance from AI when building an operator, users must:

  • Manually Provide Context: decide which files to include as context into the chat with the assistant.
  • Manage Instructions: Maintain files like AGENTS.md to "teach" the AI how to use the Kubebuilder CLI.
  • Handle "Prompt Rot": As Kubebuilder and controller-runtime evolve, these manual instructions become outdated. Users must manually check for updates and sync their prompts.

We are currently teaching users how to teach AIs. We should instead allow the binary to expose its knowledge directly.

The Proposal: kubebuilder mcp

We propose adding a kubebuilder mcp subcommand. This server could provide core capabilities to any MCP-compliant AI assistant, like the following:

  • Resources (Live Project Context)
    Instead of users uploading files, the binary serves project state as URIs. For example:
    kubebuilder://project/config: Returns the current PROJECT metadata.
    kubebuilder://project/apis: Provides a summarized view of the current GVK structure.
    Benefit: The AI always has "ground truth" context without user intervention.

  • Prompts (Embedded Best Practices)
    Kubebuilder exposes versioned, domain-specific prompt content directly from the binary.
    Example: A reconcile-loop prompt describing idiomatic, production-ready controller patterns for the specific Kubebuilder version in use.
    Benefit: Updating Kubebuilder automatically updates the exposed guidance, keeping AI-assisted workflows aligned with the current release.

  • Tools (Actionable Scaffolding)
    Expose Kubebuilder commands (init, create api, edit) as MCP Tools.
    Benefit: The AI can suggest and with user approval execute scaffolding commands directly, ensuring it uses the correct flags and plugins every time.

Strategic Advantage: Discoverability & Versioning

The primary advantage of a native MCP server over the current AGENTS.md is automatic synchronization:

  • Versioning: An AI interacting with Kubebuilder v4.7.1 would be able to receive different guidance than one interacting with v4.11.0.
  • Zero-Config: Users don't need to copy/paste prompts or maintain AI instructions. They simply point their AI to the kubebuilder mcp command, and the AI "discovers" everything it can do.

Why Now is The Best Time

  • Standardization: MCP is no longer proprietary; it is governed by the Linux Foundation through the AAIF. While still in its early days, it has received broad backing from multiple companies.
  • Tooling: The official Go SDK for MCP, which is maintained in collaboration with Google, has reached stability and is being actively developed, providing a reliable foundation.
  • Shift in Industry: As more developers move to AI-assisted coding, Kubebuilder needs to provide a first-class integration point for AI-assisted development workflows.

💡Mentorship Opportunity

Given the innovative nature of this project, this can be an ideal candidate for a mentorship (LFX/GSoC) project. It has a well-defined scope and is high-impact. The mentee will work with a modern protocol, CLI design in Go, and Kubernetes operator patterns.

Extra Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions