mcp

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewClient             = mcpsdk.NewClient
	NewServer             = mcpsdk.NewServer
	NewInMemoryTransports = mcpsdk.NewInMemoryTransports
)

Functions

func EnsureSessionInitialized deprecated

func EnsureSessionInitialized(ctx context.Context, session *ClientSession) error

EnsureSessionInitialized validates that the session completed MCP initialization.

Deprecated: internal compatibility helper; prefer handling initialization checks in callers directly.

func NonNilContext deprecated

func NonNilContext(ctx context.Context) context.Context

NonNilContext keeps backward compatibility for helpers that need a non-nil context.

Deprecated: internal compatibility helper.

func NormalizeHTTPURL deprecated

func NormalizeHTTPURL(raw string, allowSchemeGuess bool) (string, error)

NormalizeHTTPURL exposes URL normalization for compatibility tests.

Deprecated: internal compatibility helper.

func ParseHTTPFamilySpec deprecated

func ParseHTTPFamilySpec(spec string) (kind string, endpoint string, matched bool, err error)

ParseHTTPFamilySpec exposes the HTTP family spec parsing logic for tests.

Deprecated: internal compatibility helper.

Types

type CallToolParams

type CallToolParams = mcpsdk.CallToolParams

type CallToolResult

type CallToolResult = mcpsdk.CallToolResult

type Client

type Client = mcpsdk.Client

type ClientOptions

type ClientOptions = mcpsdk.ClientOptions

type ClientSession

type ClientSession = mcpsdk.ClientSession

func ConnectSession

func ConnectSession(ctx context.Context, spec string) (*ClientSession, error)

ConnectSession establishes a ClientSession using the same spec parsing logic as the tool registry.

func ConnectSessionWithOptions

func ConnectSessionWithOptions(ctx context.Context, spec string, opts ...ConnectOption) (*ClientSession, error)

ConnectSessionWithOptions establishes a ClientSession using the same spec parsing logic as the tool registry, optionally wiring MCP notifications into the SDK event bus.

type ClientSessionOptions

type ClientSessionOptions = mcpsdk.ClientSessionOptions

type CommandTransport

type CommandTransport = mcpsdk.CommandTransport

type ConnectOption

type ConnectOption func(*connectConfig)

func WithEventBus

func WithEventBus(bus *coreevents.Bus) ConnectOption

WithEventBus publishes MCPToolsChanged events to the provided bus when the connected MCP server sends notifications/tools/list_changed.

type Connection

type Connection = mcpsdk.Connection

type Content

type Content = mcpsdk.Content

type IOTransport

type IOTransport = mcpsdk.IOTransport

type Implementation

type Implementation = mcpsdk.Implementation

type InMemoryTransport

type InMemoryTransport = mcpsdk.InMemoryTransport

type InitializeParams

type InitializeParams = mcpsdk.InitializeParams

type InitializeResult

type InitializeResult = mcpsdk.InitializeResult

type ListToolsParams

type ListToolsParams = mcpsdk.ListToolsParams

type ListToolsResult

type ListToolsResult = mcpsdk.ListToolsResult

type SSEClientTransport

type SSEClientTransport = mcpsdk.SSEClientTransport

type SSEHandler

type SSEHandler = mcpsdk.SSEHandler

type SSEOptions

type SSEOptions = mcpsdk.SSEOptions

type ServerCapabilities

type ServerCapabilities = mcpsdk.ServerCapabilities

type SpecClient deprecated

type SpecClient interface {
	ListTools(ctx context.Context) ([]ToolDescriptor, error)
	InvokeTool(ctx context.Context, name string, args map[string]any) (*ToolCallResult, error)
	Close() error
}

SpecClient is a backward-compatible client that dials an MCP server from a spec string (e.g., "stdio://cmd" or "https://server") and exposes a pared down API surface.

Deprecated: this exists only for the legacy public API compatibility layer.

func NewSpecClient deprecated

func NewSpecClient(spec string) (SpecClient, error)

NewSpecClient connects to an MCP server described by spec and returns a compatibility wrapper.

Deprecated: prefer using the full go-sdk ClientSession directly.

type StdioTransport

type StdioTransport = mcpsdk.StdioTransport

type StreamableClientTransport

type StreamableClientTransport = mcpsdk.StreamableClientTransport

type TextContent

type TextContent = mcpsdk.TextContent

type Tool

type Tool = mcpsdk.Tool

type ToolAnnotations

type ToolAnnotations = mcpsdk.ToolAnnotations

type ToolCallResult

type ToolCallResult = mcpsdk.CallToolResult

type ToolDescriptor

type ToolDescriptor = mcpsdk.Tool

type ToolHandler

type ToolHandler = mcpsdk.ToolHandler

type ToolHandlerFor

type ToolHandlerFor[In, Out any] = mcpsdk.ToolHandlerFor[In, Out]

type ToolListChangedRequest

type ToolListChangedRequest = mcpsdk.ToolListChangedRequest

type Transport

type Transport = mcpsdk.Transport

func BuildSSETransport deprecated

func BuildSSETransport(endpoint string, allowSchemeGuess bool) (Transport, error)

BuildSSETransport exposes SSE transport construction for compatibility.

Deprecated: use ConnectSession instead.

func BuildSessionTransport deprecated

func BuildSessionTransport(ctx context.Context, spec string) (Transport, error)

BuildSessionTransport exposes the spec parsing logic for compatibility testing helpers.

Deprecated: use ConnectSession instead.

func BuildStdioTransport deprecated

func BuildStdioTransport(ctx context.Context, cmdSpec string) (Transport, error)

BuildStdioTransport exposes stdio transport construction for compatibility.

Deprecated: use ConnectSession instead.

func BuildStreamableTransport deprecated

func BuildStreamableTransport(endpoint string) (Transport, error)

BuildStreamableTransport exposes streamable transport construction for compatibility.

Deprecated: use ConnectSession instead.

Jump to

Keyboard shortcuts

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