mcpmanager

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mcpmanager owns application-lifetime MCP connections and leases immutable tool snapshots to conversation runtimes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lease

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

Lease is one conversation's immutable view of tools and server statuses.

func (*Lease) Close

func (lease *Lease) Close()

Close releases this lease without closing connections still used by another runtime or retained by the active manager generation.

func (*Lease) Statuses

func (lease *Lease) Statuses() []mcpclient.ServerStatus

Statuses returns an independent slice of secret-free diagnostics.

func (*Lease) Tools

func (lease *Lease) Tools() []mcpclient.Tool

Tools returns an independent slice of protocol-native tools.

type Manager

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

Manager loads one product-owned config and shares matching connections among conversation runtimes. Config generations are isolated so active runtimes retain their old connections while newly loaded runtimes use new settings.

func New

func New(ctx context.Context, path string) *Manager

New creates a manager and loads its initial configuration. Configuration errors are retained as lease diagnostics instead of preventing app startup.

func (*Manager) Acquire

func (manager *Manager) Acquire(ctx context.Context, workspace string) *Lease

Acquire waits for every applicable server in the current generation and returns one immutable snapshot. Individual server failures are represented in Statuses and never fail the whole lease.

func (*Manager) Close

func (manager *Manager) Close()

Close cancels initialization and closes every cached connection.

func (*Manager) Path

func (manager *Manager) Path() string

Path returns the private configuration file managed by this instance.

func (*Manager) Reload

func (manager *Manager) Reload() error

Reload installs the latest on-disk configuration as a new generation. Old connections remain alive until every lease using them has been released.

func (*Manager) Warm

func (manager *Manager) Warm(workspace string)

Warm starts resolving the servers visible to workspace without retaining a conversation lease. Connections from the active config generation remain cached for later sessions.

func (*Manager) WarmGlobal

func (manager *Manager) WarmGlobal()

WarmGlobal starts workspace-independent HTTP servers. It is safe during app startup before any project or scratch workspace has been selected.

Jump to

Keyboard shortcuts

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