Help us shape the future of Go! Take the 2026 Go Developer Survey

infrastructure

package
v0.233.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ProtocolVersion = "2026-07-28"
)

infer speaks one MCP revision. 2026-07-28 is stateless: there is no initialize handshake and no session, and every request carries its version in params._meta, mirrored into headers. Servers on older revisions are not supported; there is no fallback.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client speaks MCP 2026-07-28 to one server.

func NewClient

func NewClient(url string) *Client

NewClient returns a client for the server at url. Callers bound each call with the context's deadline.

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, name string, args map[string]any) (mcpdomain.CallResult, error)

CallTool runs a tool and flattens its content blocks to text. arguments is always sent, as {} when there are none, since some servers fail to decode a call without it.

func (*Client) Discover

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

Discover asks the server which protocol versions it speaks. Anything but a transport failure, auth refusal or a list naming ProtocolVersion means the server is on another revision.

func (*Client) ListTools

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

ListTools fetches every page of the server's tools.

Jump to

Keyboard shortcuts

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