Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AddServer(ctx context.Context, name string, cfg config.Server) error
- func (m *Manager) AllTools() []Tool
- func (m *Manager) Close()
- func (m *Manager) GetGraph() *graph.Graph
- func (m *Manager) GetServer(name string) (*Server, error)
- func (m *Manager) ListServerNames() []string
- func (m *Manager) RebuildGraph(graphCfg *config.SkillGraphConfig)
- func (m *Manager) ServerTools(name string) []Tool
- type ParamInfo
- type Server
- func (s *Server) CallTool(ctx context.Context, params *mcp.CallToolParams) (*mcp.CallToolResult, error)
- func (s *Server) Close() error
- func (s *Server) Instructions() string
- func (s *Server) ReadResource(ctx context.Context, params *mcp.ReadResourceParams) (*mcp.ReadResourceResult, error)
- func (s *Server) Resources() []*mcp.Resource
- func (s *Server) Tools() []*mcp.Tool
- type Tool
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
}
func NewManager ¶
func NewManager(ctx context.Context, cfgs map[string]config.Server, graphCfg *config.SkillGraphConfig) (*Manager, error)
NewManager creates a Manager by connecting to all servers in the config. Downstream connections happen in parallel so total startup is O(slowest server) instead of O(sum of servers) — important to stay under MCP client initialize timeouts (Claude Code's is 30s).
func NewManagerFromServers ¶
NewManagerFromServers creates a Manager from pre-built Servers (useful for testing).
func (*Manager) AddServer ¶
AddServer connects to a new downstream MCP server and hot-registers it into the manager without a restart. The graph is rebuilt atomically after the connection succeeds. Returns an error if the name is already registered.
func (*Manager) ListServerNames ¶
func (*Manager) RebuildGraph ¶
func (m *Manager) RebuildGraph(graphCfg *config.SkillGraphConfig)
RebuildGraph rebuilds the capability graph from scratch using the updated config and switches it atomically. This is thread-safe.
func (*Manager) ServerTools ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps a connected MCP client session to a downstream server.
func NewServer ¶
NewServer connects to a downstream MCP server and applies config options (description override, tool/resource allowlists).
func NewServerFromSession ¶
func NewServerFromSession(ctx context.Context, session *mcp.ClientSession, opts ...config.ServerOptions) (*Server, error)
NewServerFromSession creates a Server from a pre-built session and applies optional configuration (description override, tool/resource allowlists).
func (*Server) CallTool ¶
func (s *Server) CallTool(ctx context.Context, params *mcp.CallToolParams) (*mcp.CallToolResult, error)
func (*Server) Instructions ¶
func (*Server) ReadResource ¶
func (s *Server) ReadResource(ctx context.Context, params *mcp.ReadResourceParams) (*mcp.ReadResourceResult, error)