registryapi

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetServer(ctx context.Context, url *ServerURL) (registryapi.ServerResponse, error)
	GetServerVersions(ctx context.Context, url *ServerURL) (registryapi.ServerListResponse, error)
}

func NewClient

func NewClient() Client

type ServerURL

type ServerURL struct {
	// BaseURL is the host plus anything before the API version (e.g., "https://registry.modelcontextprotocol.io")
	BaseURL string
	// APIVersion is the API version (e.g., "v0")
	APIVersion string
	// ServerName is the URL-encoded server name (e.g., "ai.aliengiraffe%2Fspotdb")
	ServerName string
	// Version (e.g., "latest", "0.1.0") - defaults to "latest" if not set
	Version string
	// RawURL is the original URL that was parsed
	RawURL string
}

ServerURL represents a parsed MCP registry URL

func ParseServerURL

func ParseServerURL(rawURL string) (*ServerURL, error)

ParseServerURL parses an MCP registry URL into its components

func (*ServerURL) IsLatestVersion

func (r *ServerURL) IsLatestVersion() bool

func (*ServerURL) LatestVersionURL

func (r *ServerURL) LatestVersionURL() string

LatestVersionURL returns the URL for the latest version endpoint

func (*ServerURL) Raw

func (r *ServerURL) Raw() string

func (*ServerURL) String

func (r *ServerURL) String() string

String returns the full URL

func (*ServerURL) VersionsListURL

func (r *ServerURL) VersionsListURL() string

VersionsListURL returns the URL for the versions list endpoint

func (*ServerURL) WithVersion

func (r *ServerURL) WithVersion(version string) *ServerURL

Jump to

Keyboard shortcuts

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