mcp

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

func New(ctx context.Context, transport mcpsdk.Transport, opts ...Option) (*Executor, error)

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) Close

func (e *Executor) Close() error

Close closes the connection to the MCP server.

func (*Executor) Describe

func (e *Executor) Describe() []runtime.ToolDescriptor

Describe returns metadata for all tools exposed by the MCP server.

func (*Executor) Execute

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL