Skip to content

RFC-55: MCPServerEntry CRD — Types, Validation Controller, and MCPGroup Integration #4656

Description

@JAORMX

As a platform engineer managing remote MCP server backends,
I want a lightweight MCPServerEntry CRD that declares remote MCP endpoints without deploying infrastructure,
so that VirtualMCPServer can discover and route to remote backends via groupRef without unnecessary proxy pods.

Size: L
Dependencies: None
Labels: operator, api, kubernetes
RFC: RFC-0055

Context

VirtualMCPServer currently requires MCPRemoteProxy (which spawns thv-proxyrunner pods) to reach remote MCP servers. This forces OIDC auth on public remotes, creates dual auth boundary confusion, and wastes resources deploying pods just to make HTTP calls.

RFC-0055 introduces MCPServerEntry as a zero-infrastructure catalog entry — pure configuration telling vMCP where a remote server exists and how to authenticate to it. MCPServerEntry is an intermediate step that will eventually be superseded by MCPRemoteEndpoint (RFC-0057, #4254).

This story covers the CRD types, validation-only controller, and MCPGroup integration.

Scope

CRD Types (cmd/thv-operator/api/v1alpha1/mcpserverentry_types.go)

  • MCPServerEntrySpec with fields:
    • remoteURL (string, required) — HTTPS enforced by default, annotation override for development
    • transport (enum: streamable-http | sse, required)
    • groupRef (string, required — unlike MCPServer where it's optional)
    • externalAuthConfigRef (*ExternalAuthConfigRef, optional) — reuse existing type
    • headerForward (*HeaderForwardConfig, optional) — reuse existing type from MCPRemoteProxy
    • caBundleRef (*CABundleSource, optional) — reuse existing CABundleSource with ConfigMapKeyRef
  • MCPServerEntryStatus with:
    • Phase (Pending/Ready/Failed)
    • Conditions (Ready, GroupRefValid, AuthConfigValid, CABundleValid)
    • ObservedGeneration
  • CEL validation rules:
    • HTTPS enforcement on remoteURL (with annotation toolhive.stacklok.dev/allow-insecure-url override)
    • Transport enum constraint
    • Required groupRef
  • Printer columns: Phase, Transport, Remote URL, Group, Age
  • Short name: mse
  • Categories: toolhive

Validation Controller (cmd/thv-operator/controllers/mcpserverentry_controller.go)

  • Validation-only — no infrastructure created (no Deployment, Service, or Pod)
  • No network probing — controller validates configuration references only; runtime health checking belongs in vMCP
  • Validates:
    • Referenced MCPGroup exists → GroupRefValid condition
    • Referenced MCPExternalAuthConfig exists (when set) → AuthConfigValid condition
    • Referenced CA bundle ConfigMap exists (when set) → CABundleValid condition
  • Sets Ready condition based on all validations passing
  • Follows existing patterns: StatusManager, ObservedGeneration, metav1.Condition

MCPGroup Integration (cmd/thv-operator/controllers/mcpgroup_controller.go)

  • Add watch for MCPServerEntry (like existing findMCPGroupForMCPServer / findMCPGroupForMCPRemoteProxy)
  • Add findMCPGroupForMCPServerEntry mapper function
  • Update updateGroupMemberStatus() to list MCPServerEntry resources by groupRef
  • Add Entries and EntryCount fields to MCPGroupStatus
  • Update MCPGroup status condition to include entry validation

Helm & RBAC

  • CRD manifest in deploy/charts/operator-crds/files/crds/
  • RBAC rules in deploy/charts/operator/templates/clusterrole/role.yaml for mcpserverentries resource
  • +listType=map and +listMapKey=type on Conditions field

Acceptance Criteria

  • MCPServerEntry CRD types defined with all spec fields
  • CEL validation enforces HTTPS, transport enum, required groupRef
  • Status conditions: Ready, GroupRefValid, AuthConfigValid, CABundleValid
  • Validation controller validates all referenced resources exist
  • Controller creates no infrastructure (zero pods, services, deployments)
  • Controller never probes remote URL (no network calls)
  • MCPGroup controller watches MCPServerEntry and tracks in status
  • MCPGroupStatus includes Entries and EntryCount fields
  • Printer columns: Phase, Transport, Remote URL, Group, Age
  • Short name mse and categories toolhive
  • CRD manifest included in operator-crds Helm chart
  • RBAC rules added for mcpserverentries resource
  • Unit tests cover type validation, controller reconciliation, and MCPGroup integration
  • Integration tests in cmd/thv-operator/test-integration/ cover reference lifecycle
  • All tests pass (task test)

Activity

  1. added
    enhancement
    kubernetes
    api
    size/L
    on Apr 8, 2026
  2. self-assigned this
    on Apr 8, 2026
  3. changed the title [-]MCPServerEntry CRD — Types, Validation Controller, and MCPGroup Integration[/-] [+]RFC-55: MCPServerEntry CRD — Types, Validation Controller, and MCPGroup Integration[/+] on Apr 8, 2026
  4. JAORMX commented on Apr 9, 2026

    @JAORMX
    CollaboratorAuthor

    This has been implemented across two PRs:

    All core acceptance criteria are met: CRD types with full spec, validation controller that checks GroupRef/AuthConfig/CABundle references without creating infrastructure or probing URLs, MCPGroup watches and tracks entries, printer columns, RBAC, Helm chart CRD, and unit tests covering controller reconciliation and MCPGroup integration.

    A few minor deviations from the original spec worth noting:

    • The short name is mcpentry rather than mse (deliberate choice during implementation)
    • URL validation accepts both HTTP and HTTPS via ^https?:// rather than HTTPS-only (documented as intentional in the type comments)
    • Validation uses kubebuilder markers rather than CEL rules (functionally equivalent for these constraints)
    • Dedicated integration tests under test-integration/mcp-server-entry/ were not created, though the unit tests provide thorough coverage of all controller paths

    Closing as completed.

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

Metadata

Metadata

Assignees

Labels

apienhancementkubernetesoperatorsize/L

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions