Help us shape the future of Go! Take the 2026 Go Developer Survey

catalog

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerCatalogFilename = "docker-mcp.yaml"
)

Variables

This section is empty.

Functions

func TransformJSON added in v0.39.0

func TransformJSON(registryJSON string) (string, error)

TransformJSON transforms community registry JSON to catalog JSON

Types

type Catalog

type Catalog struct {
	Servers map[string]Server
}

func Get

func Get(ctx context.Context) (Catalog, error)

func GetWithOptions

func GetWithOptions(ctx context.Context, useConfigured bool, additionalCatalogs []string) (Catalog, error)

GetWithOptions loads catalogs with enhanced options for configured catalogs and additional catalogs

func ReadFrom

func ReadFrom(ctx context.Context, fileOrURLs []string) (Catalog, error)

func ReadOne added in v0.28.0

func ReadOne(ctx context.Context, fileOrURL string) (Catalog, string, string, error)

type Config

type Config struct {
	Secrets []Secret `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	Env     []Env    `yaml:"env,omitempty" json:"env,omitempty"`
}

type Container

type Container struct {
	Image   string   `yaml:"image" json:"image"`
	Command []string `yaml:"command" json:"command"`
	Volumes []string `yaml:"volumes" json:"volumes"`
	User    string   `yaml:"user,omitempty" json:"user,omitempty"`
}

type Env

type Env struct {
	Name  string `yaml:"name" json:"name"`
	Value string `yaml:"value" json:"value"`
}

type Items

type Items struct {
	Type string `yaml:"type" json:"type"`
}

type Metadata added in v0.29.0

type Metadata struct {
	Pulls       int      `yaml:"pulls,omitempty" json:"pulls,omitempty"`
	Stars       int      `yaml:"stars,omitempty" json:"stars,omitempty"`
	GithubStars int      `yaml:"githubStars,omitempty" json:"githubStars,omitempty"`
	Category    string   `yaml:"category,omitempty" json:"category,omitempty"`
	Tags        []string `yaml:"tags,omitempty" json:"tags,omitempty"`
	License     string   `yaml:"license,omitempty" json:"license,omitempty"`
	Owner       string   `yaml:"owner,omitempty" json:"owner,omitempty"`
	// RegistryURL is the full URL to the server in the community MCP registry
	// e.g., "https://registry.modelcontextprotocol.io/v0/servers/io.github.arm%2Farm-mcp/versions/1.0.2"
	RegistryURL string `yaml:"registryUrl,omitempty" json:"registryUrl,omitempty"`
}

type OAuth

type OAuth struct {
	Providers []OAuthProvider `yaml:"providers,omitempty" json:"providers,omitempty"`
	Scopes    []string        `yaml:"scopes,omitempty" json:"scopes,omitempty"`
}

type OAuthProvider

type OAuthProvider struct {
	Provider string `yaml:"provider" json:"provider"`
	Secret   string `json:"secret,omitempty" yaml:"secret,omitempty"`
	Env      string `json:"env,omitempty" yaml:"env,omitempty"`
}

type Parameters

type Parameters struct {
	Type       string     `yaml:"type" json:"type"`
	Properties Properties `yaml:"properties" json:"properties"`
	Required   []string   `yaml:"required" json:"required"`
}

type Properties

type Properties map[string]Property

func (*Properties) ToMap

func (p *Properties) ToMap() map[string]any

type Property

type Property struct {
	Type        string `yaml:"type" json:"type"`
	Description string `yaml:"description" json:"description"`
	Items       *Items `yaml:"items,omitempty" json:"items,omitempty"`
}

type RegistryEntry added in v0.39.0

type RegistryEntry = v0.ServerResponse

Type aliases for imported types from the registry package

type Remote

type Remote struct {
	URL       string            `yaml:"url,omitempty" json:"url,omitempty"`
	Transport string            `yaml:"transport_type,omitempty" json:"transport_type,omitempty"`
	Headers   map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
}

type Run

type Run struct {
	Command []string          `yaml:"command,omitempty" json:"command,omitempty"`
	Volumes []string          `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Env     map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
}

type Secret

type Secret struct {
	Name string `yaml:"name" json:"name"`
	Env  string `yaml:"env" json:"env"`
}

type Server

type Server struct {
	Name           string    `yaml:"name,omitempty" json:"name,omitempty" validate:"required,min=1"`
	Type           string    `yaml:"type" json:"type" validate:"required,oneof=server remote poci"`
	Image          string    `yaml:"image" json:"image"`
	Description    string    `yaml:"description,omitempty" json:"description,omitempty"`
	Title          string    `yaml:"title,omitempty" json:"title,omitempty"`
	Icon           string    `yaml:"icon,omitempty" json:"icon,omitempty"`
	ReadmeURL      string    `yaml:"readme,omitempty" json:"readme,omitempty"`
	LongLived      bool      `yaml:"longLived,omitempty" json:"longLived,omitempty"`
	Remote         Remote    `yaml:"remote" json:"remote"`
	SSEEndpoint    string    `yaml:"sseEndpoint,omitempty" json:"sseEndpoint,omitempty"` // Deprecated: Use Remote instead
	OAuth          *OAuth    `yaml:"oauth,omitempty" json:"oauth,omitempty"`
	Secrets        []Secret  `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	Env            []Env     `yaml:"env,omitempty" json:"env,omitempty"`
	Command        []string  `yaml:"command,omitempty" json:"command,omitempty"`
	Volumes        []string  `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	User           string    `yaml:"user,omitempty" json:"user,omitempty"`
	DisableNetwork bool      `yaml:"disableNetwork,omitempty" json:"disableNetwork,omitempty"`
	AllowHosts     []string  `yaml:"allowHosts,omitempty" json:"allowHosts,omitempty"`
	ExtraHosts     []string  `yaml:"extraHosts,omitempty" json:"extraHosts,omitempty"`
	Tools          []Tool    `yaml:"tools,omitempty" json:"tools,omitempty" validate:"dive"`
	Config         []any     `yaml:"config,omitempty" json:"config,omitempty"`
	Prefix         string    `yaml:"prefix,omitempty" json:"prefix,omitempty"`
	Metadata       *Metadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`
	// Policy describes the policy decision for this server.
	Policy *policy.Decision `yaml:"policy,omitempty" json:"policy,omitempty"`
}

func TransformToDocker added in v0.39.0

func TransformToDocker(serverDetail ServerDetail) (*Server, error)

TransformToDocker transforms a ServerDetail (community format) to Server (catalog format)

func (*Server) IsOAuthServer added in v0.27.0

func (s *Server) IsOAuthServer() bool

func (*Server) IsRemoteOAuthServer

func (s *Server) IsRemoteOAuthServer() bool

type ServerConfig

type ServerConfig struct {
	Name    string
	Spec    Server
	Config  map[string]any
	Secrets map[string]string
}

func (*ServerConfig) IsRemote added in v0.35.0

func (sc *ServerConfig) IsRemote() bool

IsRemote returns true if this server is a remote MCP server (not a Docker container)

type ServerDetail added in v0.39.0

type ServerDetail = v0.ServerJSON

Type aliases for imported types from the registry package

type Tool

type Tool struct {
	Name        string `yaml:"name" json:"name" validate:"required,min=1"`
	Description string `yaml:"description" json:"description"`

	// These will only be set for oci catalogs (not legacy catalogs).
	Arguments   *[]ToolArgument  `yaml:"arguments,omitempty" json:"arguments,omitempty"`
	Annotations *ToolAnnotations `yaml:"annotations,omitempty" json:"annotations,omitempty"`

	// This is only used for POCIs.
	Container  Container  `yaml:"container,omitempty" json:"container,omitempty"`
	Parameters Parameters `yaml:"parameters,omitempty" json:"parameters,omitempty"`
	// Policy describes the policy decision for this tool.
	Policy *policy.Decision `yaml:"policy,omitempty" json:"policy,omitempty"`
}

type ToolAnnotations added in v0.35.0

type ToolAnnotations struct {
	Title           string `json:"title,omitempty" yaml:"title,omitempty"`
	ReadOnlyHint    *bool  `json:"readOnlyHint,omitempty" yaml:"readOnlyHint,omitempty"`
	DestructiveHint *bool  `json:"destructiveHint,omitempty" yaml:"destructiveHint,omitempty"`
	IdempotentHint  *bool  `json:"idempotentHint,omitempty" yaml:"idempotentHint,omitempty"`
	OpenWorldHint   *bool  `json:"openWorldHint,omitempty" yaml:"openWorldHint,omitempty"`
}

type ToolArgument added in v0.35.0

type ToolArgument struct {
	Name        string `json:"name" yaml:"name"`
	Type        string `json:"type" yaml:"type"`
	Items       *Items `json:"items,omitempty" yaml:"items,omitempty"`
	Description string `json:"desc" yaml:"desc"`
	Optional    bool   `json:"optional,omitempty" yaml:"optional,omitempty"`
}

type ToolGroup

type ToolGroup struct {
	Name  string `yaml:"name" json:"name"`
	Tools []Tool `yaml:"tools" json:"tools"`
}

Jump to

Keyboard shortcuts

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