catalog

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package catalog provides a searchable registry of available MCP servers. Unlike the runtime registry (server.Registry), the catalog contains server definitions that can be discovered and installed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CapabilityCategories

func CapabilityCategories() map[string][]string

CapabilityCategories returns common capability categories for discovery.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is a searchable collection of server entries.

func Default

func Default() *Catalog

Default returns a catalog populated with well-known MCP servers. These are curated servers that are commonly used and well-tested.

func New

func New() *Catalog

New creates a new empty catalog.

func (*Catalog) Add

func (c *Catalog) Add(entry *Entry)

Add registers a server entry in the catalog.

func (*Catalog) Count

func (c *Catalog) Count() int

Count returns the number of entries in the catalog.

func (*Catalog) Get

func (c *Catalog) Get(name string) *Entry

Get retrieves a server entry by name.

func (*Catalog) List

func (c *Catalog) List() []*Entry

List returns all entries sorted by name.

func (*Catalog) Search

func (c *Catalog) Search(query, capability string) []*Entry

Search finds entries matching the query using BM25 scoring. If query is empty, all entries are returned sorted alphabetically. If capability is provided, only entries with that capability are returned.

type Entry

type Entry struct {
	// Name is the unique identifier for this server (e.g., "context7")
	Name string `json:"name" yaml:"name"`

	// Description is a human-readable description of the server's purpose
	Description string `json:"description" yaml:"description"`

	// Capabilities are tags describing what this server can do
	// (e.g., ["documentation", "code-search", "library-lookup"])
	Capabilities []string `json:"capabilities" yaml:"capabilities"`

	// Command is the executable to run (for stdio transport)
	Command string `json:"command,omitempty" yaml:"command,omitempty"`

	// Args are command-line arguments
	Args []string `json:"args,omitempty" yaml:"args,omitempty"`

	// EnvVars are required environment variables (names only, not values)
	EnvVars []string `json:"env_vars,omitempty" yaml:"env_vars,omitempty"`

	// URL is the upstream URL (for http/sse transport)
	URL string `json:"url,omitempty" yaml:"url,omitempty"`

	// Source is where to find more information (e.g., GitHub URL)
	Source string `json:"source,omitempty" yaml:"source,omitempty"`

	// Transport is "stdio", "http", or "sse" (default: stdio)
	Transport string `json:"transport,omitempty" yaml:"transport,omitempty"`

	// CodemodeNamespace is the OpenCode Code Mode namespace used to call the
	// server's tools (tools.<namespace>.*). It defaults to Name.
	CodemodeNamespace string `json:"codemode_namespace,omitempty" yaml:"codemode_namespace,omitempty"`
}

Entry represents an MCP server available for installation.

func (*Entry) GetCodemodeNamespace added in v1.3.2

func (e *Entry) GetCodemodeNamespace() string

GetCodemodeNamespace returns the configured OpenCode Code Mode namespace, defaulting to the catalog entry name for backward compatibility.

func (*Entry) GetTransport

func (e *Entry) GetTransport() string

GetTransport returns the transport type, defaulting to "stdio".

func (*Entry) HasCapability

func (e *Entry) HasCapability(cap string) bool

HasCapability checks if the entry has the given capability (case-insensitive).

Jump to

Keyboard shortcuts

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