mcpClient

package
v0.0.0-...-d72bd73 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPManager

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

MCPManager holds multiple MCP sessions and routes tool calls to the correct server based on tool name.

func ConnectMCP

func ConnectMCP(ctx context.Context, agentName string) (*MCPManager, error)

ConnectMCP connects to all configured MCP servers over HTTP.

Jira: JIRA_MCP_URL → Streamable HTTP transport

Environment variables for Jira (must be configured on the MCP server side):

JIRA_URL, JIRA_USERNAME, JIRA_TOKEN

func NewMCPManager

func NewMCPManager() *MCPManager

NewMCPManager creates a bare MCPManager with no sessions, useful when only native tools are needed.

func (*MCPManager) CallTool

func (manager *MCPManager) CallTool(ctx context.Context, name, argsJSON string) (string, error)

CallTool forwards a tool call to the MCP server or native handler that owns the tool.

func (*MCPManager) Close

func (manager *MCPManager) Close()

Close closes all managed MCP sessions.

func (*MCPManager) DiscoverTools

func (manager *MCPManager) DiscoverTools(ctx context.Context) ([]llms.Tool, error)

DiscoverTools lists all tools from every connected MCP server and converts them to langchaingo tool definitions that Claude can call.

func (*MCPManager) RegisterNativeTool

func (manager *MCPManager) RegisterNativeTool(tool llms.Tool, handler NativeToolHandler)

RegisterNativeTool registers a Go-native tool handler with its langchaingo tool definition so it can be discovered and called alongside MCP tools.

type NativeToolHandler

type NativeToolHandler func(ctx context.Context, argsJSON string) (string, error)

NativeToolHandler is a function that handles a tool call directly in Go, without going through an MCP server.

Jump to

Keyboard shortcuts

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