mcp

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 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

This section is empty.

Variables

This section is empty.

Functions

func Alias

func Alias(packageName, server, tool string) string

func AliasDisplay

func AliasDisplay(alias string) (protocol.ToolDisplay, bool)

AliasDisplay shows a call recorded before listed tools carried a display, as Display shows the tool. A label holds every name when it was not cut: the split whose names give the alias's own digest is the tool's. A cut label is read by a package that repeats its server's name, as mcp_github_github_actions_list_<digest> reads "mcp_github actions_list", when exactly one such repeat starts it. Any other label stays as recorded.

func Display

func Display(server, tool string) protocol.ToolDisplay

Display is how a call of a listed tool without a declared display is shown: by its server and tool name, not by its alias, under the tool icon that both the Desktop and the mobile app bundle.

func Open

func Open(ctx context.Context, launch Launch, elicit func(context.Context, *sdk.ElicitRequest) (*sdk.ElicitResult, error)) (*sdk.ClientSession, error)

Types

type AuthorityKey

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

AuthorityKey identifies the destination and authorization without retaining the lease or exposing its credentials.

type Change

type Change struct{ User, Package string }

Change identifies one user installation whose runtime changed.

type Configuration

type Configuration struct {
	User          string
	Package       protocol.PluginReference
	Server        string
	Launch        Launch
	Authorization any
	Options       protocol.PluginMcpOptions
	Tools         *[]string
	Validate      func(context.Context) error
	Release       func() error
}

type Elicit

type Launch

type Launch struct {
	Kind           string
	Command        string
	Args           []string
	Env            map[string]string
	Directory      string
	URL            string
	Headers        map[string]string
	OAuth          auth.OAuthHandler
	Client         *http.Client
	Environment    []string
	OnToolsChanged func()
}

type Lease

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

func (*Lease) AuthorityKey

func (lease *Lease) AuthorityKey() AuthorityKey

func (*Lease) Call

func (lease *Lease) Call(ctx context.Context, name string, arguments map[string]any, readOnly bool, handler Elicit) (*sdk.CallToolResult, error)

func (*Lease) Close

func (lease *Lease) Close() error

func (*Lease) List

func (lease *Lease) List(ctx context.Context) ([]*sdk.Tool, error)

List reads the server's tools. Its outcome is what the server reports as its runtime, except for a caller that gave up.

func (*Lease) ListCached

func (lease *Lease) ListCached(ctx context.Context) ([]*sdk.Tool, error)

ListCached returns cached tool descriptors on an already-inspected healthy connection before falling back to a wire ListTools call.

type Options

type Options struct {
	Clock clockwork.Clock
	// Warm asks the pool's owner to connect the reusable servers of the
	// current packages ahead of their first use.
	Warm bool
	Open func(context.Context, Launch, func(context.Context, *sdk.ElicitRequest) (*sdk.ElicitResult, error)) (*sdk.ClientSession, error)
}

type Pool

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

func New

func New(ctx context.Context, options Options) *Pool

func (*Pool) Acquire

func (pool *Pool) Acquire(ctx context.Context, config Configuration) (result *Lease, resultErr error)

func (*Pool) Changed

func (pool *Pool) Changed() <-chan struct{}

Changed wakes when a server's runtime differs from the one last reported.

func (*Pool) Changes

func (pool *Pool) Changes() []string

Changes takes package names for owners that do not use user namespaces.

func (*Pool) Close

func (pool *Pool) Close() error

func (*Pool) Expire

func (pool *Pool) Expire() error

func (*Pool) FinishInventory

func (pool *Pool) FinishInventory(user string)

func (*Pool) Invalidate

func (pool *Pool) Invalidate(packageName, user string) error

func (*Pool) Observe

func (pool *Pool) Observe(summary protocol.PluginSummary, user string) error

func (*Pool) ScopedChanges

func (pool *Pool) ScopedChanges() []Change

ScopedChanges drains runtime changes with their owning user.

func (*Pool) Status

func (pool *Pool) Status(reference protocol.PluginReference, server, user string) *protocol.PluginMcpRuntime

Jump to

Keyboard shortcuts

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