workingset

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentWorkingSetVersion = 1
View Source
const MCPWorkingSetArtifactType = "application/vnd.docker.mcp.profile.v1+json"

Variables

This section is empty.

Functions

func AddServers added in v0.28.0

func AddServers(ctx context.Context, dao db.DAO, registryClient registryapi.Client, ociService oci.Service, id string, servers []string) error

func Create

func Create(ctx context.Context, dao db.DAO, registryClient registryapi.Client, ociService oci.Service, id string, name string, servers []string, connectClients []string) error

func Export

func Export(ctx context.Context, dao db.DAO, id string, filename string) error

func Import

func Import(ctx context.Context, dao db.DAO, ociService oci.Service, filename string) error

func List

func List(ctx context.Context, dao db.DAO, format OutputFormat) error

func ListServers added in v0.29.0

func ListServers(ctx context.Context, dao db.DAO, filters []string, format OutputFormat) error

func Pull

func Pull(ctx context.Context, dao db.DAO, ociService oci.Service, ref string) error

func Push

func Push(ctx context.Context, dao db.DAO, id string, refStr string) error

func Remove

func Remove(ctx context.Context, dao db.DAO, id string) error

func RemoveServers added in v0.28.0

func RemoveServers(ctx context.Context, dao db.DAO, id string, serverNames []string) error

func ResolveImageRef added in v0.28.0

func ResolveImageRef(ctx context.Context, ociService oci.Service, value string) (string, error)

func ResolveRegistry added in v0.28.0

func ResolveRegistry(ctx context.Context, registryClient registryapi.Client, value string) (string, error)

func Show

func Show(ctx context.Context, dao db.DAO, id string, format OutputFormat, showClients bool) error

func SupportedFormats

func SupportedFormats() []string

func UpdateConfig added in v0.28.0

func UpdateConfig(ctx context.Context, dao db.DAO, ociService oci.Service, id string, setConfigArgs, getConfigArgs, delConfigArgs []string, getAll bool, outputFormat OutputFormat) error

func UpdateTools added in v0.28.0

func UpdateTools(ctx context.Context, dao db.DAO, id string, enable, disable, enableAll, disableAll []string) error

Types

type OutputFormat

type OutputFormat string
const (
	OutputFormatJSON          OutputFormat = "json"
	OutputFormatYAML          OutputFormat = "yaml"
	OutputFormatHumanReadable OutputFormat = "human"
)

type SearchResult added in v0.26.0

type SearchResult struct {
	ID      string   `json:"id" yaml:"id"`
	Name    string   `json:"name" yaml:"name"`
	Servers []Server `json:"servers" yaml:"servers"`
}

type Secret

type Secret struct {
	Provider SecretProvider `yaml:"provider" json:"provider" validate:"required,oneof=docker-desktop-store"`
}

Secret represents a secret configuration in a working set

type SecretProvider

type SecretProvider string
const (
	SecretProviderDockerDesktop SecretProvider = "docker-desktop-store"
)

type Server

type Server struct {
	Type    ServerType     `yaml:"type" json:"type" validate:"required,oneof=registry image remote"`
	Config  map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
	Secrets string         `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	Tools   []string       `yaml:"tools" json:"tools"`

	// ServerTypeRegistry only
	Source string `yaml:"source,omitempty" json:"source,omitempty" validate:"required_if=Type registry"`

	// ServerTypeImage only
	Image string `yaml:"image,omitempty" json:"image,omitempty" validate:"required_if=Type image"`

	// ServerTypeRemote only
	Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty" validate:"required_if=Type remote"`

	// Optional snapshot of the server schema
	Snapshot *ServerSnapshot `yaml:"snapshot,omitempty" json:"snapshot,omitempty"`
}

Server represents a server configuration in a working set

func ResolveCatalogServers added in v0.29.0

func ResolveCatalogServers(ctx context.Context, dao db.DAO, value string) ([]Server, error)

func (*Server) BasicName added in v0.28.0

func (s *Server) BasicName() string

type ServerSnapshot added in v0.26.0

type ServerSnapshot struct {
	Server catalog.Server `yaml:"server" json:"server"`
}

func ResolveImageSnapshot added in v0.28.0

func ResolveImageSnapshot(ctx context.Context, ociService oci.Service, image string) (*ServerSnapshot, error)

func ResolveSnapshot added in v0.26.0

func ResolveSnapshot(ctx context.Context, ociService oci.Service, server Server) (*ServerSnapshot, error)

type ServerType

type ServerType string
const (
	ServerTypeRegistry ServerType = "registry"
	ServerTypeImage    ServerType = "image"
	ServerTypeRemote   ServerType = "remote"
)

type WithOptions added in v0.29.0

type WithOptions struct {
	WorkingSet `yaml:",inline"`
	Clients    map[string]any `json:"clients" yaml:"clients"`
}

type WorkingSet

type WorkingSet struct {
	Version int               `yaml:"version" json:"version" validate:"required,min=1,max=1"`
	ID      string            `yaml:"id" json:"id" validate:"required"`
	Name    string            `yaml:"name" json:"name" validate:"required,min=1"`
	Servers []Server          `yaml:"servers" json:"servers" validate:"dive"`
	Secrets map[string]Secret `yaml:"secrets,omitempty" json:"secrets,omitempty" validate:"dive"`
}

WorkingSet represents a collection of MCP servers and their configurations

func NewFromDb

func NewFromDb(dbSet *db.WorkingSet) WorkingSet

func (*WorkingSet) EnsureSnapshotsResolved added in v0.28.0

func (workingSet *WorkingSet) EnsureSnapshotsResolved(ctx context.Context, ociService oci.Service) error

func (*WorkingSet) FindServer added in v0.28.0

func (workingSet *WorkingSet) FindServer(serverName string) *Server

func (WorkingSet) ToDb

func (workingSet WorkingSet) ToDb() db.WorkingSet

func (*WorkingSet) Validate

func (workingSet *WorkingSet) Validate() error

Jump to

Keyboard shortcuts

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