mcptoolset

package
v0.0.0-...-8c5cae0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 14 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 []ServerConfig
	// CacheTTL controls tool list cache ttl. <=0 means no ttl expiration.
	CacheTTL time.Duration
}

Config configures one MCP tool manager.

type Manager

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

Manager maintains MCP sessions and exposes MCP tools as kernel tools.

func NewManager

func NewManager(cfg Config) (*Manager, error)

NewManager creates a manager from config.

func (*Manager) Close

func (m *Manager) Close() error

Close closes all open MCP sessions.

func (*Manager) Tools

func (m *Manager) Tools(ctx context.Context) ([]tool.Tool, error)

Tools returns MCP tools converted to kernel tools.

type ServerConfig

type ServerConfig struct {
	Name string
	// Prefix is used to namespace exposed tool names. If empty, Name is used.
	Prefix string

	Transport TransportType

	// Stdio transport.
	Command string
	Args    []string
	Env     map[string]string
	WorkDir string

	// HTTP transport (sse/streamable).
	URL string

	// Optional allowlist for original MCP tool names.
	IncludeTools []string

	// CallTimeout controls per-tool call timeout.
	CallTimeout time.Duration
}

ServerConfig configures one MCP server endpoint.

type TransportType

type TransportType string

TransportType is MCP transport type.

const (
	TransportStdio      TransportType = "stdio"
	TransportSSE        TransportType = "sse"
	TransportStreamable TransportType = "streamable"
)

Jump to

Keyboard shortcuts

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