mcp

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package mcp owns lifecycle-aware native ADK toolsets over the first-party MCP SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager is a native ADK toolset and the sole owner of MCP client sessions, transports, child processes, HTTP clients, and active-call cancellation.

func New

func New(options Options) (*Manager, error)

New constructs an inert manager. No server is contacted until Tools is called.

func (*Manager) Close

func (m *Manager) Close() (returnErr error)

Close cancels calls before closing every session and transport. It is idempotent.

func (*Manager) DropSession

func (m *Manager) DropSession(ctx context.Context, sessionID string) error

DropSession closes and forgets every transport owned by one durable session before that session's extension catalog is refreshed.

func (*Manager) Format

func (*Manager) Format(state fmt.State, _ rune)

Format prevents secret-bearing transport configuration from appearing in diagnostic formatting.

func (*Manager) LogValue

func (*Manager) LogValue() slog.Value

LogValue prevents structured logging from reflecting transport internals.

func (*Manager) Name

func (*Manager) Name() string

Name implements native ADK tool.Toolset.

func (*Manager) Tools

func (m *Manager) Tools(ctx agent.ReadonlyContext) ([]tool.Tool, error)

Tools lazily connects only exact consent-gated servers for this session.

type Options

type Options struct {
	Catalogs                *extensions.Store
	WorkingDir              string
	Warnings                warning.Warner
	FailureLimit            int
	ConnectTimeout          time.Duration
	ListTimeout             time.Duration
	CloseGrace              time.Duration
	MaxToolPages            int
	MaxTools                int
	MaxToolSchemaBytes      int
	MaxToolDescriptionBytes int
	MaxToolMetadataBytes    int
	MaxResultItems          int
	MaxMessageBytes         int
	Output                  outputlimit.Policy
	Budget                  *outputlimit.Budget
}

Options configures one Harness-owned MCP manager.

Jump to

Keyboard shortcuts

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