mcp

package
v1.0.1-0...-d5ce356 Latest Latest
Warning

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

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

Documentation

Overview

Package mcp defines outbound MCP capabilities using protocol contracts rather than any concrete MCP implementation. Clients are borrowed from providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallOptions

type CallOptions struct {
	Header http.Header
}

CallOptions contains explicit per-call transport metadata. Header values are forwarded unchanged during initialization, discovery, and tool invocation; implementations must isolate sessions with different header sets.

type Client

type Client interface {
	CallTool(ctx context.Context, request *schema.CallToolRequest, options CallOptions) (*schema.CallToolResult, error)
}

Client invokes an MCP tool and preserves its native result semantics. A tool's isError result is distinct from a transport or protocol error. Lifecycle and session cleanup belong to the provider's owner.

type Options

type Options struct {
	URL             string            `json:"url"`
	Transport       string            `json:"transport,omitempty"`
	ProtocolVersion string            `json:"protocolVersion,omitempty"`
	Tool            string            `json:"tool"`
	Header          map[string]string `json:"header,omitempty"`
	MaxSessions     int               `json:"maxSessions,omitempty"`
	client.Limits
}

Options describes an MCP server, protocol, tool and session bounds. Per-call credentials are supplied explicitly through CallOptions rather than inferred.

type Provider

type Provider interface {
	Client(ctx context.Context, options Options) (Client, error)
}

Provider resolves or reuses an MCP client from explicit deployment options. Runtime composition supplies its implementation through native DI.

Jump to

Keyboard shortcuts

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