mcp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 11 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 {
	MCPServers map[string]ServerConfig `json:"mcpServers"`
}

func (*Config) ExpandEnv

func (c *Config) ExpandEnv()

ExpandEnv recursively applies os.ExpandEnv to all string values within the Config.

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) RegisterServers

func (m *Manager) RegisterServers(ctx context.Context, config Config, register func(llm.ToolDef, func(context.Context, llm.ToolCall) (string, error))) error

type ServerConfig

type ServerConfig struct {
	// For Stdio servers
	Command string            `json:"command,omitempty"`
	Args    []string          `json:"args,omitempty"`
	Env     map[string]string `json:"env,omitempty"`

	// For HTTP/SSE network servers
	URL     string            `json:"url,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`

	// TimeoutSeconds is the maximum duration in seconds for an MCP tool call.
	// Defaults to 30 seconds if not specified.
	TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
}

Jump to

Keyboard shortcuts

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