mcp

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url string, transport string, headers map[string]string) *Client

NewClient creates a new MCP client

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, toolName string, arguments map[string]interface{}) (interface{}, error)

CallTool calls a tool on the MCP server

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

Connect connects to MCP server

func (*Client) Disconnect

func (c *Client) Disconnect(ctx context.Context) error

Disconnect disconnects from MCP server

func (*Client) GetTools

func (c *Client) GetTools() []types.Tool

GetTools gets available tools

func (*Client) IsConnected

func (c *Client) IsConnected() bool

IsConnected checks if connected

type MCPTool

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

MCPTool MCP tool implementation

func NewMCPTool

func NewMCPTool(name, description string, schema map[string]interface{}) *MCPTool

NewMCPTool creates a new MCP tool

func (*MCPTool) Description

func (t *MCPTool) Description() string

Description gets tool description

func (*MCPTool) Execute

func (t *MCPTool) Execute(ctx context.Context, input map[string]interface{}) (interface{}, error)

Execute executes the tool

func (*MCPTool) Metadata

func (t *MCPTool) Metadata() types.ToolMetadata

Metadata gets tool metadata

func (*MCPTool) Name

func (t *MCPTool) Name() string

Name gets tool name

func (*MCPTool) Schema

func (t *MCPTool) Schema() map[string]interface{}

Schema gets tool schema

func (*MCPTool) SetClient

func (t *MCPTool) SetClient(client *Client)

SetClient sets MCP client

Jump to

Keyboard shortcuts

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