Documentation
¶
Index ¶
- Constants
- type Client
- func NewSSE(ctx context.Context, baseURL string, options ...SSEOption) (*Client, error)
- func NewStdio(ctx context.Context, path string, args []string, options ...StdioOption) (*Client, error)
- func NewStreamableHTTP(ctx context.Context, baseURL string, options ...StreamableHTTPOption) (*Client, error)
- type SSEOption
- type StdioOption
- type StreamableHTTPOption
Constants ¶
const ( // DefaultClientName is the default name for MCP client DefaultClientName = "gollem" // DefaultClientVersion is the default version for MCP client // Empty string means no specific version is advertised DefaultClientVersion = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the MCP client that allows to communicate with MCP server.
func NewStdio ¶
func NewStdio(ctx context.Context, path string, args []string, options ...StdioOption) (*Client, error)
NewStdio creates a new MCP client for local MCP executable server via stdio.
func NewStreamableHTTP ¶
func NewStreamableHTTP(ctx context.Context, baseURL string, options ...StreamableHTTPOption) (*Client, error)
NewStreamableHTTP creates a new MCP client for remote MCP server via Streamable HTTP.
type SSEOption ¶
type SSEOption func(*Client)
SSEOption is the option for the MCP client for remote MCP server via SSE.
func WithSSEClient ¶
WithSSEClient sets the HTTP client for the MCP client.
func WithSSEClientInfo ¶
WithSSEClientInfo sets the client name and version for the MCP client.
func WithSSEHeaders ¶
WithSSEHeaders sets the headers for the MCP client. It replaces the existing headers setting.
type StdioOption ¶
type StdioOption func(*Client)
StdioOption is the option for the MCP client for local MCP server via Stdio.
func WithEnvVars ¶
func WithEnvVars(envVars []string) StdioOption
WithEnvVars sets the environment variables for the MCP client.
func WithStdioClientInfo ¶
func WithStdioClientInfo(name, version string) StdioOption
WithStdioClientInfo sets the client name and version for the MCP client.
type StreamableHTTPOption ¶
type StreamableHTTPOption func(*Client)
StreamableHTTPOption is the option for the MCP client for remote MCP server via Streamable HTTP.
func WithStreamableHTTPClient ¶
func WithStreamableHTTPClient(client *http.Client) StreamableHTTPOption
WithStreamableHTTPClient sets the HTTP client for the MCP client.
func WithStreamableHTTPClientInfo ¶
func WithStreamableHTTPClientInfo(name, version string) StreamableHTTPOption
WithStreamableHTTPClientInfo sets the client name and version for the MCP client.
func WithStreamableHTTPHeaders ¶
func WithStreamableHTTPHeaders(headers map[string]string) StreamableHTTPOption
WithStreamableHTTPHeaders sets the headers for the MCP client. It replaces the existing headers setting.