mcp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager connects to MCP servers and provides tool discovery and execution.

func NewManager

func NewManager(servers []config.MCPServerConfig) (*Manager, error)

NewManager connects to all configured MCP servers, resolves auth credentials, and discovers their tools. Auth failures abort startup.

func (*Manager) CallTool

func (m *Manager) CallTool(ctx context.Context, toolName string, input json.RawMessage) (string, error)

CallTool executes a tool on its MCP server and returns the text result.

func (*Manager) Close

func (m *Manager) Close()

Close is a no-op for HTTP-based MCP servers. Reserved for future SSE cleanup.

func (*Manager) Tools

func (m *Manager) Tools() []Tool

Tools returns the full list of discovered MCP tools.

type Tool

type Tool struct {
	// Name is prefixed: "<server_name>__<original_tool_name>"
	Name        string
	Description string
	InputSchema json.RawMessage
	ServerURL   string
	// OriginalName is the tool name as registered on the MCP server (without prefix).
	OriginalName string
}

Tool is the internal representation of a tool discovered from an MCP server.

Jump to

Keyboard shortcuts

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