mcp

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mcp integrates Model Context Protocol servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides access to MCP server discovery and tool execution.

func New

func New(cfg *config.Config) *Service

New creates a new MCP service.

func (*Service) CallTool

func (s *Service) CallTool(ctx context.Context, fullName string, data []byte) (string, error)

CallTool executes a tool call against the configured server. fullName must be of the form: <server>_<tool>.

func (*Service) EnabledServers

func (s *Service) EnabledServers() iter.Seq2[string, config.MCPServerConfig]

EnabledServers iterates enabled MCP servers in stable order.

func (*Service) IsEnabled

func (s *Service) IsEnabled(name string) bool

IsEnabled reports whether the named MCP server is enabled.

func (*Service) Tools

func (s *Service) Tools(ctx context.Context) (map[string][]mcp.Tool, error)

Tools returns tools grouped by server name.

Jump to

Keyboard shortcuts

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