Documentation
¶
Index ¶
- Constants
- func CanonicalizeServerName(serverName string) string
- func CreateArtifactWithSubjectAndPush(ref name.Reference, catalog Catalog, subjectDigest v1.Hash, subjectSize int64, ...) (string, error)
- func Import(registryURL string, ociRepository string, push bool) error
- func ImportToServer(registryURL string) (catalog.Server, error)
- func InspectArtifact(ociRef string) error
- func SelfContainedCatalog(ctx context.Context, dockerClient docker.Client, serverNames []string) (catalog.Catalog, []string, error)
- type Argument
- type Catalog
- type Input
- type InputWithVariables
- type KeyValueInput
- type Package
- type Remote
- type RemoteServer
- type Repository
- type RuntimeOptions
- type Server
- type ServerDetail
- type VersionDetail
Constants ¶
const MCPServerArtifactType = "application/vnd.docker.mcp.server"
Variables ¶
This section is empty.
Functions ¶
func CanonicalizeServerName ¶
canonicalizeServerName replaces all dots in a string with underscores
func InspectArtifact ¶
InspectArtifact reads an OCI artifact and outputs formatted JSON content
Types ¶
type Argument ¶
type Argument struct {
InputWithVariables
Type string `json:"type"` // named, positional
ValueHint string `json:"value_hint,omitempty"`
IsRepeated bool `json:"is_repeated,omitempty"`
Name string `json:"name,omitempty"` // required if named
}
type Catalog ¶
type Catalog struct {
Registry []Server `json:"registry"`
}
Catalog represents an OCI catalog structure with a top-level Registry field
func ReadArtifact ¶
ReadArtifact reads an OCI artifact by reference and returns parsed Catalog from the first layer if the artifact type is application/vnd.docker.mcp.server, otherwise returns an error
type Input ¶
type Input struct {
Description string `json:"description,omitempty"`
Value string `json:"value,omitempty"`
Required bool `json:"is_required,omitempty"`
Secret bool `json:"is_secret,omitempty"`
DefaultValue string `json:"default,omitempty"`
Choices []string `json:"choices,omitempty"`
Format string `json:"format,omitempty"` // "string", "number", "boolean", "filepath"
}
Input represents input configuration
type InputWithVariables ¶
type KeyValueInput ¶
type KeyValueInput struct {
InputWithVariables
Name string `json:"name"`
}
type Package ¶
type Package struct {
RegistryType string `json:"registry_type"` // npm, pypi, oci, nuget, mcpb
Identifier string `json:"identifier"` // registry name
Version string `json:"version,omitempty"` // tag or digest
RegistryBaseURL string `json:"registry_base_url,omitempty"`
Env []KeyValueInput `json:"environment_variables,omitempty"`
RuntimeOptions []Argument `json:"runtime_arguments,omitempty"`
PackageArguments []Argument `json:"package_arguments,omitempty"`
}
Package represents a package definition
type RemoteServer ¶
type RemoteServer struct {
URL string `json:"url,omitempty"`
TransportType string `json:"type,omitempty"` // "streamable-http", "sse"
Headers []KeyValueInput `json:"headers,omitempty"`
}
Remote represents a remote server configuration
type Repository ¶
type Repository struct {
URL string `json:"url,omitempty"`
Source string `json:"source,omitempty"`
ID string `json:"id,omitempty"`
}
Repository contains repository information for the server
type RuntimeOptions ¶
type RuntimeOptions struct {
Command []string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]any `json:"env,omitempty"`
WorkDir string `json:"work_dir,omitempty"`
}
RuntimeOptions contains runtime configuration
type Server ¶
type Server struct {
Server ServerDetail `json:"server"`
Registry json.RawMessage `json:"x-io.modelcontextprotocol.registry"`
}
Server represents a server definition in the OCI catalog
type ServerDetail ¶
type ServerDetail struct {
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
VersionDetail *VersionDetail `json:"version_detail,omitempty"`
Status string `json:"status,omitempty"` // "active", "deprecated", or "deleted"
Repository Repository `json:"repository,omitempty"`
Packages []Package `json:"packages,omitempty"`
Remotes []Remote `json:"remotes,omitempty"`
Meta map[string]any `json:"_meta,omitempty"`
}
ServerDetail represents the complete server definition based on the MCP registry schema
func (*ServerDetail) ToCatalogServer ¶
func (sd *ServerDetail) ToCatalogServer() catalog.Server
ToCatalogServer converts an OCI ServerDetail to a catalog.Server
type VersionDetail ¶
type VersionDetail struct {
Version string `json:"version"`
}
VersionDetail contains version information