vmcp

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowedTools

func AllowedTools(u kuser.Info, profiles []types.VMCPProfile, selection map[string]types.VMCPComponentSet) []types.VMCPToolReference

AllowedTools returns component-scoped original names. Nil means unrestricted, while an empty non-nil slice grants no tools. Instance selections can only narrow grants. A name of "*" grants all tools enabled on that component.

func ApplyFixedSecretBindings added in v0.26.2

func ApplyFixedSecretBindings(component types.VMCPComponent, config []types.MCPConfig)

ApplyFixedSecretBindings binds fixed configuration to the Secrets selected by vMCP policy so the runtime resolves them the same way as catalog bindings.

func ComponentConfig

func ComponentConfig(component types.VMCPComponent) []types.MCPConfig

ComponentConfig applies vMCP policy rather than the source catalog's sharing flags.

func ComponentOAuthCredentialReference

func ComponentOAuthCredentialReference(component types.VMCPComponent) string

func ComponentsForInstance

func ComponentsForInstance(vmcp v1.VMCP, instance v1.VMCPInstance) []types.VMCPComponent

ComponentsForInstance retains a migrated connection's snapshots until the administrator explicitly upgrades the corresponding vMCP component.

func ConfigurationCheckHash added in v0.26.2

func ConfigurationCheckHash(enabledComponents []types.VMCPComponent, configurationSyncHash string) string

ConfigurationCheckHash identifies the user configuration status of an instance. Components must already be limited to those enabled for the instance user.

func ConfigurationCredentialName

func ConfigurationCredentialName() string

ConfigurationCredentialName is the name used for VMCP configuration credentials.

func ConfigurationKey

func ConfigurationKey(componentID, key string) string

ConfigurationKey qualifies a configuration key with its VMCP component ID. Component IDs cannot contain periods, so configuration keys may contain them without making the encoded key ambiguous.

func ConnectionConfiguration added in v0.26.2

func ConnectionConfiguration(component types.VMCPComponent) []types.MCPConfig

ConnectionConfiguration returns the user-supplied configuration a shared component connection carries. It is nil when there is none, matching what storage returns for an empty Config.

func ConnectionConfigurationHash added in v0.26.2

func ConnectionConfigurationHash(config []types.MCPConfig, instance v1.VMCPInstance) string

ConnectionConfigurationHash identifies the configuration a shared component connection was last synchronized with.

func ConnectionConfigurationSynced added in v0.26.2

func ConnectionConfigurationSynced(connection v1.MCPServerInstance, component types.VMCPComponent, instance v1.VMCPInstance) bool

ConnectionConfigurationSynced reports whether a shared component connection's credential reflects the instance user's current configuration.

func EnabledComponents added in v0.26.2

func EnabledComponents(u kuser.Info, vmcp v1.VMCP, components []types.VMCPComponent) []types.VMCPComponent

EnabledComponents removes the components that no matching profile enables. A component is enabled by a profile that allows all components or that has an entry for it in AllowedComponents. Disabled components need no connection, configuration, or OAuth. Profiles do not apply to personal VMCPs.

func ExtractStaticConfiguration

func ExtractStaticConfiguration(manifest *types.VMCPManifest, existingConfig map[string]string) map[string]string

ExtractStaticConfiguration removes fixed values from a manifest and returns them in the flat representation used by the credential store. Empty values are omitted because they represent missing configuration.

func FindInstance

func FindInstance(ctx context.Context, client kclient.Client, namespace, vmcpID, userID string) (*v1.VMCPInstance, error)

FindInstance chooses the oldest connection for a canonical vMCP URL. Migrated users may have several connections; their legacy URLs still select each one.

func GrantedToolOverrides added in v0.26.2

func GrantedToolOverrides(componentID string, overrides []types.ToolOverride, grant []types.VMCPToolReference) ([]types.ToolOverride, bool)

GrantedToolOverrides narrows a component's tool overrides to a grant, matching stable component identities and original tool names. The second result is false when the grant leaves the component unrestricted. Without overrides, every discovered tool is available, so the granted names become enabled overrides.

func InitializeComponentIDs

func InitializeComponentIDs(manifest *types.VMCPManifest) error

InitializeComponentIDs assigns new IDs to every component during VMCP creation. Clients cannot choose IDs because they form part of the credential namespace.

func InstanceConfigurationCredentialContext

func InstanceConfigurationCredentialContext(instanceID string) string

InstanceConfigurationCredentialContext scopes user configuration to a VMCP instance.

func InstanceGrant added in v0.26.2

func InstanceGrant(u kuser.Info, vmcp v1.VMCP, instance v1.VMCPInstance) []types.VMCPToolReference

InstanceGrant returns the tools an instance's user may call. The user is only consulted for shared VMCPs; a personal VMCP grants only its owner's selection. Nil means unrestricted, while an empty non-nil slice grants no tools.

func IsMultiUser

func IsMultiUser(component types.VMCPComponent) bool

IsMultiUser permits a shared runtime only when user inputs are headers.

func MatchingProfiles

func MatchingProfiles(u kuser.Info, profiles []types.VMCPProfile) []types.VMCPProfile

MatchingProfiles uses both Obot and authentication-provider groups.

func MissingRequiredConfiguration

func MissingRequiredConfiguration(component types.VMCPComponent, values map[string]string, userInputs bool) []string

MissingRequiredConfiguration checks either administrator inputs or user inputs. Catalog literals and secret bindings are already supplied by the definition. Returned keys are component-scoped, so identical keys never become ambiguous.

func NeedsUpdate added in v0.26.2

func NeedsUpdate(component types.VMCPComponent, current types.MCPServerCatalogEntrySnapshot) bool

NeedsUpdate reports whether a component's source has drifted from the snapshot deployed by the vMCP.

func OAuthCredentialCheckHash

func OAuthCredentialCheckHash(req router.Request, namespace, reference, sourceID string) (string, error)

OAuthCredentialCheckHash watches the source and identifies the credential version to check. The revision survives the catalog controller clearing its sync annotation.

func ParseConfigurationKey

func ParseConfigurationKey(key string) (componentID, configurationKey string, ok bool)

ParseConfigurationKey parses a key produced by ConfigurationKey.

func PruneRemovedComponentProfiles

func PruneRemovedComponentProfiles(previous []types.VMCPComponent, manifest *types.VMCPManifest)

PruneRemovedComponentProfiles removes grants only for components that were actually removed, leaving unrelated invalid references for validation.

func ReconcileComponentIDs

func ReconcileComponentIDs(existing types.VMCPManifest, desired *types.VMCPManifest) error

ReconcileComponentIDs preserves IDs during update and assigns IDs to newly added components. A supplied ID must already belong to the VMCP.

func ResolveConnectID

func ResolveConnectID(ctx context.Context, client kclient.Client, id, userID string) (*v1.VMCP, *v1.VMCPInstance, error)

ResolveConnectID resolves both current IDs and migrated MCP aliases. A nil VMCP means the ID still belongs to the legacy resource model. Instance aliases always identify one connection, never another user's connection.

func SameConnectionConfiguration added in v0.26.2

func SameConnectionConfiguration(a, b []types.MCPConfig) bool

SameConnectionConfiguration compares configurations as storage keeps them. Storage drops empty slices, so a nil and an empty slice, at any depth, are the same configuration.

func ServerConfigurationSynced added in v0.26.2

func ServerConfigurationSynced(server v1.MCPServer, vmcp v1.VMCP, instance v1.VMCPInstance) bool

ServerConfigurationSynced reports whether a component server's configuration credential reflects the vMCP's fixed values, the instance user's values, and the component snapshot. Shared servers have no instance, so pass an empty one.

func ServerInstanceComponent

func ServerInstanceComponent(ctx context.Context, client kclient.Client, connection v1.MCPServerInstance, server v1.MCPServer) (types.VMCPComponent, error)

ServerInstanceComponent validates the connection's ownership and current sharing mode.

func ServerOAuthCredentialReference

func ServerOAuthCredentialReference(ctx context.Context, client kclient.Reader, server v1.MCPServer) (reference, sourceID string, err error)

ServerOAuthCredentialReference resolves shared and dedicated component servers without depending on the continued existence of the source catalog entry.

func SetStaticConfigurationHashes

func SetStaticConfigurationHashes(vmcp *v1.VMCP, configuration map[string]string)

SetStaticConfigurationHashes records both the deployment-wide synchronization hash and the component hashes used to retain unrelated migrated overrides.

func SourceDigest added in v0.26.2

func SourceDigest(snapshot types.MCPServerCatalogEntrySnapshot) string

SourceDigest identifies the parts of a catalog entry that require a vMCP component update. Informational fields are excluded so that catalog copy, icon, metadata, and upgrade-note changes alone do not report drift.

func StaticConfigurationCredentialContext

func StaticConfigurationCredentialContext(vmcpID string) string

StaticConfigurationCredentialContext scopes fixed configuration to a VMCP.

func StaticConfigurationCredentialName added in v0.26.2

func StaticConfigurationCredentialName(vmcp *v1.VMCP) string

func StaticOAuthCredentialReference

func StaticOAuthCredentialReference(manifest types.MCPServerCatalogEntryManifest, entryID string) string

StaticOAuthCredentialReference returns the catalog-owned credential context. The credential name within that context is always StaticOAuthCredentialName.

func ToolGranted

func ToolGranted(grant []types.VMCPToolReference, tool types.VMCPToolReference) bool

ToolGranted checks an exact name or wildcard within the same component. A nil grant is unrestricted; an empty grant permits nothing.

func ValidateAndEncodeUserConfiguration

func ValidateAndEncodeUserConfiguration(manifest types.VMCPManifest, configuration types.VMCPConfiguration) (map[string]string, error)

ValidateAndEncodeUserConfiguration validates that every supplied value is user-allowed by the VMCP and returns the credential-store representation.

func VersionStaticConfiguration added in v0.26.2

func VersionStaticConfiguration(vmcp *v1.VMCP, configuration map[string]string)

VersionStaticConfiguration lets a manifest and its credential revision be published together without overwriting credentials used by the old manifest. The vMCP status handler deletes superseded revisions once a newer one is published.

Types

This section is empty.

Jump to

Keyboard shortcuts

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