Documentation
¶
Index ¶
- Variables
- func EnsureSessionInitialized(ctx context.Context, session *ClientSession) errordeprecated
- func NonNilContext(ctx context.Context) context.Contextdeprecated
- func NormalizeHTTPURL(raw string, allowSchemeGuess bool) (string, error)deprecated
- func ParseHTTPFamilySpec(spec string) (kind string, endpoint string, matched bool, err error)deprecated
- type CallToolParams
- type CallToolResult
- type Client
- type ClientOptions
- type ClientSession
- type ClientSessionOptions
- type CommandTransport
- type ConnectOption
- type Connection
- type Content
- type IOTransport
- type Implementation
- type InMemoryTransport
- type InitializeParams
- type InitializeResult
- type ListToolsParams
- type ListToolsResult
- type SSEClientTransport
- type SSEHandler
- type SSEOptions
- type ServerCapabilities
- type SpecClientdeprecated
- type StdioTransport
- type StreamableClientTransport
- type TextContent
- type Tool
- type ToolAnnotations
- type ToolCallResult
- type ToolDescriptor
- type ToolHandler
- type ToolHandlerFor
- type ToolListChangedRequest
- type Transport
- func BuildSSETransport(endpoint string, allowSchemeGuess bool) (Transport, error)deprecated
- func BuildSessionTransport(ctx context.Context, spec string) (Transport, error)deprecated
- func BuildStdioTransport(ctx context.Context, cmdSpec string) (Transport, error)deprecated
- func BuildStreamableTransport(endpoint string) (Transport, error)deprecated
Constants ¶
This section is empty.
Variables ¶
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 NormalizeHTTPURL
deprecated
Types ¶
type CallToolParams ¶
type CallToolParams = mcpsdk.CallToolParams
type CallToolResult ¶
type CallToolResult = mcpsdk.CallToolResult
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 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 ToolAnnotations ¶
type ToolAnnotations = mcpsdk.ToolAnnotations
type ToolCallResult ¶
type ToolCallResult = mcpsdk.CallToolResult
type ToolDescriptor ¶
type ToolHandler ¶
type ToolHandler = mcpsdk.ToolHandler
type ToolHandlerFor ¶
type ToolHandlerFor[In, Out any] = mcpsdk.ToolHandlerFor[In, Out]
type ToolListChangedRequest ¶
type ToolListChangedRequest = mcpsdk.ToolListChangedRequest