Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyToolOverrides(tools []otypes.MCPServerTool, toolOverrides []otypes.ToolOverride, ...) []otypes.MCPServerTool
- func AuthCodeURL(conf *oauth2.Config, urlFromMetadata, resourceURL, state, verifier string) (string, error)
- func ComputeK8sSettingsHash(settings v1.K8sSettingsSpec, ...) string
- func ConfigurationOptionValueValid(field types.MCPHeader, values map[string]string) bool
- func ConvertTools(tools []*gomcp.Tool, unsupportedTools []string) ([]otypes.MCPServerTool, error)
- func CoreResourceRequirements(resources *types.MCPResourceRequirements) (*corev1.ResourceRequirements, error)
- func CurrentImagePullSecretNames(ctx context.Context, client kclient.Client, mcpRuntimeBackend string, ...) ([]string, error)
- func EffectiveDefaultMCPResourceRequirements(k8sSettings v1.K8sSettingsSpec) corev1.ResourceRequirements
- func ExchangeOAuthToken(ctx context.Context, conf *oauth2.Config, code, verifier, resourceURL string) (*oauth2.Token, error)
- func GetOAuthAuthorizationURL(ctx context.Context, callbackHandler CallbackHandler, conf *oauth2.Config, ...) (string, <-chan CallbackPayload, string, error)
- func IsKubernetesBackend(backend string) bool
- func ListAllowedSecretBindingTargets(ctx context.Context, c kclient.Client, obotNamespace, allowedLabel string) ([]types.MCPAllowedSecretBindingTarget, error)
- func MMMCPConfig(server ServerConfig, env map[string][]byte) *mmmcpconfig.Config
- func ManifestHasConfigurationOptions(manifest types.MCPServerManifest) bool
- func MergeBoundCreds(ctx context.Context, c kclient.Client, obotNamespace string, ...) (map[string]string, error)
- func MessageIDString(id any) string
- func OAuthResourceURL(authorizationEndpoint, resourceURL string) string
- func OTELEnv(serviceName string, hostBaseURL string) map[string][]byte
- func ParseOAuthResourceURL(metadata json.RawMessage) (string, error)
- func RequiresStaticOAuth(server v1.MCPServer) bool
- func ResolveOAuthResourceURL(authorizationEndpoint, discoveredResourceURL, connectionURL string) string
- func ResolveRemoteURLTemplate(manifest types.MCPServerManifest, configuration map[string]string) (string, []string)
- func ServerHookConfig(server ServerConfig) (Hooks, HookServerConfigs)
- func SourceIDForURL(sourceURL string) string
- func URLTemplateReferences(urlTemplate string) []string
- func ValidateCatalogConfigurationConstraints(manifest types.MCPServerManifest, catalog types.MCPServerCatalogEntryManifest) error
- func ValidateCatalogEntryForRoute(manifest types.MCPServerCatalogEntryManifest, catalogID, workspaceID string) error
- func ValidateCatalogEntryManifest(ctx context.Context, manifest types.MCPServerCatalogEntryManifest, ...) error
- func ValidateConfiguredK8sSettingsResourceMaximums(k8sSettings v1.K8sSettingsSpec, maximums ResourceMaximums) error
- func ValidateConfiguredOptions(config []types.MCPConfig, values map[string]string) ([]string, error)
- func ValidateK8sSettingsResourceMaximums(k8sSettings v1.K8sSettingsSpec, maximums ResourceMaximums) error
- func ValidatePSALevel(level string) bool
- func ValidateRemoteMCPURL(ctx context.Context, rawURL string, config RemoteMCPURLValidationConfig) error
- func ValidateSecretBindings(manifest types.MCPServerManifest, gitManaged, adminManaged bool, ...) error
- func ValidateSecretBindingsAvailable(ctx context.Context, c kclient.Client, obotNamespace string, ...) error
- func ValidateSecretBindingsCatalogEntry(manifest types.MCPServerCatalogEntryManifest, gitManaged, userIsAdmin bool, ...) error
- func ValidateServerManifest(ctx context.Context, manifest types.MCPServerManifest, isMultiUser bool, ...) error
- func ValidateSystemMCPServerCatalogEntryManifest(ctx context.Context, manifest types.SystemMCPServerCatalogEntryManifest, ...) error
- func ValidateSystemMCPServerManifest(ctx context.Context, manifest types.SystemMCPServerManifest, ...) error
- func ValidateTemplateReferences(manifest types.MCPServerManifest) error
- func ValidateTemplateReferencesCatalogEntry(manifest types.MCPServerCatalogEntryManifest) error
- type AuthURLHandler
- type AuthorizationServerMetadata
- type CallbackHandler
- type CallbackPayload
- type Client
- type ClientCredLookup
- type ClientOption
- type ClientRegistrationMetadata
- type ComponentServer
- type Config
- type ContainerizedValidator
- func (v ContainerizedValidator) ValidateCatalogConfig(_ context.Context, manifest types.MCPServerCatalogEntryManifest) error
- func (v ContainerizedValidator) ValidateConfig(_ context.Context, manifest types.MCPServerManifest) error
- func (v ContainerizedValidator) ValidateSystemConfig(_ context.Context, manifest types.SystemMCPServerManifest) error
- type ErrNotSupportedByBackend
- type File
- type GlobalTokenStore
- type HTTPClientOptions
- type HookMapping
- type HookMutation
- type HookRunner
- type HookServerConfigs
- type HookTarget
- type Hooks
- type Message
- type MissingSecretBinding
- type NPXValidator
- func (v NPXValidator) ValidateCatalogConfig(_ context.Context, manifest types.MCPServerCatalogEntryManifest) error
- func (v NPXValidator) ValidateConfig(_ context.Context, manifest types.MCPServerManifest) error
- func (v NPXValidator) ValidateSystemConfig(_ context.Context, manifest types.SystemMCPServerManifest) error
- type OAuthMetadata
- type Options
- type PSAEnforceLevel
- type RPCError
- type RemoteMCPURLValidationConfig
- type RemoteValidator
- func (v RemoteValidator) ValidateCatalogConfig(ctx context.Context, manifest types.MCPServerCatalogEntryManifest) error
- func (v RemoteValidator) ValidateConfig(ctx context.Context, manifest types.MCPServerManifest) error
- func (v RemoteValidator) ValidateSystemConfig(ctx context.Context, manifest types.SystemMCPServerManifest) error
- type ResourceMaximumExceededError
- type ResourceMaximums
- type RuntimeValidator
- type RuntimeValidators
- type ServerConfig
- type SessionManager
- func (sm *SessionManager) ClientForMCPServerForOAuthCheck(ctx context.Context, serverConfig ServerConfig, opt ClientOption) (*Client, error)
- func (sm *SessionManager) Close()
- func (sm *SessionManager) CloseClient(server ServerConfig, clientScope string)
- func (sm *SessionManager) EffectiveKubernetesResourceMaximums(ctx context.Context, storageClient kclient.Client) (ResourceMaximums, error)
- func (sm *SessionManager) EffectiveKubernetesResourceMaximumsForSettings(settings v1.K8sSettingsSpec) ResourceMaximums
- func (sm *SessionManager) GenerateToolPreviews(ctx context.Context, tempMCPServer v1.MCPServer, serverConfig ServerConfig) ([]types.MCPServerTool, error)
- func (sm *SessionManager) GetCapacityInfo(ctx context.Context) (types.MCPCapacityInfo, error)
- func (sm *SessionManager) GetCapacityInfoForServers(ctx context.Context, serverNames []string) (types.MCPCapacityInfo, error)
- func (m *SessionManager) GetOAuthMetadata(ctx context.Context, serverConfig ServerConfig, clientName, redirectURL string, ...) (OAuthMetadata, error)
- func (sm *SessionManager) GetPrompt(ctx context.Context, serverConfig ServerConfig, name string, ...) ([]*gomcp.PromptMessage, string, error)
- func (sm *SessionManager) GetServerDetails(ctx context.Context, serverConfig ServerConfig) (types.MCPServerDetails, error)
- func (sm *SessionManager) HTTPClientForServer(server ServerConfig, opts HTTPClientOptions) (*http.Client, error)
- func (sm *SessionManager) IDAndAudienceFromConnectURL(ctx context.Context, id, userID string) (string, string, error)
- func (sm *SessionManager) LaunchServer(ctx context.Context, serverConfig ServerConfig) (ServerConfig, error)
- func (sm *SessionManager) ListPrompts(ctx context.Context, serverConfig ServerConfig) ([]*gomcp.Prompt, error)
- func (sm *SessionManager) ListResources(ctx context.Context, serverConfig ServerConfig) ([]*gomcp.Resource, error)
- func (sm *SessionManager) ListTools(ctx context.Context, serverConfig ServerConfig) ([]*gomcp.Tool, error)
- func (sm *SessionManager) MCPRuntimeBackend() string
- func (sm *SessionManager) PingServer(ctx context.Context, serverConfig ServerConfig) error
- func (sm *SessionManager) ReadResource(ctx context.Context, serverConfig ServerConfig, uri string) ([]*gomcp.ResourceContents, error)
- func (sm *SessionManager) RemoteConfigForBackend() (RemoteMCPURLValidationConfig, []string)
- func (sm *SessionManager) RemoteMCPURLValidationConfig() RemoteMCPURLValidationConfig
- func (sm *SessionManager) ResourceMaximums() ResourceMaximums
- func (sm *SessionManager) RestartServerDeployment(ctx context.Context, server ServerConfig) error
- func (sm *SessionManager) ServerCapabilities(ctx context.Context, serverConfig ServerConfig) (*gomcp.ServerCapabilities, error)
- func (sm *SessionManager) ServerConfigForVMCP(ctx context.Context, vmcpID, userID string) (ServerConfig, error)
- func (sm *SessionManager) ServerForAction(ctx context.Context, id, userID string) (v1.MCPServer, ServerConfig, error)
- func (sm *SessionManager) ServerForActionWithConnectID(ctx context.Context, id, userID string) (string, v1.MCPServer, ServerConfig, error)
- func (sm *SessionManager) ServerForActionWithConnectIDAllowMissingConfig(ctx context.Context, id, userID string) (string, v1.MCPServer, ServerConfig, []string, error)
- func (sm *SessionManager) ShutdownIdleServer(ctx context.Context, serverName string) error
- func (sm *SessionManager) ShutdownServer(ctx context.Context, serverName string) error
- func (sm *SessionManager) StartupKubernetesResourceMaximums(ctx context.Context, storageClient kclient.Client) (ResourceMaximums, error)
- func (sm *SessionManager) StreamServerLogs(ctx context.Context, serverConfig ServerConfig) (io.ReadCloser, error)
- func (sm *SessionManager) TransformObotHostname(hostname string) string
- type SessionManagerHookRunner
- type SessionMessageHook
- type TokenStorage
- type UVXValidator
- func (v UVXValidator) ValidateCatalogConfig(_ context.Context, manifest types.MCPServerCatalogEntryManifest) error
- func (v UVXValidator) ValidateConfig(_ context.Context, manifest types.MCPServerManifest) error
- func (v UVXValidator) ValidateSystemConfig(_ context.Context, manifest types.SystemMCPServerManifest) error
- type ValidationOptions
- type Webhook
- type WebhookHelper
Constants ¶
const ( // MaxMCPServerStartupTimeout is the maximum value allowed to be used in ServerConfig.StartupTimeout MaxMCPServerStartupTimeout = 10 * time.Minute // AuditLogIgnore is a metadata field that tells the audit log persistence layer to ignore audit logs for this server AuditLogIgnore = "obot.mcp.ignoreAuditLog" )
const (
// HookMutationsMetaKey identifies hook mutation metadata in MCP results.
HookMutationsMetaKey = "ai.obot.hooks/mutations"
)
const (
RuntimeBackendKubernetes = "kubernetes"
)
Variables ¶
var ( ErrHealthCheckTimeout = errors.New("timed out waiting for MCP server to be ready") ErrHealthCheckFailed = errors.New("MCP server is not healthy") ErrPodCrashLoopBackOff = errors.New("pod is in CrashLoopBackOff state") ErrImagePullFailed = errors.New("failed to pull container image") ErrPodSchedulingFailed = errors.New("pod could not be scheduled") ErrPodConfigurationFailed = errors.New("pod configuration is invalid") ErrInsufficientCapacity = errors.New("insufficient cluster capacity to deploy MCP server") )
var (
ErrRPCUnknown = NewRPCError(-32001, "JSON RPC unknown error")
)
var ( // ErrServerNotRunning is returned when an MCP server is not running ErrServerNotRunning = errors.New("mcp server is not running") )
var ( // ValidPSALevels contains all valid Pod Security Admission levels ValidPSALevels = []string{"privileged", "baseline", "restricted"} )
Functions ¶
func ApplyToolOverrides ¶ added in v0.15.0
func ApplyToolOverrides(tools []otypes.MCPServerTool, toolOverrides []otypes.ToolOverride, toolPrefix string) []otypes.MCPServerTool
ApplyToolOverrides applies ToolOverrides to a component's tool array, filtering out disabled tools and applying name/description overrides. If overrides are present, they act as an allowlist - only tools explicitly listed are included. toolPrefix, if non-empty, is prepended to every returned tool's Name so previews match what the vMCP will expose via mmmcp at runtime.
func AuthCodeURL ¶ added in v0.26.0
func AuthCodeURL(conf *oauth2.Config, urlFromMetadata, resourceURL, state, verifier string) (string, error)
AuthCodeURL returns the authorization code URL for the given configuration and resource URL.
func ComputeK8sSettingsHash ¶ added in v0.13.0
func ComputeK8sSettingsHash( settings v1.K8sSettingsSpec, serverSpecificResources *corev1.ResourceRequirements, serverRuntime types.Runtime, agentServer bool, imagePullSecretNames []string, ) string
ComputeK8sSettingsHash computes the hash used to decide whether an MCP Deployment needs to be updated. The API/status field is still named K8sSettingsHash, but managed image pull secret names are part of the same v1 drift path.
func ConfigurationOptionValueValid ¶ added in v0.26.0
ConfigurationOptionValueValid reports whether a field's configured selection is allowed.
func ConvertTools ¶ added in v0.9.0
func CoreResourceRequirements ¶ added in v0.22.0
func CoreResourceRequirements(resources *types.MCPResourceRequirements) (*corev1.ResourceRequirements, error)
func CurrentImagePullSecretNames ¶ added in v0.22.0
func CurrentImagePullSecretNames(ctx context.Context, client kclient.Client, mcpRuntimeBackend string, staticPullSecrets []string) ([]string, error)
CurrentImagePullSecretNames returns the effective image pull secret names for MCP Deployments. Static startup configuration takes precedence over managed ImagePullSecret resources.
func EffectiveDefaultMCPResourceRequirements ¶ added in v0.23.0
func EffectiveDefaultMCPResourceRequirements(k8sSettings v1.K8sSettingsSpec) corev1.ResourceRequirements
func ExchangeOAuthToken ¶ added in v0.26.0
func ExchangeOAuthToken(ctx context.Context, conf *oauth2.Config, code, verifier, resourceURL string) (*oauth2.Token, error)
ExchangeOAuthToken exchanges an OAuth authorization code for a token.
func GetOAuthAuthorizationURL ¶ added in v0.26.0
func GetOAuthAuthorizationURL(ctx context.Context, callbackHandler CallbackHandler, conf *oauth2.Config, authorizationEndpoint, resourceURL string) (string, <-chan CallbackPayload, string, error)
GetOAuthAuthorizationURL constructs the OAuth authorization URL and callback state for the authorization code flow.
func IsKubernetesBackend ¶ added in v0.22.0
func ListAllowedSecretBindingTargets ¶ added in v0.24.0
func ListAllowedSecretBindingTargets(ctx context.Context, c kclient.Client, obotNamespace, allowedLabel string) ([]types.MCPAllowedSecretBindingTarget, error)
ListAllowedSecretBindingTargets returns labeled Kubernetes Secrets and data keys that admins may select for MCP secret bindings.
func MMMCPConfig ¶ added in v0.26.0
func MMMCPConfig(server ServerConfig, env map[string][]byte) *mmmcpconfig.Config
MMMCPConfig converts a server configuration into mmmcp's runtime configuration.
func ManifestHasConfigurationOptions ¶ added in v0.26.0
func ManifestHasConfigurationOptions(manifest types.MCPServerManifest) bool
ManifestHasConfigurationOptions reports whether a server manifest defines catalog-owned options.
func MergeBoundCreds ¶ added in v0.22.0
func MergeBoundCreds( ctx context.Context, c kclient.Client, obotNamespace string, config []types.MCPConfig, credEnv map[string]string, allowedLabel string, ) (map[string]string, error)
MergeBoundCreds resolves every secretBinding referenced by config from the obot namespace and returns a NEW map containing credEnv merged with the resolved values:
- env bindings → out[env.Key] = <secret value>
- header bindings → out[header.Key] = <secret value>
Pass manifest.Config from a server or catalog-entry manifest.
Bound values overwrite any pre-existing credEnv entry for the same key. The validator rejects the bound-and-literal combination at write-time, so collisions only happen via a misbehaving caller; we drop the stale credEnv value defensively.
IMPORTANT: This function never mutates the caller's credEnv. The caller's credEnv reflects only user-supplied credential-store values and is safe to return to API reveal endpoints. The returned merged map carries bound secret VALUES and MUST NOT be returned to API callers — pass it to ServerToServerConfig / ConvertMCPServer only.
If there are no secretBindings, MergeBoundCreds returns credEnv unchanged (no pool). If c is nil (docker backend), bindings cannot be resolved and the returned map omits them — the downstream missing-required gate then fires for required bindings.
Secrets must have the configured secret-binding allow label. A Secret without that label is treated as unavailable, the same as a missing Secret/key.
Lookups are cached per-call by Secret name so a manifest with N bindings against the same Secret performs one Get. Reads hit nah's watch cache, so calling this from API request paths is cheap.
func MessageIDString ¶ added in v0.26.0
func OAuthResourceURL ¶ added in v0.26.0
OAuthResourceURL returns the protected resource identifier when the authorization server supports the RFC 8707 resource parameter. Microsoft Entra rejects this parameter, so it must be omitted throughout the flow.
func OTELEnv ¶ added in v0.24.0
OTELEnv returns OTEL environment variables to inject into Nanobot containers. It copies all OTEL_* variables from the current process, optionally rewriting OTLP endpoint URLs for the target runtime, and sets the service name so spans are distinguishable.
func ParseOAuthResourceURL ¶ added in v0.26.0
func ParseOAuthResourceURL(metadata json.RawMessage) (string, error)
ParseOAuthResourceURL returns the resource identifier from protected-resource metadata.
func RequiresStaticOAuth ¶ added in v0.26.0
RequiresStaticOAuth reports whether a remote MCP server is configured to require static OAuth and has not yet been authenticated by the user.
func ResolveOAuthResourceURL ¶ added in v0.26.0
func ResolveOAuthResourceURL(authorizationEndpoint, discoveredResourceURL, connectionURL string) string
ResolveOAuthResourceURL prefers the discovered protected-resource identifier and falls back to the MCP connection URL before applying provider-specific handling.
func ResolveRemoteURLTemplate ¶ added in v0.26.0
func ResolveRemoteURLTemplate(manifest types.MCPServerManifest, configuration map[string]string) (string, []string)
ResolveRemoteURLTemplate expands a remote manifest's URL template using the supplied configuration alongside the manifest's own static values, the same way the runtime does when it builds a ServerConfig. It returns the names of every unresolved reference rather than a partially expanded URL.
func ServerHookConfig ¶ added in v0.26.0
func ServerHookConfig(server ServerConfig) (Hooks, HookServerConfigs)
ServerHookConfig returns hook mappings and the MCP server configurations used by the native hook runner. The target MCP server itself is intentionally absent: its traffic continues through the reverse proxy.
func SourceIDForURL ¶ added in v0.24.0
func URLTemplateReferences ¶ added in v0.26.0
URLTemplateReferences returns the names referenced by ${VAR} patterns in a remote URL template, in order, without duplicates.
func ValidateCatalogConfigurationConstraints ¶ added in v0.26.0
func ValidateCatalogConfigurationConstraints(manifest types.MCPServerManifest, catalog types.MCPServerCatalogEntryManifest) error
ValidateCatalogConfigurationConstraints ensures catalog-owned option fields cannot be changed on a deployed server.
func ValidateCatalogEntryForRoute ¶ added in v0.24.0
func ValidateCatalogEntryForRoute(manifest types.MCPServerCatalogEntryManifest, catalogID, workspaceID string) error
ValidateCatalogEntryForRoute checks that a catalog entry is compatible with the route used to create a server. catalogID and workspaceID come from the URL path.
func ValidateCatalogEntryManifest ¶ added in v0.24.0
func ValidateCatalogEntryManifest(ctx context.Context, manifest types.MCPServerCatalogEntryManifest, gitManaged bool, options ValidationOptions) error
func ValidateConfiguredK8sSettingsResourceMaximums ¶ added in v0.24.0
func ValidateConfiguredK8sSettingsResourceMaximums(k8sSettings v1.K8sSettingsSpec, maximums ResourceMaximums) error
func ValidateConfiguredOptions ¶ added in v0.26.0
func ValidateConfiguredOptions(config []types.MCPConfig, values map[string]string) ([]string, error)
ValidateConfiguredOptions returns missing required selections and rejects values outside catalog-owned options. It does not return an error when returning missing configs.
func ValidateK8sSettingsResourceMaximums ¶ added in v0.24.0
func ValidateK8sSettingsResourceMaximums(k8sSettings v1.K8sSettingsSpec, maximums ResourceMaximums) error
func ValidatePSALevel ¶ added in v0.17.0
ValidatePSALevel checks if a PSA level value is valid
func ValidateRemoteMCPURL ¶ added in v0.23.0
func ValidateRemoteMCPURL(ctx context.Context, rawURL string, config RemoteMCPURLValidationConfig) error
ValidateRemoteMCPURL rejects remote MCP URLs that resolve to blocked local address ranges.
func ValidateSecretBindings ¶ added in v0.24.0
func ValidateSecretBindings(manifest types.MCPServerManifest, gitManaged, adminManaged bool, mcpBackend string) error
ValidateSecretBindings enforces the rules for secretBinding references on env vars and headers. Bindings may appear on git-managed catalog entries, multi-user catalog entries, or admin-managed multi-user servers. They require the kubernetes MCP runtime backend, are mutually exclusive with a static value, require non-empty name/key, and are rejected in unsupported combinations (env bindings under remote runtime).
func ValidateSecretBindingsAvailable ¶ added in v0.24.0
func ValidateSecretBindingsAvailable(ctx context.Context, c kclient.Client, obotNamespace string, config []types.MCPConfig, allowedLabel string) error
ValidateSecretBindingsAvailable verifies secret-bound config can be resolved before creating/updating/launching a server that users cannot fix.
func ValidateSecretBindingsCatalogEntry ¶ added in v0.24.0
func ValidateSecretBindingsCatalogEntry(manifest types.MCPServerCatalogEntryManifest, gitManaged, userIsAdmin bool, mcpBackend string) error
ValidateSecretBindingsCatalogEntry validates binding ownership and the catalog-specific restrictions on secret-bound URL template inputs.
func ValidateServerManifest ¶ added in v0.24.0
func ValidateServerManifest(ctx context.Context, manifest types.MCPServerManifest, isMultiUser bool, options ValidationOptions) error
func ValidateSystemMCPServerCatalogEntryManifest ¶ added in v0.24.0
func ValidateSystemMCPServerCatalogEntryManifest(ctx context.Context, manifest types.SystemMCPServerCatalogEntryManifest, options ValidationOptions) error
func ValidateSystemMCPServerManifest ¶ added in v0.24.0
func ValidateSystemMCPServerManifest(ctx context.Context, manifest types.SystemMCPServerManifest, options ValidationOptions) error
func ValidateTemplateReferences ¶ added in v0.24.0
func ValidateTemplateReferences(manifest types.MCPServerManifest) error
ValidateTemplateReferences enforces that any ${VAR} reference inside a server manifest's command/args/URL fields points to an env entry with Required=true. Undeclared references are tolerated here because addExtractedEnvVars in the server-create path auto-stamps a Required=true entry for them; this validator catches the case where the user pre-supplied the same key with Required=false, which today produces a literal "${VAR}" string at runtime instead of a substituted value.
func ValidateTemplateReferencesCatalogEntry ¶ added in v0.24.0
func ValidateTemplateReferencesCatalogEntry(manifest types.MCPServerCatalogEntryManifest) error
ValidateTemplateReferencesCatalogEntry is the catalog-entry counterpart. Catalog entries don't get the auto-extraction fixup, so undeclared ${VAR} references are an error.
Types ¶
type AuthURLHandler ¶ added in v0.26.0
type AuthorizationServerMetadata ¶ added in v0.26.0
type AuthorizationServerMetadata struct {
// REQUIRED. The authorization server's issuer identifier
Issuer string `json:"issuer"`
// URL of the authorization server's authorization endpoint
AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"`
// URL of the authorization server's token endpoint
TokenEndpoint string `json:"token_endpoint,omitempty"`
// OPTIONAL. URL of the authorization server's JWK Set document
JwksURI string `json:"jwks_uri,omitempty"`
// OPTIONAL. URL of the authorization server's OAuth 2.0 Dynamic Client Registration endpoint
RegistrationEndpoint string `json:"registration_endpoint,omitempty"`
// RECOMMENDED. JSON array containing a list of the OAuth 2.0 scope values
ScopesSupported []string `json:"scopes_supported,omitempty"`
// REQUIRED. JSON array containing a list of the OAuth 2.0 response_type values
ResponseTypesSupported []string `json:"response_types_supported"`
// OPTIONAL. JSON array containing a list of the OAuth 2.0 response_mode values
ResponseModesSupported []string `json:"response_modes_supported,omitempty"`
// OPTIONAL. JSON array containing a list of the OAuth 2.0 grant type values
GrantTypesSupported []string `json:"grant_types_supported,omitempty"`
// OPTIONAL. JSON array containing a list of client authentication methods
TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"`
// OPTIONAL. JSON array containing a list of the JWS signing algorithms
TokenEndpointAuthSigningAlgValuesSupported []string `json:"token_endpoint_auth_signing_alg_values_supported,omitempty"`
// OPTIONAL. URL of a page containing human-readable information
ServiceDocumentation string `json:"service_documentation,omitempty"`
// OPTIONAL. Languages and scripts supported for the user interface
UILocalesSupported []string `json:"ui_locales_supported,omitempty"`
// OPTIONAL. URL for authorization server's requirements on client data usage
OpPolicyURI string `json:"op_policy_uri,omitempty"`
// OPTIONAL. URL for authorization server's terms of service
OpTosURI string `json:"op_tos_uri,omitempty"`
// OPTIONAL. URL of the authorization server's OAuth 2.0 revocation endpoint
RevocationEndpoint string `json:"revocation_endpoint,omitempty"`
// OPTIONAL. JSON array containing client authentication methods for revocation endpoint
RevocationEndpointAuthMethodsSupported []string `json:"revocation_endpoint_auth_methods_supported,omitempty"`
// OPTIONAL. JSON array containing JWS signing algorithms for revocation endpoint
RevocationEndpointAuthSigningAlgValuesSupported []string `json:"revocation_endpoint_auth_signing_alg_values_supported,omitempty"`
// OPTIONAL. URL of the authorization server's OAuth 2.0 introspection endpoint
IntrospectionEndpoint string `json:"introspection_endpoint,omitempty"`
// OPTIONAL. JSON array containing client authentication methods for introspection endpoint
IntrospectionEndpointAuthMethodsSupported []string `json:"introspection_endpoint_auth_methods_supported,omitempty"`
// OPTIONAL. JSON array containing JWS signing algorithms for introspection endpoint
IntrospectionEndpointAuthSigningAlgValuesSupported []string `json:"introspection_endpoint_auth_signing_alg_values_supported,omitempty"`
// OPTIONAL. JSON array containing PKCE code challenge methods
CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported,omitempty"`
// OPTIONAL. Boolean indicating whether the client ID metadata document is supported
ClientIDMetadataDocumentSupported bool `json:"client_id_metadata_document_supported,omitempty"`
}
AuthorizationServerMetadata represents OAuth 2.0 Authorization Server Metadata as defined in RFC 8414
type CallbackHandler ¶ added in v0.26.0
type CallbackHandler interface {
AuthURLHandler
NewState(context.Context, *oauth2.Config, string, string) (string, <-chan CallbackPayload, error)
}
type CallbackPayload ¶ added in v0.26.0
type Client ¶
type Client struct {
*gomcp.ClientSession
// contains filtered or unexported fields
}
type ClientCredLookup ¶ added in v0.26.0
type ClientOption ¶ added in v0.26.0
type ClientOption struct {
// OAuthClientName overrides ClientName only for dynamic client registration.
OAuthClientName string
// OAuthClientIDMetadataDocument is empty when CIMD must not be used.
OAuthClientIDMetadataDocument string
ClientName string
ClientVersion string
TokenStorage TokenStorage
CallbackHandler CallbackHandler
ClientLookup ClientCredLookup
}
type ClientRegistrationMetadata ¶ added in v0.26.0
type ClientRegistrationMetadata struct {
// Array of redirection URI strings for use in redirect-based flows
RedirectURIs []string `json:"redirect_uris,omitempty"`
// String indicator of the requested authentication method for the token endpoint
TokenEndpointAuthMethod string `json:"token_endpoint_auth_method,omitempty"`
// Array of OAuth 2.0 grant type strings that the client can use at the token endpoint
GrantTypes []string `json:"grant_types,omitempty"`
// Array of the OAuth 2.0 response type strings that the client can use at the authorization endpoint
ResponseTypes []string `json:"response_types,omitempty"`
// Human-readable string name of the client to be presented to the end-user during authorization
ClientName string `json:"client_name,omitempty"`
// URL string of a web page providing information about the client
ClientURI string `json:"client_uri,omitempty"`
// URL string that references a logo for the client
LogoURI string `json:"logo_uri,omitempty"`
// String containing a space-separated list of scope values
Scope string `json:"scope,omitempty"`
// Array of strings representing ways to contact people responsible for this client
Contacts []string `json:"contacts,omitempty"`
// URL string that points to a human-readable terms of service document for the client
TosURI string `json:"tos_uri,omitempty"`
// URL string that points to a human-readable privacy policy document
PolicyURI string `json:"policy_uri,omitempty"`
// URL string referencing the client's JSON Web Key (JWK) Set document
JwksURI string `json:"jwks_uri,omitempty"`
// Client's JSON Web Key Set document value
Jwks any `json:"jwks,omitempty"`
// A unique identifier string assigned by the client developer or software publisher
SoftwareID string `json:"software_id,omitempty"`
// A version identifier string for the client software identified by "software_id"
SoftwareVersion string `json:"software_version,omitempty"`
}
ClientRegistrationMetadata represents OAuth 2.0 Dynamic Client Registration metadata as defined in RFC 7591, merged from protected resource and authorization server metadata
func AuthServerMetadataToClientRegistration ¶ added in v0.26.0
func AuthServerMetadataToClientRegistration(authServer AuthorizationServerMetadata, clientName, redirectURL, scope string) ClientRegistrationMetadata
AuthServerMetadataToClientRegistration converts an AuthorizationServerMetadata to a ClientRegistrationMetadata for dynamic registration.
type ComponentServer ¶ added in v0.15.0
type ComponentServer struct {
MCPServerInstanceID string `json:"mcpServerInstanceID,omitempty"`
DisableTools bool `json:"disableTools,omitempty"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
URL string `json:"url"`
Tools []types.ToolOverride `json:"tools"`
ToolPrefix string `json:"toolPrefix"`
}
func (ComponentServer) ConnectID ¶ added in v0.26.0
func (c ComponentServer) ConnectID() string
ConnectID identifies the connection while Name identifies its backing server.
type Config ¶
type Config struct {
MCPServers map[string]ServerConfig `json:"mcpServers"`
}
type ContainerizedValidator ¶ added in v0.24.0
type ContainerizedValidator struct{}
ContainerizedValidator implements RuntimeValidator for containerized runtime
func (ContainerizedValidator) ValidateCatalogConfig ¶ added in v0.24.0
func (v ContainerizedValidator) ValidateCatalogConfig(_ context.Context, manifest types.MCPServerCatalogEntryManifest) error
func (ContainerizedValidator) ValidateConfig ¶ added in v0.24.0
func (v ContainerizedValidator) ValidateConfig(_ context.Context, manifest types.MCPServerManifest) error
func (ContainerizedValidator) ValidateSystemConfig ¶ added in v0.24.0
func (v ContainerizedValidator) ValidateSystemConfig(_ context.Context, manifest types.SystemMCPServerManifest) error
type ErrNotSupportedByBackend ¶ added in v0.9.0
type ErrNotSupportedByBackend struct {
Feature, Backend string
}
func (*ErrNotSupportedByBackend) Error ¶ added in v0.9.0
func (e *ErrNotSupportedByBackend) Error() string
type GlobalTokenStore ¶
type GlobalTokenStore interface {
ForUserAndMCP(userID, mcpID, mcpURL string) TokenStorage
}
func NewGlobalTokenStore ¶ added in v0.26.0
func NewGlobalTokenStore(gatewayClient *gateway.Client) GlobalTokenStore
type HTTPClientOptions ¶ added in v0.26.0
type HTTPClientOptions struct {
TokenSource oauth2.TokenSource
Timeout time.Duration
DirectConnect bool
}
type HookMapping ¶ added in v0.26.0
type HookMapping struct {
Name string
Params map[string]string
Targets []HookTarget
}
type HookMutation ¶ added in v0.26.0
type HookRunner ¶ added in v0.26.0
type HookRunner interface {
RunHook(ctx context.Context, servers HookServerConfigs, input SessionMessageHook, target string) (*SessionMessageHook, error)
}
HookRunner executes one configured hook target.
type HookServerConfigs ¶ added in v0.26.0
type HookServerConfigs map[string]ServerConfig
HookServerConfigs maps the server portion of a hook target (server/tool) to the MCP server configuration used to call that hook.
type HookTarget ¶ added in v0.26.0
type Hooks ¶ added in v0.26.0
type Hooks []HookMapping
type Message ¶ added in v0.26.0
type Message struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id,omitempty"`
Method string `json:"method,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"`
HookMutations map[string]HookMutation `json:"-"`
}
Message is the JSON-RPC envelope sent to and returned by MCP hooks.
type MissingSecretBinding ¶ added in v0.24.0
type MissingSecretBinding struct {
Kind string
Header types.MCPHeader
Binding *types.MCPSecretBinding
}
type NPXValidator ¶ added in v0.24.0
type NPXValidator struct{}
NPXValidator implements RuntimeValidator for NPX runtime
func (NPXValidator) ValidateCatalogConfig ¶ added in v0.24.0
func (v NPXValidator) ValidateCatalogConfig(_ context.Context, manifest types.MCPServerCatalogEntryManifest) error
func (NPXValidator) ValidateConfig ¶ added in v0.24.0
func (v NPXValidator) ValidateConfig(_ context.Context, manifest types.MCPServerManifest) error
func (NPXValidator) ValidateSystemConfig ¶ added in v0.24.0
func (v NPXValidator) ValidateSystemConfig(_ context.Context, manifest types.SystemMCPServerManifest) error
type OAuthMetadata ¶ added in v0.26.0
type OAuthMetadata struct {
ProtectedResourceMetadataURL string `json:"protectedResourceMetadataUrl,omitempty"`
ResourceURL string `json:"resourceUrl,omitempty"`
AuthorizationServerMetadataURL string `json:"authorizationServerMetadataUrl,omitempty"`
ProtectedResourceMetadata json.RawMessage `json:"protectedResourceMetadata,omitempty"`
AuthorizationServerMetadata json.RawMessage `json:"authorizationServerMetadata,omitempty"`
ClientRegistration json.RawMessage `json:"clientRegistration,omitempty"`
DynamicClientRegistration bool `json:"dynamicClientRegistration,omitempty"`
ClientIDMetadataDocumentSupported bool `json:"clientIdMetadataDocumentSupported,omitempty"`
}
OAuthMetadata contains discovered OAuth metadata for an MCP server.
func GetOAuthMetadataWithClient ¶ added in v0.26.0
func GetOAuthMetadataWithClient(ctx context.Context, httpClient *http.Client, server ServerConfig, clientName, redirectURL string) (OAuthMetadata, error)
GetOAuthMetadataWithClient discovers OAuth protected resource and authorization server metadata for an HTTP MCP server using a custom HTTP client. Missing metadata endpoints are not errors.
type Options ¶
type Options struct {
MCPBaseImage string `usage:"The base image to use for MCP containers" default:"ghcr.io/obot-platform/mcp-images/stdio-wrapper:v0.26.0"`
MCPHTTPWebhookBaseImage string `` /* 145-byte string literal not displayed */
MCPNamespace string `usage:"The namespace to use for MCP containers" default:"obot-mcp"`
MCPClusterDomain string `usage:"The cluster domain to use for MCP containers" default:"cluster.local"`
DisallowLocalhostMCP bool `usage:"Disallow MCP containers from connecting to localhost" default:"true"`
DisallowPrivateIPMCP bool `usage:"Disallow MCP containers from connecting to private IPs" default:"true"`
DisallowLinkLocalMCP bool `usage:"Disallow MCP containers from connecting to link-local addresses" default:"true"`
MCPRuntimeBackend string `usage:"The runtime backend to use for running MCP servers: docker, kubernetes, or k8s. Defaults to docker" default:"docker"`
MCPSecretBindingAllowedLabel string `` /* 148-byte string literal not displayed */
MCPImagePullSecrets []string `usage:"The name of the image pull secret to use for pulling MCP images"`
SingleUserIdleServerShutdownHours int `` /* 150-byte string literal not displayed */
MultiUserIdleServerShutdownHours int `usage:"The interval in hours to check for idle multi-user MCP servers and shut them down, set to -1 to disable" default:"168"`
IdleAgentShutdownHours int `usage:"The interval in hours to check for idle agents and shut them down, set to -1 to disable" default:"72"`
// Kubernetes settings from Helm
MCPK8sSettingsAffinity string `usage:"Affinity rules for MCP server pods (JSON)"`
MCPK8sSettingsTolerations string `usage:"Tolerations for MCP server pods (JSON)"`
MCPK8sSettingsResources string `usage:"Resource requests/limits for MCP server pods (JSON)"`
MCPK8sSettingsNanobotAgentResources string `usage:"Resource requests/limits for NanobotAgent pods (JSON)"`
MCPK8sSettingsRuntimeClassName string `usage:"RuntimeClass name for MCP server pods (e.g., gvisor, kata)"`
MCPK8sSettingsStorageClassName string `usage:"StorageClass name for nanobot workspace volumes"`
MCPK8sSettingsNanobotWorkspaceSize string `usage:"Nanobot workspace size for MCP server pods (e.g., 1Gi)"`
MCPK8sMaxCPURequest string `usage:"Maximum CPU request allowed for normal MCP server pods"`
MCPK8sMaxCPULimit string `usage:"Maximum CPU limit allowed for normal MCP server pods"`
MCPK8sMaxMemoryRequest string `usage:"Maximum memory request allowed for normal MCP server pods"`
MCPK8sMaxMemoryLimit string `usage:"Maximum memory limit allowed for normal MCP server pods"`
// Obot service configuration for constructing internal service FQDN
ServiceName string `usage:"The Kubernetes service name for the obot server"`
ServiceNamespace string `usage:"The Kubernetes namespace where the obot server runs"`
// Auto-populated by the Helm chart - used for network policy provider deployment
ServiceAccountName string `usage:"The Kubernetes service account name for the obot server"`
// Audit log configuration
MCPAuditLogPersistIntervalSeconds int `usage:"The interval in seconds to persist MCP audit logs to the database" default:"5"`
MCPAuditLogsPersistBatchSize int `usage:"The number of MCP audit logs to persist in a single batch" default:"1000"`
MCPAuditLogRetentionDays int `usage:"The number of days to retain MCP audit logs (0 to disable cleanup)" default:"90"`
// Pod Security Admission configuration for MCP namespace
MCPPodSecurityEnabled bool `usage:"Enable Pod Security Admission labels on the MCP namespace" default:"true"`
MCPPodSecurityEnforce string `usage:"Pod Security Standards level to enforce (privileged, baseline, or restricted)" default:"restricted"`
MCPPodSecurityEnforceVersion string `usage:"Kubernetes version for the enforce policy" default:"latest"`
MCPPodSecurityAudit string `usage:"Pod Security Standards level to audit (privileged, baseline, or restricted)" default:"restricted"`
MCPPodSecurityAuditVersion string `usage:"Kubernetes version for the audit policy" default:"latest"`
MCPPodSecurityWarn string `usage:"Pod Security Standards level to warn about (privileged, baseline, or restricted)" default:"restricted"`
MCPPodSecurityWarnVersion string `usage:"Kubernetes version for the warn policy" default:"latest"`
}
type PSAEnforceLevel ¶ added in v0.17.0
type PSAEnforceLevel string
PSAEnforceLevel represents the Pod Security Admission enforce level
const ( // PSAPrivileged allows all pod configurations (no restrictions) PSAPrivileged PSAEnforceLevel = "privileged" // PSABaseline provides minimal restrictions that prevent known privilege escalations PSABaseline PSAEnforceLevel = "baseline" // PSARestricted heavily restricts pod configurations following security best practices PSARestricted PSAEnforceLevel = "restricted" )
func GetPSAEnforceLevelFromSpec ¶ added in v0.17.0
func GetPSAEnforceLevelFromSpec(settings v1.K8sSettingsSpec) PSAEnforceLevel
GetPSAEnforceLevelFromSpec extracts the PSA enforce level from K8sSettingsSpec
type RPCError ¶ added in v0.26.0
type RPCError struct {
Code int `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
}
func NewRPCError ¶ added in v0.26.0
type RemoteMCPURLValidationConfig ¶ added in v0.23.0
type RemoteValidator ¶ added in v0.24.0
type RemoteValidator struct {
AllowMissingURL bool
RemoteMCPURLValidationConfig RemoteMCPURLValidationConfig
}
RemoteValidator implements RuntimeValidator for remote runtime
func (RemoteValidator) ValidateCatalogConfig ¶ added in v0.24.0
func (v RemoteValidator) ValidateCatalogConfig(ctx context.Context, manifest types.MCPServerCatalogEntryManifest) error
func (RemoteValidator) ValidateConfig ¶ added in v0.24.0
func (v RemoteValidator) ValidateConfig(ctx context.Context, manifest types.MCPServerManifest) error
func (RemoteValidator) ValidateSystemConfig ¶ added in v0.24.0
func (v RemoteValidator) ValidateSystemConfig(ctx context.Context, manifest types.SystemMCPServerManifest) error
type ResourceMaximumExceededError ¶ added in v0.24.0
type ResourceMaximumExceededError struct {
Field string
Actual resource.Quantity
Maximum resource.Quantity
}
func (*ResourceMaximumExceededError) Error ¶ added in v0.24.0
func (e *ResourceMaximumExceededError) Error() string
type ResourceMaximums ¶ added in v0.24.0
type ResourceMaximums struct {
CPURequest *resource.Quantity
CPULimit *resource.Quantity
MemoryRequest *resource.Quantity
MemoryLimit *resource.Quantity
}
func EffectiveResourceMaximums ¶ added in v0.26.0
func EffectiveResourceMaximums(settings v1.K8sSettingsSpec, fallback ResourceMaximums) ResourceMaximums
func ParseResourceMaximums ¶ added in v0.24.0
func ParseResourceMaximums(opts Options) (ResourceMaximums, error)
func (ResourceMaximums) Empty ¶ added in v0.24.0
func (m ResourceMaximums) Empty() bool
func (ResourceMaximums) Validate ¶ added in v0.24.0
func (m ResourceMaximums) Validate(resources corev1.ResourceRequirements) error
type RuntimeValidator ¶ added in v0.24.0
type RuntimeValidator interface {
ValidateConfig(ctx context.Context, manifest types.MCPServerManifest) error
ValidateCatalogConfig(ctx context.Context, manifest types.MCPServerCatalogEntryManifest) error
ValidateSystemConfig(ctx context.Context, manifest types.SystemMCPServerManifest) error
}
RuntimeValidator defines the interface for validating runtime-specific configurations
type RuntimeValidators ¶ added in v0.24.0
type RuntimeValidators map[types.Runtime]RuntimeValidator
RuntimeValidators is a map type for storing validators by runtime type
type ServerConfig ¶
type ServerConfig struct {
Runtime types.Runtime `json:"runtime"`
// uvx/npx based configuration.
Command string `json:"command"`
Args []string `json:"args"`
Env []string `json:"env"`
Files []File `json:"files"`
// Remote configuration.
URL string `json:"url"`
TunnelName string `json:"tunnelName,omitempty"`
Headers []string `json:"headers"`
PassthroughHeaderNames []string `json:"passthroughHeaderNames"`
PassthroughHeaderValues []string `json:"passthroughHeaderValues"`
// Containerized configuration.
ContainerImage string `json:"containerImage"`
ContainerPort int `json:"containerPort"`
ContainerPath string `json:"containerPath"`
HealthzPath string `json:"healthzPath,omitempty"`
// vMCP configuration.
Components []ComponentServer `json:"components"`
ConfigHash string `json:"configHash"`
Scope string `json:"scope"`
UserID string `json:"userID"`
OwnerUserID string `json:"ownerUserID"`
MCPServerNamespace string `json:"mcpServerNamespace"`
MCPServerName string `json:"mcpServerName"`
MCPServerInstanceID string `json:"mcpServerInstanceID,omitempty"`
MCPCatalogName string `json:"mcpCatalogName"`
MCPCatalogEntryName string `json:"mcpCatalogEntryName"`
MCPServerDisplayName string `json:"mcpServerDisplayName"`
AgentName string `json:"agentName"`
ComponentMCPServer bool `json:"componentMCPServer"`
SystemMCPServer bool `json:"systemMCPServer"`
Audiences []string `json:"audiences"`
AuditLogMetadata map[string]string `json:"auditLogMetadata"`
StartupTimeout time.Duration `json:"startupTimeout,omitempty"`
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
Webhooks []Webhook `json:"webhooks,omitempty"`
}
func ServerToServerConfig ¶
func SystemServerToServerConfig ¶ added in v0.15.0
func SystemServerToServerConfig(systemServer v1.SystemMCPServer, audiences []string, userID string, credEnv map[string]string) (ServerConfig, []string, error)
SystemServerToServerConfig converts a v1.SystemMCPServer to a ServerConfig for deployment
func (ServerConfig) IsAgentServer ¶ added in v0.26.0
func (s ServerConfig) IsAgentServer() bool
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionManager ¶
func NewSessionManager(ctx context.Context, authEnabled bool, globalTokenStore GlobalTokenStore, tokenService *persistent.TokenService, baseURL string, httpListenPort int, opts Options, webhookHelper *WebhookHelper, localK8sConfig *rest.Config, client, cachedClient, obotStorageClient kclient.WithWatch, gatewayClient *gateway.Client, obotNamespace string, tunnelManager *tunnel.Manager) (*SessionManager, error)
func (*SessionManager) ClientForMCPServerForOAuthCheck ¶ added in v0.15.0
func (sm *SessionManager) ClientForMCPServerForOAuthCheck(ctx context.Context, serverConfig ServerConfig, opt ClientOption) (*Client, error)
func (*SessionManager) Close ¶
func (sm *SessionManager) Close()
Close does nothing with the deployments and services. It just closes the local session.
func (*SessionManager) CloseClient ¶
func (sm *SessionManager) CloseClient(server ServerConfig, clientScope string)
CloseClient will close the client for this MCP server, but leave the deployment running.
func (*SessionManager) EffectiveKubernetesResourceMaximums ¶ added in v0.26.0
func (sm *SessionManager) EffectiveKubernetesResourceMaximums( ctx context.Context, storageClient kclient.Client, ) (ResourceMaximums, error)
func (*SessionManager) EffectiveKubernetesResourceMaximumsForSettings ¶ added in v0.26.0
func (sm *SessionManager) EffectiveKubernetesResourceMaximumsForSettings( settings v1.K8sSettingsSpec, ) ResourceMaximums
func (*SessionManager) GenerateToolPreviews ¶ added in v0.9.0
func (sm *SessionManager) GenerateToolPreviews(ctx context.Context, tempMCPServer v1.MCPServer, serverConfig ServerConfig) ([]types.MCPServerTool, error)
GenerateToolPreviews creates a temporary MCP server from a catalog entry, lists its tools, then shuts it down and returns the tool preview data.
func (*SessionManager) GetCapacityInfo ¶ added in v0.16.0
func (sm *SessionManager) GetCapacityInfo(ctx context.Context) (types.MCPCapacityInfo, error)
GetCapacityInfo returns capacity information for the MCP namespace. Only available when using the Kubernetes backend.
func (*SessionManager) GetCapacityInfoForServers ¶ added in v0.26.0
func (sm *SessionManager) GetCapacityInfoForServers(ctx context.Context, serverNames []string) (types.MCPCapacityInfo, error)
GetCapacityInfoForServers returns capacity information for the given MCP server deployments. Only available when using the Kubernetes backend.
func (*SessionManager) GetOAuthMetadata ¶ added in v0.26.0
func (m *SessionManager) GetOAuthMetadata(ctx context.Context, serverConfig ServerConfig, clientName, redirectURL string, assumeOAuthRequired bool) (OAuthMetadata, error)
GetOAuthMetadata discovers OAuth metadata for a remote MCP server. When assumeOAuthRequired is true, discovery proceeds even if initialize succeeds. This supports servers that defer their OAuth challenge until tools/call.
func (*SessionManager) GetPrompt ¶
func (sm *SessionManager) GetPrompt(ctx context.Context, serverConfig ServerConfig, name string, args map[string]string) ([]*gomcp.PromptMessage, string, error)
func (*SessionManager) GetServerDetails ¶
func (sm *SessionManager) GetServerDetails(ctx context.Context, serverConfig ServerConfig) (types.MCPServerDetails, error)
GetServerDetails will get the details of a specific MCP server based on its configuration, if the backend supports it. If the backend does not support the operation, it will return an ErrNotSupportedByBackend error.
func (*SessionManager) HTTPClientForServer ¶ added in v0.25.0
func (sm *SessionManager) HTTPClientForServer(server ServerConfig, opts HTTPClientOptions) (*http.Client, error)
HTTPClientForServer returns an HTTP client that follows the server's configured network path, including its tunnel when present.
func (*SessionManager) IDAndAudienceFromConnectURL ¶ added in v0.24.0
func (sm *SessionManager) IDAndAudienceFromConnectURL(ctx context.Context, id, userID string) (string, string, error)
IDAndAudienceFromConnectURL returns the MCP server or instance name and audience based on the provided connect URL. The connect URL could have a vMCP ID, MCP server ID, server instance ID, or MCP catalog entry ID.
func (*SessionManager) LaunchServer ¶ added in v0.15.0
func (sm *SessionManager) LaunchServer(ctx context.Context, serverConfig ServerConfig) (ServerConfig, error)
LaunchServer will ensure that the server is deployed
func (*SessionManager) ListPrompts ¶
func (sm *SessionManager) ListPrompts(ctx context.Context, serverConfig ServerConfig) ([]*gomcp.Prompt, error)
func (*SessionManager) ListResources ¶
func (sm *SessionManager) ListResources(ctx context.Context, serverConfig ServerConfig) ([]*gomcp.Resource, error)
func (*SessionManager) ListTools ¶
func (sm *SessionManager) ListTools(ctx context.Context, serverConfig ServerConfig) ([]*gomcp.Tool, error)
func (*SessionManager) MCPRuntimeBackend ¶ added in v0.22.0
func (sm *SessionManager) MCPRuntimeBackend() string
func (*SessionManager) PingServer ¶
func (sm *SessionManager) PingServer(ctx context.Context, serverConfig ServerConfig) error
func (*SessionManager) ReadResource ¶
func (sm *SessionManager) ReadResource(ctx context.Context, serverConfig ServerConfig, uri string) ([]*gomcp.ResourceContents, error)
func (*SessionManager) RemoteConfigForBackend ¶ added in v0.24.0
func (sm *SessionManager) RemoteConfigForBackend() (RemoteMCPURLValidationConfig, []string)
func (*SessionManager) RemoteMCPURLValidationConfig ¶ added in v0.23.0
func (sm *SessionManager) RemoteMCPURLValidationConfig() RemoteMCPURLValidationConfig
func (*SessionManager) ResourceMaximums ¶ added in v0.24.0
func (sm *SessionManager) ResourceMaximums() ResourceMaximums
func (*SessionManager) RestartServerDeployment ¶ added in v0.9.0
func (sm *SessionManager) RestartServerDeployment(ctx context.Context, server ServerConfig) error
RestartServerDeployment restarts the server in the currently used backend, if the backend supports it. If the backend does not support restarts, then an ErrNotSupportedByBackend error is returned.
func (*SessionManager) ServerCapabilities ¶
func (sm *SessionManager) ServerCapabilities(ctx context.Context, serverConfig ServerConfig) (*gomcp.ServerCapabilities, error)
func (*SessionManager) ServerConfigForVMCP ¶ added in v0.26.0
func (sm *SessionManager) ServerConfigForVMCP(ctx context.Context, vmcpID, userID string) (ServerConfig, error)
ServerConfigForVMCP resolves the component servers for a VMCP instance into the aggregate configuration consumed by the MCP gateway. VMCPs are backed by the MCPServers created by the VMCPInstance controller; the VMCP itself never gets launched as a runtime.
func (*SessionManager) ServerForAction ¶ added in v0.24.0
func (sm *SessionManager) ServerForAction(ctx context.Context, id, userID string) (v1.MCPServer, ServerConfig, error)
func (*SessionManager) ServerForActionWithConnectID ¶ added in v0.24.0
func (sm *SessionManager) ServerForActionWithConnectID(ctx context.Context, id, userID string) (string, v1.MCPServer, ServerConfig, error)
func (*SessionManager) ServerForActionWithConnectIDAllowMissingConfig ¶ added in v0.24.0
func (sm *SessionManager) ServerForActionWithConnectIDAllowMissingConfig(ctx context.Context, id, userID string) (string, v1.MCPServer, ServerConfig, []string, error)
func (*SessionManager) ShutdownIdleServer ¶ added in v0.19.2
func (sm *SessionManager) ShutdownIdleServer(ctx context.Context, serverName string) error
ShutdownIdleServer will close the connections to the MCP server and remove all of the resources except for the volumes.
func (*SessionManager) ShutdownServer ¶
func (sm *SessionManager) ShutdownServer(ctx context.Context, serverName string) error
ShutdownServer will close the connections to the MCP server and remove all of the resources.
func (*SessionManager) StartupKubernetesResourceMaximums ¶ added in v0.26.0
func (sm *SessionManager) StartupKubernetesResourceMaximums( ctx context.Context, storageClient kclient.Client, ) (ResourceMaximums, error)
func (*SessionManager) StreamServerLogs ¶
func (sm *SessionManager) StreamServerLogs(ctx context.Context, serverConfig ServerConfig) (io.ReadCloser, error)
StreamServerLogs will stream the logs of a specific MCP server based on its configuration, if the backend supports it. If the backend does not support the operation, it will return an ErrNotSupportedByBackend error.
func (*SessionManager) TransformObotHostname ¶ added in v0.17.0
func (sm *SessionManager) TransformObotHostname(hostname string) string
type SessionManagerHookRunner ¶ added in v0.26.0
type SessionManagerHookRunner struct {
// contains filtered or unexported fields
}
SessionManagerHookRunner invokes hook tools through Obot's MCP session manager.
func NewHookRunner ¶ added in v0.26.0
func NewHookRunner(sessionManager *SessionManager) *SessionManagerHookRunner
func (*SessionManagerHookRunner) RunHook ¶ added in v0.26.0
func (r *SessionManagerHookRunner) RunHook(ctx context.Context, servers HookServerConfigs, input SessionMessageHook, target string) (*SessionMessageHook, error)
type SessionMessageHook ¶ added in v0.26.0
type TokenStorage ¶ added in v0.26.0
type UVXValidator ¶ added in v0.24.0
type UVXValidator struct{}
UVXValidator implements RuntimeValidator for UVX runtime
func (UVXValidator) ValidateCatalogConfig ¶ added in v0.24.0
func (v UVXValidator) ValidateCatalogConfig(_ context.Context, manifest types.MCPServerCatalogEntryManifest) error
func (UVXValidator) ValidateConfig ¶ added in v0.24.0
func (v UVXValidator) ValidateConfig(_ context.Context, manifest types.MCPServerManifest) error
func (UVXValidator) ValidateSystemConfig ¶ added in v0.24.0
func (v UVXValidator) ValidateSystemConfig(_ context.Context, manifest types.SystemMCPServerManifest) error
type ValidationOptions ¶ added in v0.24.0
type ValidationOptions struct {
AllowMissingURL bool
RemoteMCPURLValidationConfig RemoteMCPURLValidationConfig
ResourceMaximums ResourceMaximums
}
Options configures runtime validation behavior.
type WebhookHelper ¶
type WebhookHelper struct {
// contains filtered or unexported fields
}
func NewWebhookHelper ¶
func NewWebhookHelper(indexer cache.Indexer, baseURL string) *WebhookHelper
func (*WebhookHelper) GetWebhooksForMCPServer ¶
func (wh *WebhookHelper) GetWebhooksForMCPServer(serverConfig ServerConfig, transformHostname func(string) string) ([]Webhook, error)
Source Files
¶
- action.go
- backend.go
- capabilities.go
- client.go
- configurationoptions.go
- details.go
- docker.go
- hookrunner.go
- hooks.go
- http.go
- kubernetes.go
- manager.go
- mcpvalidators.go
- oauth.go
- otel.go
- ping.go
- prompts.go
- resource_maximums.go
- resources.go
- secretbindings.go
- source.go
- tokenstore.go
- tools.go
- types.go
- vmcp.go
- webhookhelper.go
- workspace.go