registry

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package registry resolves a check target into a normalized MCP server descriptor. A target may be an official-registry server name (for example "io.github.owner/name"), a GitHub repository URL, or a remote endpoint URL. Every lookup is keyless: it reads the public MCP registry API and touches no user secret.

Index

Constants

View Source
const DefaultBaseURL = "https://registry.modelcontextprotocol.io/v0/servers"

DefaultBaseURL is the official, keyless MCP registry servers endpoint.

View Source
const DefaultUserAgent = "akashi (mcp health; keyless; +https://roninforge.org)"

DefaultUserAgent identifies akashi politely to the registry.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTP      *http.Client
	BaseURL   string
	UserAgent string
}

Client talks to the MCP registry over plain keyless HTTP.

func NewClient

func NewClient() *Client

NewClient returns a Client with sane defaults.

func (*Client) ByName

func (c *Client) ByName(ctx context.Context, name string) (*Server, error)

ByName looks up a single server by its exact registry name and returns the latest published version. The registry search is a substring match, so we filter to an exact name and isLatest==true, following the result cursor (up to maxByNamePages) in case the exact match is not on the first page.

func (*Client) Drain

func (c *Client) Drain(ctx context.Context, max int) ([]Server, error)

Drain pages the whole registry (latest version of each server, deduped by name) up to max entries. It is the population source for the scan/index command. max<=0 means "the whole registry".

func (*Client) Resolve

func (c *Client) Resolve(ctx context.Context, target string) (*Server, error)

Resolve turns a raw target string into a Server. It recognizes, in order: an http(s) GitHub repository URL, an http(s) remote endpoint URL, and otherwise a registry server name looked up via the registry API.

type Package

type Package struct {
	RegistryType string `json:"registryType"`
	Identifier   string `json:"identifier"`
	Version      string `json:"version,omitempty"`
	Transport    string `json:"transport,omitempty"`
}

Package is one installable entrypoint (npm, pypi, oci, ...).

type Remote

type Remote struct {
	Type string `json:"type,omitempty"`
	URL  string `json:"url"`
}

Remote is one hosted endpoint a server exposes.

type Repository

type Repository struct {
	URL    string `json:"url"`
	Source string `json:"source,omitempty"`
}

Repository points at a server's source.

type Server

type Server struct {
	Name           string      `json:"name"`
	Title          string      `json:"title,omitempty"`
	Version        string      `json:"version,omitempty"`
	Description    string      `json:"description,omitempty"`
	Repository     *Repository `json:"repository,omitempty"`
	Packages       []Package   `json:"packages,omitempty"`
	Remotes        []Remote    `json:"remotes,omitempty"`
	RegistryStatus string      `json:"registryStatus,omitempty"` // active|deprecated|deleted
	Origin         string      `json:"origin"`                   // registry|repo|remote
	// RawServer is the exact server.json object bytes as published, retained so
	// the probe can validate it against its declared JSON Schema. Only set for
	// registry-resolved servers.
	RawServer json.RawMessage `json:"-"`
}

Server is the normalized descriptor the probe engine consumes. Origin records how the target was resolved, which the report uses to decide which checks apply (a bare remote URL has no registry status to check, etc.).

Jump to

Keyboard shortcuts

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