mcpserver

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package mcpserver reconciles MCPServer objects. MCPServer is a built-in, core-hosted "provider": the CRD is distributed to tenant workspaces via the core.railgrid.ai APIExport/APIBinding, and this reconciler — running in-process in the hub against the core.railgrid.ai multicluster manager — provisions each server's long-lived identity (ServiceAccount + token Secret + RBAC) and publishes its endpoint URL + token reference on status. The aggregate MCP serving itself lives in pkg/hub/mcpaggregate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupWithManager

func SetupWithManager(mgr mcmanager.Manager, kcpConfig *rest.Config, hubExternalURL string, enumerate ProviderEnumerator) error

SetupWithManager registers the MCPServer controller with the core.railgrid.ai multicluster manager. kcpConfig is the hub's admin config, used to build a direct per-tenant client for identity provisioning (the token controller populates legacy token Secrets written through a direct client, which the APIExport virtual-workspace client does not guarantee). enumerate lists the Ready MCP-exposing providers each server discovers its tools from.

Types

type ActionGrant

type ActionGrant struct {
	Group    string
	Resource string
	// Name is the action name without its version suffix — the subresource
	// the provider's SelfSubjectAccessReview names.
	Name string
	// ReadOnly mirrors the catalog's declaration; read-only actions stay
	// granted on readOnly servers.
	ReadOnly bool
}

ActionGrant is one provider action from the platform catalog, expressed as the RBAC coordinate a provider checks before invoking it: "create" on <Resource>/<Name> in Group (e.g. tables/query_table).

type ActionGrantSource

type ActionGrantSource func(ctx context.Context) ([]ActionGrant, error)

ActionGrantSource lists the action grants declared by platform providers.

type ProviderEnumerator

type ProviderEnumerator = mcpaggregate.ProviderEnumerator

ProviderEnumerator returns the Ready, MCP-exposing providers visible to a caller. Wired from the hub's provider registry — the same enumerator the aggregate endpoint federates with (mcpaggregate.RegistryEnumerator).

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler provisions each MCPServer's identity and publishes its status.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req mcreconcile.Request) (ctrl.Result, error)

Reconcile provisions the server's identity and writes status. Provisioned objects are owned by the MCPServer, so they are garbage-collected when it is deleted. Until kcp's token controller populates the token Secret, the server stays Provisioning and the reconcile requeues.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL