Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Nov 14, 2025

This proposal enables automatic MCP registry population based on Gateway API resources, making it easy for administrators to expose and discover MCP servers.

Summary

The operator will watch Gateway API HTTPRoute resources (annotated with toolhive.stacklok.dev/registry-export: "true") to discover which MCP servers are externally accessible. It constructs the full endpoint URL by traversing to the parent Gateway resource and creates registry entries in the upstream MCP Registry format.

Key Features

  • Gateway API integration: Watches HTTPRoute resources for annotation-based discovery
  • Explicit opt-in: Only HTTPRoutes with registry-export annotation are discovered
  • Annotation fallback: Direct URL annotation for non-Gateway API users
  • Rich metadata: Tier, tools, and tags via annotations
  • Upstream format: Uses modelcontextprotocol/registry format with ToolHive extensions
  • Event-based tracking: Kubernetes Events instead of status field bloat

Two Discovery Methods

  1. Primary (Gateway API): Annotate HTTPRoute → operator discovers endpoint
  2. Fallback (Direct URL): Annotate MCP resource → operator uses explicit URL

Annotations

Discovery control:

  • toolhive.stacklok.dev/registry-export: Enable discovery
  • toolhive.stacklok.dev/registry-url: Direct URL (fallback)
  • toolhive.stacklok.dev/registry-name: Override entry name

Metadata:

  • toolhive.stacklok.dev/registry-tier: "Official" | "Community" | "Partner"
  • toolhive.stacklok.dev/registry-tools: Comma-separated tool names
  • toolhive.stacklok.dev/registry-tags: Comma-separated tags
  • toolhive.stacklok.dev/registry-description: Human-readable description

Design Decisions

  • Separation of concerns: Ingress config stays separate from MCP resources (follows ToolHive design principles)
  • Explicit control: Administrators choose what to expose via annotations
  • Progressive rollout: Create HTTPRoute, test it, then add annotation when ready
  • Standard format: Uses upstream MCP Registry format for compatibility

Implementation Phases

  1. Phase 1: Direct URL annotation discovery
  2. Phase 2: Gateway API HTTPRoute discovery
  3. Phase 3: Production hardening (cross-namespace validation, cleanup)

🤖 Generated with Claude Code

This proposal enables the ToolHive Kubernetes operator to automatically
populate the MCP registry with externally accessible endpoints for
MCPServer, MCPRemoteProxy, and VirtualMCPServer resources.

Key features:
- Gateway API HTTPRoute annotation-based discovery (primary approach)
- Direct URL annotation fallback (for non-Gateway API users)
- Explicit opt-in model for administrator control
- Upstream MCP registry format with ToolHive publisher extensions
- Kubernetes Events for discovery tracking

The approach maintains clear separation between ingress configuration
and MCP resource definitions, following ToolHive's design principles.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@JAORMX JAORMX force-pushed the proposal/operator-registry-gateway-api-integration branch from 364577d to 7bf59f7 Compare November 14, 2025 17:57
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.30%. Comparing base (c94268a) to head (7bf59f7).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2591      +/-   ##
==========================================
- Coverage   55.30%   55.30%   -0.01%     
==========================================
  Files         309      309              
  Lines       29129    29129              
==========================================
- Hits        16111    16109       -2     
- Misses      11585    11587       +2     
  Partials     1433     1433              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants