Documentation
¶
Index ¶
- Constants
- func BuildRecord(app protocol.App, catalogEnv map[string]protocol.Input, descriptor *Descriptor) protocol.BuildRecord
- func MergeInputs(env, inputs map[string]protocol.Input) 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 MergeInputs ¶
MergeInputs adds inputs to env, failing on a conflicting redeclaration.
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:"-"`
MayAct []string `json:"-"`
Egress wire.Egress `json:"-"`
Reach wire.Reach `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) Declare ¶
func (d *Descriptor) Declare(runtime *wire.BuildRuntime)
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"`
}
type HolonMetadata ¶
type InputFields ¶
type Package ¶
type Package struct {
Version string `json:"version"`
RegistryType string `json:"registryType"`
RegistryBaseURL string `json:"registryBaseUrl"`
Identifier string `json:"identifier"`
Transport Transport `json:"transport"`
Environment []DescriptorInput `json:"environmentVariables"`
RuntimeArguments []DescriptorInput `json:"runtimeArguments"`
PackageArguments []DescriptorInput `json:"packageArguments"`
}
func SelectPackage ¶
func SelectPackage(d *Descriptor, selection protocol.PackageSelection) (Package, error)
SelectPackage returns the one OCI, npm or PyPI package in d that matches selection, whose empty fields match any package.
type Requirement ¶
type Requirement struct {
wire.RegistryRef
URL string `json:"url,omitempty"`
MayAct bool `json:"mayAct,omitempty"`
}
Requirement is one sh.holon.requires entry: empty, a published name and version, or a URL.
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"`
}