Versions in this module Expand all Collapse all v1 v1.5.0 Apr 2, 2026 Changes in this version + type ClientInfo struct + Name string + Version string + type Error struct + Code int + Data interface{} + Message string + type EventHandler func(event HostEvent) + type EventType string + const EventResourceAccessed + const EventServerConnected + const EventServerDisconnected + const EventServerError + const EventSessionClosed + const EventSessionCreated + const EventToolCalled + type Host struct + func NewHost(config HostConfig) *Host + func (h *Host) CallTool(ctx context.Context, serverID string, toolName string, ...) (json.RawMessage, error) + func (h *Host) CloseSession(sessionID string) error + func (h *Host) ConnectServer(ctx context.Context, serverID string) error + func (h *Host) CreateSession(clientInfo ClientInfo, serverID string) (*Session, error) + func (h *Host) DisconnectServer(serverID string) error + func (h *Host) GetServer(id string) (*Server, error) + func (h *Host) ID() string + func (h *Host) ListServers() []*Server + func (h *Host) ListTools(serverID string) ([]Tool, error) + func (h *Host) Name() string + func (h *Host) ReadResource(ctx context.Context, serverID string, uri string) (json.RawMessage, error) + func (h *Host) RegisterServer(id string, name string, transport Transport) (*Server, error) + func (h *Host) SetEventHandler(handler EventHandler) + func (h *Host) Shutdown() error + type HostCapabilities struct + Logging bool + Prompts bool + Resources bool + Tools bool + type HostConfig struct + AutoReconnect bool + Capabilities HostCapabilities + ConnectionTimeout time.Duration + MaxConnections int + Name string + RequestTimeout time.Duration + Version string + type HostEvent struct + Data interface{} + Message string + ServerID string + SessionID string + Timestamp time.Time + Type EventType + type LoggingCapability struct + type Message struct + Error *Error + ID interface{} + JSONRPC string + Method string + Params json.RawMessage + Result json.RawMessage + type Prompt struct + Arguments []PromptArgument + Description string + Name string + type PromptArgument struct + Description string + Name string + Required bool + type PromptsCapability struct + ListChanged bool + type Resource struct + Description string + MimeType string + Name string + URI string + type ResourcesCapability struct + ListChanged bool + Subscribe bool + type Server struct + Capabilities ServerCapabilities + ConnectTime time.Time + ID string + LastPing time.Time + Name string + Prompts []Prompt + Resources []Resource + Status ServerStatus + Tools []Tool + Transport Transport + Version string + type ServerCapabilities struct + Logging *LoggingCapability + Prompts *PromptsCapability + Resources *ResourcesCapability + Tools *ToolsCapability + type ServerStatus string + const ServerStatusConnected + const ServerStatusConnecting + const ServerStatusDisconnected + const ServerStatusError + type Session struct + ClientInfo ClientInfo + CreatedAt time.Time + ID string + LastActivity time.Time + ServerID string + Status SessionStatus + type SessionStatus string + const SessionStatusActive + const SessionStatusClosed + const SessionStatusInactive + type Tool struct + Description string + InputSchema json.RawMessage + Name string + type ToolsCapability struct + ListChanged bool + type Transport interface + Connect func(ctx context.Context) error + Disconnect func() error + IsConnected func() bool + Receive func() (Message, error) + Send func(message Message) error