registryapi

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CommunityRegistryBaseURL = "https://registry.modelcontextprotocol.io"

CommunityRegistryBaseURL is the base URL for the community MCP registry

Variables

This section is empty.

Functions

func BuildServerURL added in v0.39.0

func BuildServerURL(serverName, version string) string

BuildServerURL constructs the full registry URL for a server Format: https://registry.modelcontextprotocol.io/v0/servers/{encoded_name}/versions/{version}

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