mcp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 29 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 Open

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

Types

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
}

type Lease

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

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.

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