Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AdoptFrom(source *Manager)
- func (m *Manager) Close() error
- func (m *Manager) Execute(ctx context.Context, call llm.ToolCall) (string, error)
- func (m *Manager) RegisterServer(ctx context.Context, name, command string, args []string, ...) error
- func (m *Manager) RegisterSession(ctx context.Context, name string, session *mcp.ClientSession) error
- func (m *Manager) ToolDefs() []llm.ToolDef
- func (m *Manager) ToolNames() []string
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 manages MCP tool server connections and tool execution.
func NewManager ¶
NewManager creates a manager with no servers registered.
func (*Manager) AdoptFrom ¶
AdoptFrom copies all registered tool connections from source into m. Both managers then share the same underlying *mcp.ClientSession pointers, which is safe for concurrent use. Use this to give per-agent managers access to shared external MCP servers without re-spawning subprocesses.
func (*Manager) RegisterServer ¶
func (m *Manager) RegisterServer(ctx context.Context, name, command string, args []string, env map[string]string) error
RegisterServer spawns an MCP server subprocess, connects to it over stdio, and discovers its available tools.
func (*Manager) RegisterSession ¶
func (m *Manager) RegisterSession(ctx context.Context, name string, session *mcp.ClientSession) error
RegisterSession registers an already-connected MCP client session without spawning a subprocess. Use this for in-process servers (e.g. configmcp).