Documentation
¶
Index ¶
- Constants
- func BuildRecord(app protocol.App, catalogEnv map[string]protocol.Input, descriptor *Descriptor) protocol.BuildRecord
- func SelectPackage(d *Descriptor, selection protocol.PackageSelection) (int, error)
- func ValidateEndpoint(location string) error
- func Variables(template string, declared map[string]InputFields, required bool) (map[string]wire.Input, error)
- type Descriptor
- type DescriptorInput
- type HolonMetadata
- type InputFields
- type Package
- type Requirement
- type RunConfig
- type Transport
- type Value
Constants ¶
const ( PublisherMetadata = "io.modelcontextprotocol.registry/publisher-provided" MaxDescriptorBytes = 1 << 20 )
Variables ¶
This section is empty.
Functions ¶
func BuildRecord ¶
func BuildRecord(app protocol.App, catalogEnv map[string]protocol.Input, descriptor *Descriptor) protocol.BuildRecord
func SelectPackage ¶
func SelectPackage(d *Descriptor, selection protocol.PackageSelection) (int, error)
SelectPackage returns the index of the one OCI, npm or PyPI package in d that matches selection, whose empty fields match any package.
func ValidateEndpoint ¶
Types ¶
type Descriptor ¶
type Descriptor struct {
Icons []wire.Icon `json:"icons,omitempty"`
Name string `json:"name"`
Title string `json:"title"`
Version string `json:"version"`
Description string `json:"description"`
WebsiteURL string `json:"websiteUrl"`
Repository struct {
URL string `json:"url"`
} `json:"repository"`
Remotes []Transport `json:"remotes"`
Packages []Package `json:"packages"`
Meta struct {
Publisher struct {
Holon json.RawMessage `json:"sh.holon"`
} `json:"io.modelcontextprotocol.registry/publisher-provided"`
} `json:"_meta"`
Requires map[string]Requirement `json:"-"`
Egress wire.Egress `json:"-"`
}
func Fetch ¶
func Fetch(ctx context.Context, httpClient *http.Client, ref protocol.RegistryRef) (*Descriptor, error)
func ParseDescriptor ¶
func ParseDescriptor(data []byte) (*Descriptor, error)
ParseDescriptor reads a server.json published by someone else, such as a registry record. It ignores sh.holon members this version doesn't know, because published versions are immutable and may come from a newer Holon.
func ParseLocalDescriptor ¶
func ParseLocalDescriptor(data []byte) (*Descriptor, error)
ParseLocalDescriptor reads a server.json the user maintains, rejecting unknown sh.holon members so that typos fail.
func (*Descriptor) Identity ¶
func (d *Descriptor) Identity() mcpcontract.Identity
func (*Descriptor) StreamableRemote ¶
func (d *Descriptor) StreamableRemote() string
StreamableRemote is the URL of the record's first streamable-http remote, or "" without one.
type DescriptorInput ¶
type DescriptorInput struct {
InputFields
Description string `json:"description"`
Name string `json:"name"`
Type string `json:"type"`
ValueHint string `json:"valueHint"`
Variables map[string]InputFields `json:"variables"`
}
func ParseInput ¶
func ParseInput(raw json.RawMessage) (DescriptorInput, wire.Input, map[string]wire.Input, error)
type HolonMetadata ¶
type HolonMetadata struct {
Requires map[string]Requirement `` /* 200-byte string literal not displayed */
Egress wire.Egress `` /* 137-byte string literal not displayed */
}
type InputFields ¶
type Package ¶
type Package struct {
Version string `json:"version"`
RegistryType string `json:"registryType"`
Identifier string `json:"identifier"`
Transport Transport `json:"transport"`
Environment []json.RawMessage `json:"environmentVariables"`
RuntimeArguments []json.RawMessage `json:"runtimeArguments"`
PackageArguments []json.RawMessage `json:"packageArguments"`
}
func (Package) ValidateTransport ¶
type Requirement ¶
type Requirement struct {
wire.RegistryRef
URL string `json:"url,omitempty"`
}
Requirement is one sh.holon.requires entry: empty, a published name and version, or a URL. In a project the dependency is the project's app of that name whatever the entry says.
func (Requirement) Validate ¶
func (r Requirement) Validate() error
type Transport ¶
type Transport struct {
Type string `json:"type"`
URL string `json:"url"`
Headers []DescriptorInput `json:"headers"`
Variables map[string]InputFields `json:"variables"`
}