mcp

package
v0.31.71 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MCPToolName

func MCPToolName(serverName, toolName string) string

Types

type Client

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

func NewClient

func NewClient(servers []ServerConfig) *Client

func (*Client) BuildTools

func (c *Client) BuildTools(ctx context.Context) ([]tool.Tool, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) ListServers

func (c *Client) ListServers(ctx context.Context) ([]ServerStatus, error)

func (*Client) ListTools

func (c *Client) ListTools(ctx context.Context) ([]ToolInfo, error)

func (*Client) SetCommandAllowlist

func (c *Client) SetCommandAllowlist(commands []string)

func (*Client) SetServers

func (c *Client) SetServers(servers []ServerConfig)

type ServerConfig

type ServerConfig = config.MCPServer

type ServerStatus

type ServerStatus struct {
	Name      string `json:"name"`
	Command   string `json:"command,omitempty"`
	URL       string `json:"url,omitempty"`
	Transport string `json:"transport,omitempty"`
	Source    string `json:"source,omitempty"`
	AuthMode  string `json:"auth_mode,omitempty"`
	Connected bool   `json:"connected"`
	ToolCount int    `json:"tool_count"`
	Error     string `json:"error,omitempty"`
}

type ToolInfo

type ToolInfo struct {
	Server      string          `json:"server"`
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	InputSchema json.RawMessage `json:"input_schema,omitempty"`
}

Jump to

Keyboard shortcuts

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