Documentation
¶
Index ¶
- type Manager
- func (m *Manager) CallTool(ctx context.Context, serverName, toolName string, arguments map[string]any) (*mcp.CallToolResult, error)
- func (m *Manager) Close() error
- func (m *Manager) ConnectServer(ctx context.Context, name string, cfg config.MCPServerConfig) error
- func (m *Manager) GetAllTools() map[string][]*mcp.Tool
- func (m *Manager) GetServer(name string) (*ServerConnection, bool)
- func (m *Manager) GetServers() map[string]*ServerConnection
- func (m *Manager) LoadFromConfig(ctx context.Context, cfg *config.Config) error
- func (m *Manager) LoadFromMCPConfig(ctx context.Context, mcpCfg config.MCPConfig, workspacePath string) error
- type ServerConnection
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 multiple MCP server connections
func (*Manager) CallTool ¶
func (m *Manager) CallTool( ctx context.Context, serverName, toolName string, arguments map[string]any, ) (*mcp.CallToolResult, error)
CallTool calls a tool on a specific server
func (*Manager) ConnectServer ¶
func (m *Manager) ConnectServer( ctx context.Context, name string, cfg config.MCPServerConfig, ) error
ConnectServer connects to a single MCP server
func (*Manager) GetAllTools ¶
GetAllTools returns all tools from all connected servers
func (*Manager) GetServer ¶
func (m *Manager) GetServer(name string) (*ServerConnection, bool)
GetServer returns a specific server connection
func (*Manager) GetServers ¶
func (m *Manager) GetServers() map[string]*ServerConnection
GetServers returns all connected servers
func (*Manager) LoadFromConfig ¶
LoadFromConfig loads MCP servers from configuration
func (*Manager) LoadFromMCPConfig ¶
func (m *Manager) LoadFromMCPConfig( ctx context.Context, mcpCfg config.MCPConfig, workspacePath string, ) error
LoadFromMCPConfig loads MCP servers from MCP configuration and workspace path. This is the minimal dependency version that doesn't require the full Config object.
type ServerConnection ¶
type ServerConnection struct {
Name string
Client *mcp.Client
Session *mcp.ClientSession
Tools []*mcp.Tool
}
ServerConnection represents a connection to an MCP server
Click to show internal directories.
Click to hide internal directories.