Documentation
¶
Overview ¶
Package mcptools connects explicitly configured local MCP servers.
Index ¶
Constants ¶
const ( ListResourcesTool = "list_mcp_resources" ReadResourceTool = "read_mcp_resource" )
The read-only resource tools, offered when some server has a resources allowlist.
const MaxImagesPerResult = 8
MaxImagesPerResult caps how many images one MCP result may pass through; later images get an omission marker.
const MaxServers = maxServers
MaxServers is the most MCP servers one run may start, counting configured and plugin servers together.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Registry ¶
type Registry struct {
Specs []model.ToolSpec
// Log, when set, gets one line per read_mcp_resource call (-v).
Log io.Writer
// contains filtered or unexported fields
}
func Start ¶
func Start(ctx context.Context, root string, cfg []config.MCPServer, stderr io.Writer) (*Registry, error)
Start validates and connects all configured servers, building a fixed catalog.
func (*Registry) Call ¶
Call executes only a catalogued tool, preserving the original JSON values. ok is false when name is not catalogued; isErr marks a failed call.
func (*Registry) CallImages ¶ added in v0.5.0
func (r *Registry) CallImages(maxImageBytes int) func(ctx context.Context, name, raw string) (string, []model.Image, bool, bool)
CallImages is Call with image pass-through (--images): each PNG, JPEG, GIF, or WebP image of at most maxImageBytes is returned as an image, and the text gets its placeholder in the image's position. Other images get a specific omission marker.