Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultMCPConnectionTimeout is the default timeout for connecting to MCP servers DefaultMCPConnectionTimeout = 120 * time.Second // DefaultMCPToolTimeout is the default timeout for executing MCP tool calls DefaultMCPToolTimeout = 120 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MCPClientWrapper ¶
type MCPClientWrapper struct {
// contains filtered or unexported fields
}
MCPClientWrapper wraps an MCP client connection
type MCPManager ¶
type MCPManager struct {
// contains filtered or unexported fields
}
MCPManager manages multiple MCP server connections
func (*MCPManager) ConnectToServerConfigs ¶
func (m *MCPManager) ConnectToServerConfigs(ctx context.Context, serverConfigs []ServerConfig, timeout time.Duration, existingErrors []error) ([]MCPServerConnection, []error)
ConnectToServerConfigs connects to multiple parsed MCP server configs in parallel
type MCPServerConnection ¶
type MCPServerConnection struct {
ServerName string
Tools []*llm.Tool
ToolNames []string // Original tool names without server prefix
}
MCPServerConnection represents a successful MCP server connection with its tools
type ServerConfig ¶
type ServerConfig struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"` // "stdio", "http", "sse"
URL string `json:"url,omitempty"` // for http/sse
Command string `json:"command,omitempty"` // for stdio
Args []string `json:"args,omitempty"` // for stdio
Env map[string]string `json:"env,omitempty"` // for stdio
Headers map[string]string `json:"headers,omitempty"` // for http/sse
}
ServerConfig represents the configuration for an MCP server
func ParseServerConfigs ¶
func ParseServerConfigs(ctx context.Context, configs []string) ([]ServerConfig, []error)
ParseServerConfigs parses JSON configuration strings into ServerConfig structs
Click to show internal directories.
Click to hide internal directories.