Documentation
¶
Index ¶
- Variables
- func CloseGlobalManager() error
- func GetAgentMCPServers(cfg *config.Config, agentName string) ([]string, error)
- func GetServerConfig(cfg *config.Config, serverName string) (*config.MCPServer, error)
- func InitializeGlobalManager(ctx context.Context, cfg *config.Config) error
- func IsConfigError(err error) bool
- func IsConnectionError(err error) bool
- func ValidateConfig(cfg *config.Config) error
- type Client
- type MCPError
- type Manager
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMCPNotInitialized MCP manager not initialized ErrMCPNotInitialized = errors.New("MCP manager not initialized") // ErrServerNotFound MCP server not found ErrServerNotFound = errors.New("MCP server not found") // ErrToolNotFound MCP tool not found ErrToolNotFound = errors.New("MCP tool not found") // ErrInvalidConfig Invalid MCP configuration ErrInvalidConfig = errors.New("Invalid MCP configuration") // ErrConnectionFailed MCP connection failed ErrConnectionFailed = errors.New("MCP connection failed") )
MCP related error definitions
Functions ¶
func CloseGlobalManager ¶
func CloseGlobalManager() error
CloseGlobalManager closes the global MCP manager
func GetAgentMCPServers ¶
GetAgentMCPServers gets MCP server list for specified agent
func GetServerConfig ¶
GetServerConfig gets configuration for specified server
func InitializeGlobalManager ¶
InitializeGlobalManager initializes the global MCP manager
func IsConfigError ¶
IsConfigError checks if it's a configuration error
func IsConnectionError ¶
IsConnectionError checks if it's a connection error
func ValidateConfig ¶
ValidateConfig validates MCP configuration
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client MCP client structure
func (*Client) GetTools ¶
func (c *Client) GetTools() map[string]tool.InvokableTool
GetTools gets all available MCP tools
func (*Client) GetToolsForServers ¶
func (c *Client) GetToolsForServers(serverNames []string) map[string]tool.InvokableTool
GetToolsForServers gets tools from specified MCP servers
type MCPError ¶
type MCPError struct {
Op string // Operation name
Server string // Server name
Tool string // Tool name
Err error // Original error
}
MCPError MCP error wrapper
func NewMCPError ¶
NewMCPError creates new MCP error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager MCP manager, responsible for managing all MCP clients and tools
func GetGlobalManager ¶
func GetGlobalManager() *Manager
GetGlobalManager gets the global MCP manager
func (*Manager) GetAllTools ¶
func (m *Manager) GetAllTools() map[string]tool.InvokableTool
GetAllTools gets all MCP tools
func (*Manager) GetToolsForAgent ¶
func (m *Manager) GetToolsForAgent(agentName string) ([]tool.InvokableTool, error)
GetToolsForAgent gets MCP tools for specified agent