client

package
v0.0.0-...-868bcbb Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package client provides functionality for interacting with MCP (Model-Context Protocol) servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clients

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

Clients manages a collection of MCP clients and their associated tools.

func New

func New() *Clients

New creates a new Clients instance.

func (*Clients) CallTool

func (c *Clients) CallTool(ctx context.Context, name string, args map[string]any) (string, error)

CallTool calls a tool with the given name and arguments.

func (Clients) Clone

func (c Clients) Clone() *Clients

Clone creates a new Clients instance with the same tools and clients.

func (*Clients) Close

func (c *Clients) Close() error

Close closes all unique MCP clients.

func (*Clients) GetToolClient

func (c *Clients) GetToolClient(toolName string) *client.Client

GetToolClient returns the MCP client for a given tool.

func (*Clients) GetTools

func (c *Clients) GetTools() []llms.Tool

GetTools returns the list of available tools.

func (*Clients) RegisterClient

func (c *Clients) RegisterClient(ctx context.Context, sc *client.Client, name string, initializeTimeoutSeconds *int) error

RegisterClient registers a new MCP client.

func (*Clients) RegisterServer

func (c *Clients) RegisterServer(ctx context.Context, mcpServer *server.MCPServer, name string) error

RegisterServer registers a new MCP server.

func (*Clients) RegisterServersConfig

func (c *Clients) RegisterServersConfig(ctx context.Context, mcpServers config.MCPServers) error

RegisterServersConfig registers MCP servers from the provided configuration.

Jump to

Keyboard shortcuts

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