mcpregistry

package
v0.0.1-dev.68 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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

func MergeInputs(env, inputs map[string]protocol.Input) error

MergeInputs adds inputs to env, failing on a conflicting redeclaration.

func ValidateEndpoint

func ValidateEndpoint(location string) error

func Variables

func Variables(template string, declared map[string]InputFields, required bool) (map[string]wire.Input, error)

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 (DescriptorInput) Parse

func (spec DescriptorInput) Parse() (wire.Input, map[string]wire.Input, error)

type HolonMetadata

type HolonMetadata struct {
	Requires map[string]Requirement `` /* 315-byte string literal not displayed */

	Egress wire.Egress `` /* 137-byte string literal not displayed */
}

type InputFields

type InputFields wire.Input

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.

func (Package) App

func (p Package) App(values map[string]Value, run RunConfig) (protocol.App, error)

func (Package) Port

func (p Package) Port() (int, error)

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.

func (Requirement) Validate

func (r Requirement) Validate() error

type RunConfig

type RunConfig struct {
	Args []string
	Env  map[string]Value
}

type Transport

type Transport struct {
	Type      string                 `json:"type"`
	URL       string                 `json:"url"`
	Headers   []DescriptorInput      `json:"headers"`
	Variables map[string]InputFields `json:"variables"`
}

type Value

type Value struct {
	Value  *string `json:"-"`
	Secret string  `json:"secret,omitempty" minLength:"1" pattern:"^[A-Za-z_][A-Za-z0-9_]*$" required:"true"`
}

func (*Value) UnmarshalJSON

func (a *Value) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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