mcp

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers map[string]ServerConfig `json:"mcpServers"`
}

type ElicitFunc added in v0.10.1

type ElicitFunc func(ctx context.Context, req tool.ElicitRequest) (tool.ElicitResult, error)

type Manager

type Manager struct {
	*Config

	Dir string
	// contains filtered or unexported fields
}

func Load

func Load(paths ...string) (*Manager, error)

func NewManager

func NewManager(cfg *Config) *Manager

func (*Manager) AddServer

func (m *Manager) AddServer(ctx context.Context, name string, server ServerConfig) error

func (*Manager) AddSession

func (m *Manager) AddSession(name string, session *mcp.ClientSession)

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Connect

func (m *Manager) Connect(ctx context.Context) error

func (*Manager) Sessions

func (m *Manager) Sessions() map[string]*mcp.ClientSession

func (*Manager) SetElicit added in v0.10.1

func (m *Manager) SetElicit(fn ElicitFunc)

SetElicit routes elicitation/create requests from connected MCP servers to the given UI surface. A nil handler declines all requests.

type ServerConfig

type ServerConfig struct {
	Transport string `json:"transport,omitempty"`

	URL string `json:"url,omitempty"`

	Command string   `json:"command,omitempty"`
	Args    []string `json:"args,omitempty"`

	Headers map[string]string `json:"headers,omitempty"`
}

Jump to

Keyboard shortcuts

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