Skip to content

Refactor vMCP to be K8s-aware with dynamic backend discovery #2857

Closed as not planned

Description

@jhrozek

Problem

Currently, the vMCP ecosystem has duplicated logic between the operator and vMCP server:

  • Operator discovers backends, resolves ExternalAuthConfigs, fetches secrets, and embeds everything into a ConfigMap
  • vMCP server can also discover backends (via pkg/vmcp/workloads/k8s.go) but currently loads config statically from ConfigMap at startup

This duplication creates several issues:

  1. Inconsistency - Two code paths doing similar things
  2. Staleness - Backend changes require operator reconcile → ConfigMap update → pod restart
  3. Complexity - Operator does too much; auth resolution logic is scattered

Proposed Solution

Make vMCP server K8s-aware and shift runtime responsibilities from operator to vMCP:

Operator becomes "dumb":

  • Manages K8s resources (Deployment, Service, ConfigMap, RBAC)
  • Writes minimal static config to ConfigMap
  • Polls vMCP /status endpoint to update CRD status

vMCP server becomes "smart":

  • Watches MCPServer/ExternalAuthConfig/Secret resources via informers
  • Discovers backends dynamically at runtime
  • Resolves auth and fetches secrets on-demand
  • Exposes /status endpoint for operator polling

Benefits

  • Single source of truth - vMCP owns all runtime discovery logic
  • Dynamic updates - Backend changes reflected without pod restart
  • Cleaner separation - Operator handles K8s resources, vMCP handles MCP logic
  • Secret rotation - Informers detect secret changes automatically

High-Level Implementation

  1. Add /status endpoint to vMCP for operator polling
  2. Create mutable backend registry with change notifications
  3. Add controller-runtime informers to vMCP (K8s mode only)
  4. Move auth resolution from operator to vMCP
  5. Simplify operator to poll status instead of discovering backends

Out of Scope

  • Multi-replica caching (Redis, sticky sessions)
  • Session capability refresh via MCP notifications
  • CLI mode changes (remains static)

Activity

  1. added
    enhancement
    go
    kubernetes
    vmcp
    on Dec 2, 2025
  2. jhrozek commented on Dec 3, 2025

    @jhrozek
    ContributorAuthor

    Closing as duplicate of #2855. The scope has been merged there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationenhancementgokubernetesoperatortech-debtvmcp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions