Documentation
¶
Overview ¶
Package runner provides functionality for running MCP servers
Package runner provides functionality for running MCP servers
Index ¶
- Constants
- func BuildFromProtocolSchemeWithName(ctx context.Context, imageManager images.ImageManager, serverOrImage string, ...) (string, error)
- func CleanupTempPermissionProfile(permissionProfilePath string) error
- func CreatePermissionProfileFile(serverName string, permProfile *permissions.Profile) (string, error)
- func GetSupportedMiddlewareFactories() map[string]types.MiddlewareFactory
- func HandleProtocolScheme(ctx context.Context, imageManager images.ImageManager, serverOrImage string, ...) (string, error)
- func IsImageProtocolScheme(serverOrImage string) bool
- func PackageNameToImageName(packageName string) string
- func ParseProtocolScheme(serverOrImage string) (templates.TransportType, string, error)
- func PopulateMiddlewareConfigs(config *RunConfig) error
- type BuildContext
- type CLIEnvVarValidator
- type DetachedEnvVarValidator
- type EnvVarValidator
- type RemoteAuthConfig
- type RemoteAuthHandler
- type RunConfig
- func LoadState(ctx context.Context, name string) (*RunConfig, error)
- func NewOperatorRunConfigBuilder(ctx context.Context, imageMetadata *registry.ImageMetadata, ...) (*RunConfig, error)
- func NewRunConfig() *RunConfig
- func NewRunConfigBuilder(ctx context.Context, imageMetadata *registry.ImageMetadata, ...) (*RunConfig, error)
- func ReadJSON(r io.Reader) (*RunConfig, error)
- func (c *RunConfig) GetBaseName() string
- func (c *RunConfig) GetPort() int
- func (c *RunConfig) SaveState(ctx context.Context) error
- func (c *RunConfig) ValidateSecrets(ctx context.Context, secretManager secrets.Provider) error
- func (c *RunConfig) WithAudit(config *audit.Config) *RunConfig
- func (c *RunConfig) WithAuthz(config *authz.Config) *RunConfig
- func (c *RunConfig) WithContainerName() (*RunConfig, bool)
- func (c *RunConfig) WithEnvFile(filePath string) (*RunConfig, error)
- func (c *RunConfig) WithEnvFilesFromDirectory(dirPath string) (*RunConfig, error)
- func (c *RunConfig) WithEnvironmentVariables(envVars map[string]string) (*RunConfig, error)
- func (c *RunConfig) WithMiddlewareConfig(middlewareConfig []types.MiddlewareConfig) *RunConfig
- func (c *RunConfig) WithPorts(proxyPort, targetPort int) (*RunConfig, error)
- func (c *RunConfig) WithSecrets(ctx context.Context, secretManager secrets.Provider) (*RunConfig, error)
- func (c *RunConfig) WithStandardLabels() *RunConfig
- func (c *RunConfig) WithTransport(t string) (*RunConfig, error)
- func (c *RunConfig) WriteJSON(w io.Writer) error
- type RunConfigBuilderOption
- func WithAuditConfigPath(path string) RunConfigBuilderOption
- func WithAuditEnabled(enableAudit bool, auditConfigPath string) RunConfigBuilderOption
- func WithAuthzConfig(config *authz.Config) RunConfigBuilderOption
- func WithAuthzConfigPath(path string) RunConfigBuilderOption
- func WithCmdArgs(args []string) RunConfigBuilderOption
- func WithDebug(debug bool) RunConfigBuilderOption
- func WithEnvFile(filePath string) RunConfigBuilderOption
- func WithEnvFileDir(dirPath string) RunConfigBuilderOption
- func WithEnvFilesFromDirectory(dirPath string) RunConfigBuilderOption
- func WithEnvVars(envVars map[string]string) RunConfigBuilderOption
- func WithGroup(groupName string) RunConfigBuilderOption
- func WithHost(host string) RunConfigBuilderOption
- func WithIgnoreConfig(ignoreConfig *ignore.Config) RunConfigBuilderOption
- func WithImage(image string) RunConfigBuilderOption
- func WithK8sPodPatch(patch string) RunConfigBuilderOption
- func WithLabels(labelStrings []string) RunConfigBuilderOption
- func WithMiddlewareConfig(middlewareConfig []types.MiddlewareConfig) RunConfigBuilderOption
- func WithMiddlewareFromFlags(oidcConfig *auth.TokenValidatorConfig, toolsFilter []string, ...) RunConfigBuilderOption
- func WithName(name string) RunConfigBuilderOption
- func WithNetworkIsolation(isolate bool) RunConfigBuilderOption
- func WithOIDCConfig(oidcIssuer string, oidcAudience string, oidcJwksURL string, ...) RunConfigBuilderOption
- func WithPermissionProfile(profile *permissions.Profile) RunConfigBuilderOption
- func WithPermissionProfileNameOrPath(profile string) RunConfigBuilderOption
- func WithProxyMode(mode types.ProxyMode) RunConfigBuilderOption
- func WithRemoteAuth(config *RemoteAuthConfig) RunConfigBuilderOption
- func WithRemoteURL(remoteURL string) RunConfigBuilderOption
- func WithRuntime(deployer rt.Deployer) RunConfigBuilderOption
- func WithSecrets(secrets []string) RunConfigBuilderOption
- func WithTargetHost(targetHost string) RunConfigBuilderOption
- func WithTelemetryConfig(otelEndpoint string, otelEnablePrometheusMetricsPath bool, ...) RunConfigBuilderOption
- func WithToolsFilter(toolsFilter []string) RunConfigBuilderOption
- func WithToolsOverride(toolOverride map[string]ToolOverride) RunConfigBuilderOption
- func WithTransportAndPorts(mcpTransport string, port, targetPort int) RunConfigBuilderOption
- func WithVolumes(volumes []string) RunConfigBuilderOption
- type Runner
- func (r *Runner) AddMiddleware(middleware types.Middleware)
- func (r *Runner) Cleanup(ctx context.Context) error
- func (r *Runner) GetConfig() types.RunnerConfig
- func (r *Runner) Run(ctx context.Context) error
- func (r *Runner) SetAuthInfoHandler(handler http.Handler)
- func (r *Runner) SetPrometheusHandler(handler http.Handler)
- type ToolOverride
Constants ¶
const ( UVXScheme = "uvx://" NPXScheme = "npx://" GOScheme = "go://" )
Protocol schemes
const CurrentSchemaVersion = "v0.1.0"
CurrentSchemaVersion is the current version of the RunConfig schema TODO: Set to "v1.0.0" when we clean up the middleware configuration.
const DefaultCallbackPort = 8666
DefaultCallbackPort is the default port for the OAuth callback server
Variables ¶
This section is empty.
Functions ¶
func BuildFromProtocolSchemeWithName ¶ added in v0.2.3
func BuildFromProtocolSchemeWithName( ctx context.Context, imageManager images.ImageManager, serverOrImage string, caCertPath string, imageName string, dryRun bool, ) (string, error)
BuildFromProtocolSchemeWithName checks if the serverOrImage string contains a protocol scheme (uvx://, npx://, or go://) and builds a Docker image for it if needed with a custom image name. If imageName is empty, a default name will be generated. If dryRun is true, returns the Dockerfile content instead of building the image. Returns the Docker image name (or Dockerfile content if dryRun) and any error encountered.
func CleanupTempPermissionProfile ¶ added in v0.0.48
CleanupTempPermissionProfile removes a temporary permission profile file if it was created by toolhive
func CreatePermissionProfileFile ¶ added in v0.0.48
func CreatePermissionProfileFile(serverName string, permProfile *permissions.Profile) (string, error)
CreatePermissionProfileFile creates a temporary file with the permission profile
func GetSupportedMiddlewareFactories ¶ added in v0.2.8
func GetSupportedMiddlewareFactories() map[string]types.MiddlewareFactory
GetSupportedMiddlewareFactories returns a map of supported middleware types to their factory functions
func HandleProtocolScheme ¶ added in v0.0.33
func HandleProtocolScheme( ctx context.Context, imageManager images.ImageManager, serverOrImage string, caCertPath string, ) (string, error)
HandleProtocolScheme checks if the serverOrImage string contains a protocol scheme (uvx://, npx://, or go://) and builds a Docker image for it if needed. Returns the Docker image name to use and any error encountered.
func IsImageProtocolScheme ¶ added in v0.0.35
IsImageProtocolScheme checks if the serverOrImage string contains a protocol scheme (uvx://, npx://, or go://)
func PackageNameToImageName ¶ added in v0.3.2
PackageNameToImageName replaces slashes with dashes to create a valid Docker image name. If there is a version in the package name, the @ is replaced with a dash. For local paths, we clean up the path to make it a valid image name.
func ParseProtocolScheme ¶ added in v0.3.2
func ParseProtocolScheme(serverOrImage string) (templates.TransportType, string, error)
ParseProtocolScheme extracts the transport type and package name from the protocol scheme.
func PopulateMiddlewareConfigs ¶ added in v0.2.8
PopulateMiddlewareConfigs populates the MiddlewareConfigs slice based on the RunConfig settings This function serves as a bridge between the old configuration style and the new generic middleware system
Types ¶
type BuildContext ¶ added in v0.3.0
type BuildContext int
BuildContext defines the context in which the RunConfigBuilder is being used
const ( // BuildContextCLI indicates the builder is being used in CLI context with full validation BuildContextCLI BuildContext = iota // BuildContextOperator indicates the builder is being used in Kubernetes operator context BuildContextOperator )
type CLIEnvVarValidator ¶ added in v0.1.0
type CLIEnvVarValidator struct {
// contains filtered or unexported fields
}
CLIEnvVarValidator implements the EnvVarValidator interface for CLI usage. If any missing, mandatory variables are found, this code will prompt the user to supply them through stdin.
func NewCLIEnvVarValidator ¶ added in v0.3.0
func NewCLIEnvVarValidator(configProvider config.Provider) *CLIEnvVarValidator
NewCLIEnvVarValidator creates a new CLI environment variable validator with the given config provider.
func (*CLIEnvVarValidator) Validate ¶ added in v0.1.0
func (v *CLIEnvVarValidator) Validate( ctx context.Context, metadata *registry.ImageMetadata, runConfig *RunConfig, suppliedEnvVars map[string]string, ) (map[string]string, error)
Validate checks that all required environment variables and secrets are provided and returns the processed environment variables to be set.
type DetachedEnvVarValidator ¶ added in v0.1.0
type DetachedEnvVarValidator struct{}
DetachedEnvVarValidator implements the EnvVarValidator interface for scenarios where the user cannot be prompted for input. Any missing, mandatory variables will result in an error being returned.
func (*DetachedEnvVarValidator) Validate ¶ added in v0.1.0
func (*DetachedEnvVarValidator) Validate( _ context.Context, metadata *registry.ImageMetadata, runConfig *RunConfig, suppliedEnvVars map[string]string, ) (map[string]string, error)
Validate checks that all required environment variables and secrets are provided and returns the processed environment variables to be set.
type EnvVarValidator ¶ added in v0.1.0
type EnvVarValidator interface { // Validate checks that all required environment variables and secrets are provided // and returns the processed environment variables to be set. Validate( ctx context.Context, metadata *registry.ImageMetadata, runConfig *RunConfig, suppliedEnvVars map[string]string, ) (map[string]string, error) }
EnvVarValidator defines the interface for checking that the expected environment variables and secrets have been supplied when creating a workload. This is implemented as a strategy pattern since the handling is different for the CLI vs the API and k8s.
type RemoteAuthConfig ¶ added in v0.2.11
type RemoteAuthConfig struct { ClientID string ClientSecret string ClientSecretFile string Scopes []string SkipBrowser bool Timeout time.Duration `swaggertype:"string" example:"5m"` CallbackPort int // OAuth endpoint configuration (from registry) Issuer string AuthorizeURL string TokenURL string // Headers for HTTP requests Headers []*registry.Header // Environment variables for the client EnvVars []*registry.EnvVar // OAuth parameters for server-specific customization OAuthParams map[string]string }
RemoteAuthConfig holds configuration for remote authentication
type RemoteAuthHandler ¶ added in v0.2.11
type RemoteAuthHandler struct {
// contains filtered or unexported fields
}
RemoteAuthHandler handles authentication for remote MCP servers. Supports OAuth/OIDC-based authentication with automatic discovery.
func NewRemoteAuthHandler ¶ added in v0.2.11
func NewRemoteAuthHandler(config *RemoteAuthConfig) *RemoteAuthHandler
NewRemoteAuthHandler creates a new remote authentication handler
func (*RemoteAuthHandler) Authenticate ¶ added in v0.2.11
func (h *RemoteAuthHandler) Authenticate(ctx context.Context, remoteURL string) (*oauth2.TokenSource, error)
Authenticate is the main entry point for remote MCP server authentication
type RunConfig ¶
type RunConfig struct { // SchemaVersion is the version of the RunConfig schema SchemaVersion string `json:"schema_version" yaml:"schema_version"` // Image is the Docker image to run Image string `json:"image" yaml:"image"` // RemoteURL is the URL of the remote MCP server (if running remotely) RemoteURL string `json:"remote_url,omitempty" yaml:"remote_url,omitempty"` // RemoteAuthConfig contains OAuth configuration for remote MCP servers RemoteAuthConfig *RemoteAuthConfig `json:"remote_auth_config,omitempty" yaml:"remote_auth_config,omitempty"` // CmdArgs are the arguments to pass to the container CmdArgs []string `json:"cmd_args,omitempty" yaml:"cmd_args,omitempty"` // Name is the name of the MCP server Name string `json:"name" yaml:"name"` // ContainerName is the name of the container ContainerName string `json:"container_name,omitempty" yaml:"container_name,omitempty"` // BaseName is the base name used for the container (without prefixes) BaseName string `json:"base_name,omitempty" yaml:"base_name,omitempty"` // Transport is the transport mode (stdio, sse, or streamable-http) Transport types.TransportType `json:"transport" yaml:"transport"` // Host is the host for the HTTP proxy Host string `json:"host" yaml:"host"` // Port is the port for the HTTP proxy to listen on (host port) Port int `json:"port" yaml:"port"` // TargetPort is the port for the container to expose (only applicable to SSE transport) TargetPort int `json:"target_port,omitempty" yaml:"target_port,omitempty"` // TargetHost is the host to forward traffic to (only applicable to SSE transport) TargetHost string `json:"target_host,omitempty" yaml:"target_host,omitempty"` // PermissionProfileNameOrPath is the name or path of the permission profile PermissionProfileNameOrPath string `json:"permission_profile_name_or_path,omitempty" yaml:"permission_profile_name_or_path,omitempty"` //nolint:lll // PermissionProfile is the permission profile to use PermissionProfile *permissions.Profile `json:"permission_profile" yaml:"permission_profile"` // EnvVars are the parsed environment variables as key-value pairs EnvVars map[string]string `json:"env_vars,omitempty" yaml:"env_vars,omitempty"` // EnvFileDir is the directory path to load environment files from EnvFileDir string `json:"env_file_dir,omitempty" yaml:"env_file_dir,omitempty"` // Debug indicates whether debug mode is enabled Debug bool `json:"debug,omitempty" yaml:"debug,omitempty"` // Volumes are the directory mounts to pass to the container // Format: "host-path:container-path[:ro]" Volumes []string `json:"volumes,omitempty" yaml:"volumes,omitempty"` // ContainerLabels are the labels to apply to the container ContainerLabels map[string]string `json:"container_labels,omitempty" yaml:"container_labels,omitempty"` // OIDCConfig contains OIDC configuration OIDCConfig *auth.TokenValidatorConfig `json:"oidc_config,omitempty" yaml:"oidc_config,omitempty"` // AuthzConfig contains the authorization configuration AuthzConfig *authz.Config `json:"authz_config,omitempty" yaml:"authz_config,omitempty"` // AuthzConfigPath is the path to the authorization configuration file AuthzConfigPath string `json:"authz_config_path,omitempty" yaml:"authz_config_path,omitempty"` // AuditConfig contains the audit logging configuration AuditConfig *audit.Config `json:"audit_config,omitempty" yaml:"audit_config,omitempty"` // AuditConfigPath is the path to the audit configuration file AuditConfigPath string `json:"audit_config_path,omitempty" yaml:"audit_config_path,omitempty"` // TelemetryConfig contains the OpenTelemetry configuration TelemetryConfig *telemetry.Config `json:"telemetry_config,omitempty" yaml:"telemetry_config,omitempty"` // Secrets are the secret parameters to pass to the container // Format: "<secret name>,target=<target environment variable>" Secrets []string `json:"secrets,omitempty" yaml:"secrets,omitempty"` // K8sPodTemplatePatch is a JSON string to patch the Kubernetes pod template // Only applicable when using Kubernetes runtime K8sPodTemplatePatch string `json:"k8s_pod_template_patch,omitempty" yaml:"k8s_pod_template_patch,omitempty"` // Deployer is the container runtime to use (not serialized) Deployer rt.Deployer `json:"-" yaml:"-"` // IsolateNetwork indicates whether to isolate the network for the container IsolateNetwork bool `json:"isolate_network,omitempty" yaml:"isolate_network,omitempty"` // ProxyMode is the proxy mode for stdio transport ("sse" or "streamable-http") ProxyMode types.ProxyMode `json:"proxy_mode,omitempty" yaml:"proxy_mode,omitempty"` // ThvCABundle is the path to the CA certificate bundle for ToolHive HTTP operations ThvCABundle string `json:"thv_ca_bundle,omitempty" yaml:"thv_ca_bundle,omitempty"` // JWKSAuthTokenFile is the path to file containing auth token for JWKS/OIDC requests JWKSAuthTokenFile string `json:"jwks_auth_token_file,omitempty" yaml:"jwks_auth_token_file,omitempty"` // Group is the name of the group this workload belongs to, if any Group string `json:"group,omitempty" yaml:"group,omitempty"` // ToolsFilter is the list of tools to filter ToolsFilter []string `json:"tools_filter,omitempty" yaml:"tools_filter,omitempty"` // ToolsOverride is a map from an actual tool to its overridden name and/or description ToolsOverride map[string]ToolOverride `json:"tools_override,omitempty" yaml:"tools_override,omitempty"` // IgnoreConfig contains configuration for ignore processing IgnoreConfig *ignore.Config `json:"ignore_config,omitempty" yaml:"ignore_config,omitempty"` // MiddlewareConfigs contains the list of middleware to apply to the transport // and the configuration for each middleware. MiddlewareConfigs []types.MiddlewareConfig `json:"middleware_configs,omitempty" yaml:"middleware_configs,omitempty"` // contains filtered or unexported fields }
RunConfig contains all the configuration needed to run an MCP server It is serializable to JSON and YAML NOTE: This format is importable and exportable, and as a result should be considered part of ToolHive's API contract.
func NewOperatorRunConfigBuilder ¶ added in v0.3.0
func NewOperatorRunConfigBuilder( ctx context.Context, imageMetadata *registry.ImageMetadata, envVars map[string]string, envVarValidator EnvVarValidator, runConfigOptions ...RunConfigBuilderOption, ) (*RunConfig, error)
NewOperatorRunConfigBuilder creates a new RunConfigBuilder configured for operator use
func NewRunConfig ¶
func NewRunConfig() *RunConfig
NewRunConfig creates a new RunConfig with default values
func NewRunConfigBuilder ¶ added in v0.1.6
func NewRunConfigBuilder( ctx context.Context, imageMetadata *registry.ImageMetadata, envVars map[string]string, envVarValidator EnvVarValidator, runConfigOptions ...RunConfigBuilderOption, ) (*RunConfig, error)
NewRunConfigBuilder creates the final RunConfig instance with validation and processing
func (*RunConfig) GetBaseName ¶ added in v0.2.6
GetBaseName returns the base name for the run configuration
func (*RunConfig) GetPort ¶ added in v0.2.8
GetPort returns the port from the runner config (implements types.RunnerConfig)
func (*RunConfig) SaveState ¶ added in v0.2.4
SaveState saves the run configuration to the state store
func (*RunConfig) ValidateSecrets ¶ added in v0.1.8
ValidateSecrets checks if the secrets can be parsed and are valid
func (*RunConfig) WithContainerName ¶
WithContainerName generates container name if not already set Returns the config and a boolean indicating if the name was sanitized
func (*RunConfig) WithEnvFile ¶ added in v0.2.11
WithEnvFile processes a single environment file and adds it to environment variables
func (*RunConfig) WithEnvFilesFromDirectory ¶ added in v0.2.11
WithEnvFilesFromDirectory processes environment files from a directory and adds them to environment variables
func (*RunConfig) WithEnvironmentVariables ¶
WithEnvironmentVariables sets environment variables
func (*RunConfig) WithMiddlewareConfig ¶ added in v0.2.4
func (c *RunConfig) WithMiddlewareConfig(middlewareConfig []types.MiddlewareConfig) *RunConfig
WithMiddlewareConfig adds middleware configuration to the RunConfig
func (*RunConfig) WithSecrets ¶
func (c *RunConfig) WithSecrets(ctx context.Context, secretManager secrets.Provider) (*RunConfig, error)
WithSecrets processes secrets and adds them to environment variables
func (*RunConfig) WithStandardLabels ¶
WithStandardLabels adds standard labels to the container
func (*RunConfig) WithTransport ¶
WithTransport parses and sets the transport type
type RunConfigBuilderOption ¶ added in v0.3.0
type RunConfigBuilderOption func(*runConfigBuilder) error
RunConfigBuilderOption is a function that modifies the RunConfigBuilder
func WithAuditConfigPath ¶ added in v0.3.0
func WithAuditConfigPath(path string) RunConfigBuilderOption
WithAuditConfigPath sets the audit config path
func WithAuditEnabled ¶ added in v0.3.0
func WithAuditEnabled(enableAudit bool, auditConfigPath string) RunConfigBuilderOption
WithAuditEnabled configures audit settings
func WithAuthzConfig ¶ added in v0.3.0
func WithAuthzConfig(config *authz.Config) RunConfigBuilderOption
WithAuthzConfig sets the authorization config data
func WithAuthzConfigPath ¶ added in v0.3.0
func WithAuthzConfigPath(path string) RunConfigBuilderOption
WithAuthzConfigPath sets the authorization config path
func WithCmdArgs ¶ added in v0.3.0
func WithCmdArgs(args []string) RunConfigBuilderOption
WithCmdArgs sets the command arguments
func WithDebug ¶ added in v0.3.0
func WithDebug(debug bool) RunConfigBuilderOption
WithDebug sets debug mode
func WithEnvFile ¶ added in v0.3.0
func WithEnvFile(filePath string) RunConfigBuilderOption
WithEnvFile adds environment variables from a single file
func WithEnvFileDir ¶ added in v0.3.2
func WithEnvFileDir(dirPath string) RunConfigBuilderOption
WithEnvFileDir sets the directory path for loading environment files (for ConfigMap serialization)
func WithEnvFilesFromDirectory ¶ added in v0.3.0
func WithEnvFilesFromDirectory(dirPath string) RunConfigBuilderOption
WithEnvFilesFromDirectory adds environment variables from all files in a directory
func WithEnvVars ¶ added in v0.3.0
func WithEnvVars(envVars map[string]string) RunConfigBuilderOption
WithEnvVars sets environment variables from a map
func WithGroup ¶ added in v0.3.0
func WithGroup(groupName string) RunConfigBuilderOption
WithGroup sets the group name for the workload
func WithHost ¶ added in v0.3.0
func WithHost(host string) RunConfigBuilderOption
WithHost sets the host (applies default if empty)
func WithIgnoreConfig ¶ added in v0.3.0
func WithIgnoreConfig(ignoreConfig *ignore.Config) RunConfigBuilderOption
WithIgnoreConfig sets the ignore configuration
func WithImage ¶ added in v0.3.0
func WithImage(image string) RunConfigBuilderOption
WithImage sets the Docker image
func WithK8sPodPatch ¶ added in v0.3.0
func WithK8sPodPatch(patch string) RunConfigBuilderOption
WithK8sPodPatch sets the Kubernetes pod template patch
func WithLabels ¶ added in v0.3.0
func WithLabels(labelStrings []string) RunConfigBuilderOption
WithLabels sets custom labels from command-line flags
func WithMiddlewareConfig ¶ added in v0.3.0
func WithMiddlewareConfig(middlewareConfig []types.MiddlewareConfig) RunConfigBuilderOption
WithMiddlewareConfig sets the middleware configuration
func WithMiddlewareFromFlags ¶ added in v0.3.0
func WithMiddlewareFromFlags( oidcConfig *auth.TokenValidatorConfig, toolsFilter []string, toolsOverride map[string]ToolOverride, telemetryConfig *telemetry.Config, authzConfigPath string, enableAudit bool, auditConfigPath string, serverName string, transportType string, ) RunConfigBuilderOption
WithMiddlewareFromFlags creates middleware configurations directly from flag values
func WithName ¶ added in v0.3.0
func WithName(name string) RunConfigBuilderOption
WithName sets the MCP server name
func WithNetworkIsolation ¶ added in v0.3.0
func WithNetworkIsolation(isolate bool) RunConfigBuilderOption
WithNetworkIsolation sets network isolation
func WithOIDCConfig ¶ added in v0.3.0
func WithOIDCConfig( oidcIssuer string, oidcAudience string, oidcJwksURL string, oidcIntrospectionURL string, oidcClientID string, oidcClientSecret string, thvCABundle string, jwksAuthTokenFile string, resourceURL string, jwksAllowPrivateIP bool, ) RunConfigBuilderOption
WithOIDCConfig configures OIDC settings
func WithPermissionProfile ¶ added in v0.3.0
func WithPermissionProfile(profile *permissions.Profile) RunConfigBuilderOption
WithPermissionProfile sets the permission profile directly. If called multiple times or mixed with WithPermissionProfile, the last call takes precedence.
func WithPermissionProfileNameOrPath ¶ added in v0.3.0
func WithPermissionProfileNameOrPath(profile string) RunConfigBuilderOption
WithPermissionProfileNameOrPath sets the permission profile name or path. If called multiple times or mixed with WithPermissionProfile, the last call takes precedence.
func WithProxyMode ¶ added in v0.3.0
func WithProxyMode(mode types.ProxyMode) RunConfigBuilderOption
WithProxyMode sets the proxy mode
func WithRemoteAuth ¶ added in v0.3.0
func WithRemoteAuth(config *RemoteAuthConfig) RunConfigBuilderOption
WithRemoteAuth sets the remote authentication configuration
func WithRemoteURL ¶ added in v0.3.0
func WithRemoteURL(remoteURL string) RunConfigBuilderOption
WithRemoteURL sets the remote URL for the MCP server
func WithRuntime ¶ added in v0.3.0
func WithRuntime(deployer rt.Deployer) RunConfigBuilderOption
WithRuntime sets the container runtime
func WithSecrets ¶ added in v0.3.0
func WithSecrets(secrets []string) RunConfigBuilderOption
WithSecrets sets the secrets list
func WithTargetHost ¶ added in v0.3.0
func WithTargetHost(targetHost string) RunConfigBuilderOption
WithTargetHost sets the target host (applies default if empty)
func WithTelemetryConfig ¶ added in v0.3.0
func WithTelemetryConfig( otelEndpoint string, otelEnablePrometheusMetricsPath bool, otelTracingEnabled bool, otelMetricsEnabled bool, otelServiceName string, otelSamplingRate float64, otelHeaders []string, otelInsecure bool, otelEnvironmentVariables []string, ) RunConfigBuilderOption
WithTelemetryConfig configures telemetry settings
func WithToolsFilter ¶ added in v0.3.0
func WithToolsFilter(toolsFilter []string) RunConfigBuilderOption
WithToolsFilter sets the tools filter
func WithToolsOverride ¶ added in v0.3.0
func WithToolsOverride(toolOverride map[string]ToolOverride) RunConfigBuilderOption
WithToolsOverride sets the tool override map for the RunConfig This method is mutually exclusive with WithToolOverrideFile
func WithTransportAndPorts ¶ added in v0.3.0
func WithTransportAndPorts(mcpTransport string, port, targetPort int) RunConfigBuilderOption
WithTransportAndPorts sets transport and port configuration
func WithVolumes ¶ added in v0.3.0
func WithVolumes(volumes []string) RunConfigBuilderOption
WithVolumes sets the volume mounts
type Runner ¶
type Runner struct { // Config is the configuration for the runner Config *RunConfig // contains filtered or unexported fields }
Runner is responsible for running an MCP server with the provided configuration
func NewRunner ¶
func NewRunner(runConfig *RunConfig, statusManager statuses.StatusManager) *Runner
NewRunner creates a new Runner with the provided configuration
func (*Runner) AddMiddleware ¶ added in v0.2.8
func (r *Runner) AddMiddleware(middleware types.Middleware)
AddMiddleware adds a middleware instance and its function to the runner
func (*Runner) Cleanup ¶ added in v0.0.47
Cleanup performs cleanup operations for the runner, including shutting down all middleware.
func (*Runner) GetConfig ¶ added in v0.2.8
func (r *Runner) GetConfig() types.RunnerConfig
GetConfig returns a config interface for middleware to access runner configuration
func (*Runner) SetAuthInfoHandler ¶ added in v0.2.8
SetAuthInfoHandler sets the authentication info handler
func (*Runner) SetPrometheusHandler ¶ added in v0.2.8
SetPrometheusHandler sets the Prometheus metrics handler
type ToolOverride ¶ added in v0.2.12
type ToolOverride struct { // Name is the redefined name of the tool Name string `json:"name,omitempty"` // Description is the redefined description of the tool Description string `json:"description,omitempty"` }
ToolOverride represents a tool override. Both Name and Description can be overridden independently, but they can't be both empty.