mcpclient

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPClient

type MCPClient struct {
	Endpoint string            `json:"-"`
	Headers  map[string]string `json:"-"`

	Client                *client.Client `json:"-"`
	Tools                 []mcp.Tool     `json:"-"`
	Meta                  *mcp.Meta      `json:"-"`
	ToolFilter            []string       `json:"-"`
	ApprovalRequiredTools []string       `json:"-"`
}

func NewInProcessMCPServer

func NewInProcessMCPServer(ctx context.Context, client *client.Client, headers map[string]any) (*MCPClient, error)

func NewSSEClient

func NewSSEClient(ctx context.Context, endpoint string, options ...McpServerOption) (*MCPClient, error)

func (*MCPClient) GetClient

func (srv *MCPClient) GetClient(ctx context.Context, runContext map[string]any) (*MCPClient, error)

func (*MCPClient) GetName added in v0.1.11

func (srv *MCPClient) GetName() string

func (*MCPClient) GetTools

func (srv *MCPClient) GetTools(opts ...McpServerOption) []core.Tool

func (*MCPClient) ListTools added in v0.1.11

func (srv *MCPClient) ListTools(ctx context.Context, runContext map[string]any) ([]core.Tool, error)

type McpServerOption

type McpServerOption func(*MCPClient)

func WithApprovalRequiredTools

func WithApprovalRequiredTools(tools ...string) McpServerOption

func WithHeaders

func WithHeaders(headers map[string]string) McpServerOption

func WithToolFilter

func WithToolFilter(toolFilter ...string) McpServerOption

type McpTool

type McpTool struct {
	*core.BaseTool
	Client *client.Client `json:"-"`
	Meta   *mcp.Meta      `json:"-"`
}

func NewMcpTool

func NewMcpTool(t mcp.Tool, cli *client.Client, Meta *mcp.Meta, requiresApproval bool) *McpTool

Jump to

Keyboard shortcuts

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