Versions in this module Expand all Collapse all v0 v0.2.0 Nov 29, 2026 Changes in this version + var ErrClosed = errors.New("mcp: client closed") + var ErrConfig = errors.New("mcp: invalid client configuration") + var ErrConnect = errors.New("mcp: connection failed") + var ErrDiscovery = errors.New("mcp: discovery failed") + var ErrLimit = errors.New("mcp: tool result exceeds limit") + var ErrProtocol = errors.New("mcp: incompatible protocol or server capabilities") + var ErrRemote = errors.New("mcp: remote tool failed") + var ErrUnsupported = errors.New("mcp: unsupported tool result") + type Binding struct + RemoteName string + Spec agent.ToolSpec + type Catalog struct + Complete bool + Pages int + Tools []ToolInfo + func DiscoverHTTP(ctx context.Context, h HTTPConfig, cfg DiscoveryConfig) (Catalog, error) + func DiscoverIO(ctx context.Context, stream io.ReadWriteCloser, cfg DiscoveryConfig) (Catalog, error) + type Client struct + func ConnectHTTP(ctx context.Context, h HTTPConfig, cfg Config) (*Client, error) + func ConnectIO(ctx context.Context, stream io.ReadWriteCloser, cfg Config) (*Client, error) + func (c *Client) Close() error + func (c *Client) Tools() []agent.Tool + type Config struct + Bindings []Binding + CallTimeout time.Duration + ConnectTimeout time.Duration + ProtocolVersion string + type DiscoveryConfig struct + MaxPages int + MaxTools int + ProtocolVersion string + Timeout time.Duration + type HTTPConfig struct + BearerToken string + Endpoint string + RootCAs *x509.CertPool + type TextResult struct + Text []string + type ToolInfo struct + Description string + Name string