Documentation
¶
Index ¶
- func MCPDisabled(name string) bool
- func SetMCPDisabled(name string, disabled bool)
- type CommandTool
- type LoadResult
- type MCPManager
- func (m *MCPManager) ClearPendingOAuth()
- func (m *MCPManager) Close() error
- func (m *MCPManager) ConnectAll(ctx context.Context) []string
- func (m *MCPManager) Disconnect(name string) bool
- func (m *MCPManager) GetPrompt(ctx context.Context, server, name string, args map[string]interface{}) (*tool.MCPPromptResult, error)
- func (m *MCPManager) Install(ctx context.Context, server config.MCPServerConfig) error
- func (m *MCPManager) PendingOAuth() *MCPOAuthRequiredError
- func (m *MCPManager) ReadResource(ctx context.Context, server, uri string) (*tool.MCPResourceResult, error)
- func (m *MCPManager) Reconnect(name string) bool
- func (m *MCPManager) Retry(name string) bool
- func (m *MCPManager) SetOnUpdate(fn func([]MCPServerInfo))
- func (m *MCPManager) SetURLOpener(fn func(string) error)
- func (m *MCPManager) Snapshot() []MCPServerInfo
- func (m *MCPManager) SnapshotMCP() []tool.MCPServerSnapshot
- func (m *MCPManager) StartBackground(ctx context.Context)
- func (m *MCPManager) Uninstall(name string) bool
- type MCPOAuthRequiredError
- type MCPPlugin
- func (m *MCPPlugin) Adapter() *mcp.Adapter
- func (m *MCPPlugin) Close() error
- func (m *MCPPlugin) Connect(ctx context.Context) (*mcp.Adapter, error)
- func (m *MCPPlugin) GetPrompt(ctx context.Context, name string, args map[string]interface{}) (*mcp.GetPromptResult, error)
- func (m *MCPPlugin) Info() MCPServerInfo
- func (m *MCPPlugin) Init(cfg map[string]interface{}) error
- func (m *MCPPlugin) IsConnected() bool
- func (m *MCPPlugin) LastError() string
- func (m *MCPPlugin) Name() string
- func (m *MCPPlugin) ReadResource(ctx context.Context, uri string) (*mcp.ReadResourceResult, error)
- func (m *MCPPlugin) RegisterTools(ctx context.Context, registry *tool.Registry) error
- func (m *MCPPlugin) Status() MCPStatus
- func (m *MCPPlugin) Tools() []tool.Tool
- type MCPServerInfo
- type MCPStatus
- type Manager
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MCPDisabled ¶ added in v1.1.34
MCPDisabled returns whether the named MCP server is disabled.
func SetMCPDisabled ¶ added in v1.1.34
SetMCPDisabled persists the enabled/disabled state for an MCP server.
Types ¶
type CommandTool ¶
type CommandTool struct {
// contains filtered or unexported fields
}
CommandTool wraps an external command as a tool.Tool.
func NewCommandTool ¶
func NewCommandTool(name, description, execute string, args []string) *CommandTool
NewCommandTool creates a tool that runs an external command.
func (*CommandTool) Description ¶
func (c *CommandTool) Description() string
func (*CommandTool) Execute ¶
func (c *CommandTool) Execute(ctx context.Context, input json.RawMessage) (tool.Result, error)
func (*CommandTool) Name ¶
func (c *CommandTool) Name() string
func (*CommandTool) Parameters ¶
func (c *CommandTool) Parameters() json.RawMessage
type LoadResult ¶
LoadResult describes the outcome of loading a single plugin.
type MCPManager ¶
type MCPManager struct {
// contains filtered or unexported fields
}
func NewMCPManager ¶
func NewMCPManager(servers []config.MCPServerConfig, registry *tool.Registry) *MCPManager
func (*MCPManager) ClearPendingOAuth ¶ added in v1.1.34
func (m *MCPManager) ClearPendingOAuth()
func (*MCPManager) Close ¶
func (m *MCPManager) Close() error
func (*MCPManager) ConnectAll ¶
func (m *MCPManager) ConnectAll(ctx context.Context) []string
func (*MCPManager) Disconnect ¶ added in v1.1.34
func (m *MCPManager) Disconnect(name string) bool
Disconnect closes the MCP server connection and unregisters its tools, but keeps the plugin in the list so it can be reconnected later. Runs asynchronously to avoid blocking the caller.
func (*MCPManager) GetPrompt ¶
func (m *MCPManager) GetPrompt(ctx context.Context, server, name string, args map[string]interface{}) (*tool.MCPPromptResult, error)
func (*MCPManager) Install ¶
func (m *MCPManager) Install(ctx context.Context, server config.MCPServerConfig) error
func (*MCPManager) PendingOAuth ¶ added in v1.1.34
func (m *MCPManager) PendingOAuth() *MCPOAuthRequiredError
func (*MCPManager) ReadResource ¶
func (m *MCPManager) ReadResource(ctx context.Context, server, uri string) (*tool.MCPResourceResult, error)
func (*MCPManager) Reconnect ¶ added in v1.1.34
func (m *MCPManager) Reconnect(name string) bool
Reconnect reconnects a previously disconnected MCP server.
func (*MCPManager) Retry ¶
func (m *MCPManager) Retry(name string) bool
func (*MCPManager) SetOnUpdate ¶
func (m *MCPManager) SetOnUpdate(fn func([]MCPServerInfo))
func (*MCPManager) SetURLOpener ¶ added in v1.1.34
func (m *MCPManager) SetURLOpener(fn func(string) error)
func (*MCPManager) Snapshot ¶
func (m *MCPManager) Snapshot() []MCPServerInfo
func (*MCPManager) SnapshotMCP ¶
func (m *MCPManager) SnapshotMCP() []tool.MCPServerSnapshot
func (*MCPManager) StartBackground ¶
func (m *MCPManager) StartBackground(ctx context.Context)
func (*MCPManager) Uninstall ¶
func (m *MCPManager) Uninstall(name string) bool
type MCPOAuthRequiredError ¶ added in v1.1.34
type MCPOAuthRequiredError struct {
ServerName string
Handler *mcp.OAuthHandler
}
MCPOAuthRequiredError signals that OAuth is needed for an MCP server.
func (*MCPOAuthRequiredError) Error ¶ added in v1.1.34
func (e *MCPOAuthRequiredError) Error() string
type MCPPlugin ¶
type MCPPlugin struct {
// contains filtered or unexported fields
}
MCPPlugin connects to an MCP server and registers its tools.
func NewMCPPlugin ¶
func NewMCPPlugin(cfg config.MCPServerConfig) *MCPPlugin
NewMCPPlugin creates a plugin from an MCP server configuration.
func (*MCPPlugin) Connect ¶
Connect initializes the MCP server, discovers tools, and returns an adapter.
func (*MCPPlugin) Info ¶
func (m *MCPPlugin) Info() MCPServerInfo
func (*MCPPlugin) IsConnected ¶
IsConnected returns whether the MCP server has been successfully contacted.
func (*MCPPlugin) ReadResource ¶
func (*MCPPlugin) RegisterTools ¶
RegisterTools discovers MCP tools and registers them into the registry.
type MCPServerInfo ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles loading, initializing, and tracking plugins.
func (*Manager) LoadAll ¶
func (m *Manager) LoadAll(entries []config.PluginConfigEntry)
LoadAll loads plugins from config entries and the default plugin directory. Individual failures are recorded but do not block startup.
func (*Manager) RegisterTools ¶
RegisterTools registers all plugin tools into the given registry.
func (*Manager) Results ¶
func (m *Manager) Results() []LoadResult
Results returns the load results for all plugins (including failures).
type Plugin ¶
type Plugin interface {
// Name returns a unique identifier for this plugin.
Name() string
// Tools returns the list of tools this plugin provides.
Tools() []tool.Tool
// Init initializes the plugin with optional configuration.
// Called once after loading, before tools are registered.
Init(config map[string]interface{}) error
}
Plugin is the interface that external tool plugins must implement. Plugins provide one or more tools that get registered in the tool registry.