Documentation
¶
Overview ¶
Package mcp provides a ToolExecutor that connects to an MCP server and exposes its tools. It wraps the official MCP SDK, translating server tool definitions to LoopKit ToolDescriptors and tool calls to MCP CallTool requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes tools exposed by an MCP server via the official SDK.
func New ¶
New connects to an MCP server via the given transport and creates an Executor. The executor caches the list of available tools at creation time.
func (*Executor) Describe ¶
func (e *Executor) Describe() []runtime.ToolDescriptor
Describe returns metadata for all tools exposed by the MCP server.
func (*Executor) Execute ¶
func (e *Executor) Execute(ctx context.Context, call runtime.ToolRequest) (runtime.ToolResult, error)
Execute calls a tool on the MCP server. Tool errors (IsError=true from MCP) are converted to ToolResult with IsError=true; infrastructure errors return a Go error.
type Option ¶
type Option func(*executorOpts)
Option is a functional option for configuring an Executor.
func WithToolMeta ¶
func WithToolMeta(toolName string, semantics action.ReplaySemantics, caps []string) Option
WithToolMeta sets override semantics and capabilities for a specific tool by name. If the tool is not found during Describe(), the override is ignored.