Documentation
¶
Index ¶
- Constants
- Variables
- func TransformToDocker(ctx context.Context, serverDetail ServerDetail, opts ...TransformOption) (*Server, TransformSource, error)
- type Catalog
- func Get(ctx context.Context) (Catalog, error)
- func GetWithOptions(ctx context.Context, useConfigured bool, additionalCatalogs []string) (Catalog, error)
- func ReadFrom(ctx context.Context, fileOrURLs []string) (Catalog, error)
- func ReadOne(ctx context.Context, fileOrURL string) (Catalog, string, string, error)
- type Config
- type Container
- type Env
- type Items
- type Metadata
- type OAuth
- type OAuthProvider
- type Parameters
- type Properties
- type Property
- type PyPIVersionResolver
- type RegistryEntry
- type Remote
- type Run
- type Secret
- type Server
- type ServerConfig
- type ServerDetail
- type Tool
- type ToolAnnotations
- type ToolArgument
- type ToolGroup
- type TransformOption
- type TransformSource
Constants ¶
const (
DockerCatalogFilename = "docker-mcp.yaml"
)
Variables ¶
var ErrIncompatibleServer = errors.New("incompatible server")
ErrIncompatibleServer is returned by TransformToDocker when the server has no compatible package type (e.g. no OCI+stdio package and no remote).
Functions ¶
func TransformToDocker ¶ added in v0.39.0
func TransformToDocker(ctx context.Context, serverDetail ServerDetail, opts ...TransformOption) (*Server, TransformSource, error)
TransformToDocker transforms a ServerDetail (community format) to Server (catalog format). The returned TransformSource indicates which package type was used (oci, pypi, or remote).
Types ¶
type Catalog ¶
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 Parameters ¶
type Parameters struct {
Type string `yaml:"type" json:"type"`
Properties Properties `yaml:"properties" json:"properties"`
Required []string `yaml:"required" json:"required"`
}
type Properties ¶
func (*Properties) ToMap ¶
func (p *Properties) ToMap() map[string]any
type PyPIVersionResolver ¶ added in v0.40.2
type PyPIVersionResolver func(ctx context.Context, identifier, version, registryBaseURL string) (string, bool)
PyPIVersionResolver resolves the minimum Python version for a PyPI package. It returns the minimum Python version string (e.g., "3.10") or empty string if unknown, and a boolean indicating whether the package was found.
func DefaultPyPIVersionResolver ¶ added in v0.40.2
func DefaultPyPIVersionResolver() PyPIVersionResolver
DefaultPyPIVersionResolver creates a resolver using the default HTTP client with proxy transport.
func NewPyPIVersionResolver ¶ added in v0.40.2
func NewPyPIVersionResolver(httpClient *http.Client) PyPIVersionResolver
NewPyPIVersionResolver creates a resolver that queries the PyPI JSON API.
type RegistryEntry ¶ added in v0.39.0
type RegistryEntry = v0.ServerResponse
Type aliases for imported types from the registry package
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 (*Server) HasExplicitOAuthProviders ¶ added in v0.40.1
HasExplicitOAuthProviders returns true if this is a remote server with explicit OAuth provider metadata in the catalog (e.g. oauth.providers YAML). Community servers that discover OAuth dynamically will return false here.
func (*Server) IsOAuthServer ¶ added in v0.27.0
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 TransformOption ¶ added in v0.40.2
type TransformOption func(*transformOptions)
TransformOption configures the behavior of TransformToDocker.
func WithAllowPyPI ¶ added in v0.40.2
func WithAllowPyPI(allow bool) TransformOption
WithAllowPyPI controls whether PyPI packages are considered during transformation. By default, PyPI packages are allowed.
func WithPyPIResolver ¶ added in v0.40.2
func WithPyPIResolver(resolver PyPIVersionResolver) TransformOption
WithPyPIResolver sets the PyPI version resolver used to determine the Python version for PyPI packages. If not set, the default Python version is used.
type TransformSource ¶ added in v0.40.2
type TransformSource string
TransformSource describes the package type that TransformToDocker resolved.
const ( TransformSourceOCI TransformSource = "oci" TransformSourcePyPI TransformSource = "pypi" TransformSourceRemote TransformSource = "remote" )